git.ithinksw.org
/
MenuTunes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc0ea78
)
Fixed it so network players will use the refresh timer to update properly again.
author
Kent Sutherland
<ksuther@ithinksw.com>
Mon, 12 Dec 2005 16:31:57 +0000
(16:31 +0000)
committer
Kent Sutherland
<ksuther@ithinksw.com>
Mon, 12 Dec 2005 16:31:57 +0000
(16:31 +0000)
MainController.m
patch
|
blob
|
history
diff --git
a/MainController.m
b/MainController.m
index
4994a7d
..
b2ea25e
100755
(executable)
--- a/
MainController.m
+++ b/
MainController.m
@@
-140,6
+140,8
@@
static MainController *sharedController;
currentRemote = [self loadRemote];
[[self currentRemote] begin];
currentRemote = [self loadRemote];
[[self currentRemote] begin];
+ [[self currentRemote] currentSongElapsed];
+
//Turn on network stuff if needed
networkController = [[NetworkController alloc] init];
if ([df boolForKey:@"enableSharing"]) {
//Turn on network stuff if needed
networkController = [[NetworkController alloc] init];
if ([df boolForKey:@"enableSharing"]) {
@@
-410,7
+412,12
@@
static MainController *sharedController;
- (void)timerUpdate
{
- (void)timerUpdate
{
- NSString *identifier = [[self currentRemote] playerStateUniqueIdentifier];
+ NSString *identifier = nil;
+ NS_DURING
+ identifier = [[self currentRemote] playerStateUniqueIdentifier];
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
if (refreshTimer && identifier == nil) {
if ([statusItem isEnabled]) {
[statusItem setToolTip:@"iTunes not responding."];
if (refreshTimer && identifier == nil) {
if ([statusItem isEnabled]) {
[statusItem setToolTip:@"iTunes not responding."];
@@
-1219,9
+1226,9
@@
static MainController *sharedController;
- (void)updateTime:(NSTimer *)timer
{
- (void)updateTime:(NSTimer *)timer
{
- StatusWindow *sw = [StatusWindow sharedWindow];
+ StatusWindow *sw =
(StatusWindow *)
[StatusWindow sharedWindow];
_timeUpdateCount++;
_timeUpdateCount++;
- if (
_timeUpdateCount < (int)[sw exitDelay] + (int)[[sw exitEffect] effectTime] + (int)[[sw entryEffect] effectTime]
) {
+ if (
[sw visibilityState] != ITWindowHiddenState
) {
NSString *time = nil, *length;
NS_DURING
length = [[self currentRemote] currentSongLength];
NSString *time = nil, *length;
NS_DURING
length = [[self currentRemote] currentSongLength];
@@
-1519,12
+1526,14
@@
static MainController *sharedController;
if (refreshTimer) {
[refreshTimer invalidate];
}
if (refreshTimer) {
[refreshTimer invalidate];
}
- refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:([networkController isConnectedToServer] ? 10.0 : 0.5)
- target:self
- selector:@selector(timerUpdate)
- userInfo:nil
- repeats:YES] retain];
}
}
+
+ refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:([networkController isConnectedToServer] ? 10.0 : 0.5)
+ target:self
+ selector:@selector(timerUpdate)
+ userInfo:nil
+ repeats:YES] retain];
+
[self timerUpdate];
ITDebugLog(@"Connection successful.");
return 1;
[self timerUpdate];
ITDebugLog(@"Connection successful.");
return 1;
@@
-1549,10
+1558,12
@@
static MainController *sharedController;
[networkController disconnect];
if ([[self currentRemote] playerRunningState] == ITMTRemotePlayerRunning) {
[networkController disconnect];
if ([[self currentRemote] playerRunningState] == ITMTRemotePlayerRunning) {
+ refreshTimer = nil;
[self applicationLaunched:nil];
} else {
[self applicationTerminated:nil];
}
[self applicationLaunched:nil];
} else {
[self applicationTerminated:nil];
}
+
if (refreshTimer) {
[self timerUpdate];
};
if (refreshTimer) {
[self timerUpdate];
};