X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/5ba3df3581e79b113dcf5eb6346baf246fa49da2..9c8f6e1b9b0b947d898a3d9bae3acb3999879791:/MainController.m diff --git a/MainController.m b/MainController.m index e6d338b..edd1e78 100755 --- a/MainController.m +++ b/MainController.m @@ -371,6 +371,11 @@ static MainController *sharedController; { ITHotKey *hotKey; ITDebugLog(@"Setting up hot keys."); + + if (playerRunningState == ITMTRemotePlayerNotRunning) { + return; + } + if ([df objectForKey:@"PlayPause"] != nil) { ITDebugLog(@"Setting up play pause hot key."); hotKey = [[ITHotKey alloc] init]; @@ -620,6 +625,12 @@ static MainController *sharedController; { float rating = [currentRemote currentSongRating]; ITDebugLog(@"Incrementing rating."); + + if ([currentRemote currentPlaylistIndex] == 0) { + ITDebugLog(@"No song playing, rating change aborted."); + return; + } + rating += 0.2; if (rating > 1.0) { rating = 1.0; @@ -635,6 +646,12 @@ static MainController *sharedController; { float rating = [currentRemote currentSongRating]; ITDebugLog(@"Decrementing rating."); + + if ([currentRemote currentPlaylistIndex] == 0) { + ITDebugLog(@"No song playing, rating change aborted."); + return; + } + rating -= 0.2; if (rating < 0.0) { rating = 0.0; @@ -678,6 +695,25 @@ static MainController *sharedController; [statusWindowController showShuffleWindow:newShuffleEnabled]; } +- (void)registerNowOK +{ + [[StatusWindow sharedWindow] setLocked:NO]; + [[StatusWindow sharedWindow] vanish:self]; + [[StatusWindow sharedWindow] setIgnoresMouseEvents:YES]; + + [self blingNow]; +} + +- (void)registerNowCancel +{ + [[StatusWindow sharedWindow] setLocked:NO]; + [[StatusWindow sharedWindow] vanish:self]; + [[StatusWindow sharedWindow] setIgnoresMouseEvents:YES]; + + [NSApp terminate]; +} + + /*************************************************************************/ #pragma mark - #pragma mark WORKSPACE NOTIFICATION HANDLERS