X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/dace71fac17dd5c4999b770315c191d209e1c199..616ff6ad61cfc198ff23200bdb450c24d9436073:/MenuTunes.m diff --git a/MenuTunes.m b/MenuTunes.m index 145f702..9115c10 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -1,12 +1,3 @@ -/* -Things to do: -¥ Make preferences window pretty -¥ Optimize -¥ Apple Events! Apple Events! Apple Events! -¥ Manual and webpage -¥ Finish up registration frontend -*/ - #import "MenuTunes.h" #import "PreferencesController.h" #import "HotKeyCenter.h" @@ -53,7 +44,7 @@ Things to do: menu = [[NSMenu alloc] initWithTitle:@""]; - if ([currentRemote isAppRunning]) { + if ( ( [currentRemote remotePlayerStatus] == ITMTRemotePlayerRunning ) ) { [self remotePlayerLaunched:nil]; } else { [self remotePlayerTerminated:nil]; @@ -331,7 +322,7 @@ Things to do: NSMenuItem *menuItem; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - if (!isAppRunning) { + if ( ( isAppRunning = ITMTRemotePlayerNotRunning ) ) { return; } @@ -549,7 +540,7 @@ Things to do: } [eqItem setSubmenu:eqMenu]; - [[eqMenu itemAtIndex:[currentRemote currentEQPresetIndex] - 1] setState:NSOnState]; + [[eqMenu itemAtIndex:[currentRemote currentEQPresetIndex] + 1] setState:NSOnState]; } - (void)clearHotKeys @@ -707,19 +698,24 @@ Things to do: - (void)remotePlayerLaunched:(NSNotification *)note { - isAppRunning = YES; + isAppRunning = ITMTRemotePlayerRunning; //Restart the timer refreshTimer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(timerUpdate) userInfo:nil repeats:YES]; [self rebuildMenu]; //Rebuild the menu since no songs will be playing - [self rebuildPlaylistMenu]; + if (playlistItem) { + [self rebuildPlaylistMenu]; + } + if (eqItem) { + [self rebuildEQPresetsMenu]; + } [statusItem setMenu:menu]; //Set the menu back to the main one } - (void)remotePlayerTerminated:(NSNotification *)note { - isAppRunning = NO; + isAppRunning = ITMTRemotePlayerNotRunning; [menu release]; menu = [[NSMenu alloc] initWithTitle:@""]; @@ -836,7 +832,7 @@ Things to do: - (void)closePreferences { - if (isAppRunning) { + if ( ( isAppRunning == ITMTRemotePlayerRunning) ) { [self setupHotKeys]; } [prefsController release];