X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/aeae287077a886690921baaea0a0f1149bc891db..13cf91d9f8bff4826b27829e441ad75efed02cdb:/MainController.m diff --git a/MainController.m b/MainController.m index 3c1cb6c..9313f11 100755 --- a/MainController.m +++ b/MainController.m @@ -290,12 +290,9 @@ static MainController *sharedController; { if ([networkController isConnectedToServer]) { [statusItem setMenu:[menuController menu]]; - if ([[networkController networkObject] remote] == nil) { - [self networkError:nil]; - } } - if ( [self songChanged] && (timerUpdating != YES) ) { + if ( [self songChanged] && (timerUpdating != YES) && (playerRunningState == ITMTRemotePlayerRunning) ) { ITDebugLog(@"The song changed."); timerUpdating = YES; @@ -409,6 +406,7 @@ static MainController *sharedController; { ITDebugLog(@"Selecting playlist %i", index); NS_DURING + //[[self currentRemote] switchToPlaylistAtIndex:(index % 1000) ofSourceAtIndex:(index / 1000)]; [[self currentRemote] switchToPlaylistAtIndex:index]; NS_HANDLER [self networkError:localException]; @@ -502,6 +500,10 @@ static MainController *sharedController; - (ITMTRemote *)currentRemote { + if ([networkController isConnectedToServer] && ![[networkController networkObject] isValid]) { + [self networkError:nil]; + return nil; + } return currentRemote; } @@ -1071,12 +1073,12 @@ static MainController *sharedController; NS_DURING if (!note || [[[note userInfo] objectForKey:@"NSApplicationName"] isEqualToString:[[self currentRemote] playerFullName]]) { ITDebugLog(@"Remote application terminated."); + playerRunningState = ITMTRemotePlayerNotRunning; [[self currentRemote] halt]; [refreshTimer invalidate]; [refreshTimer release]; refreshTimer = nil; [self clearHotKeys]; - playerRunningState = ITMTRemotePlayerNotRunning; if ([df objectForKey:@"ShowPlayer"] != nil) { ITHotKey *hotKey;