Fixed the bug where hotkeys would not activate if iTunes was launched
[MenuTunes.git] / MainController.m
index b695d80..dd8c51d 100755 (executable)
@@ -773,6 +773,7 @@ static MainController *sharedController;
 {
     if (!note || [[[note userInfo] objectForKey:@"NSApplicationName"] isEqualToString:[currentRemote playerFullName]]) {
         ITDebugLog(@"Remote application launched.");
+        playerRunningState = ITMTRemotePlayerRunning;
         [currentRemote begin];
         [self setLatestSongIdentifier:@""];
         [self timerUpdate];
@@ -783,7 +784,6 @@ static MainController *sharedController;
                              repeats:YES] retain];
         //[NSThread detachNewThreadSelector:@selector(startTimerInNewThread) toTarget:self withObject:nil];
         [self setupHotKeys];
-        playerRunningState = ITMTRemotePlayerRunning;
     }
 }
 
@@ -795,9 +795,6 @@ static MainController *sharedController;
         [refreshTimer invalidate];
         [refreshTimer release];
         refreshTimer = nil;
-        [registerTimer invalidate];
-        [registerTimer release];
-        registerTimer = nil;
         [self clearHotKeys];
         playerRunningState = ITMTRemotePlayerNotRunning;
      }