{
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];
{
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;
{
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;
[menu addItemWithTitle:title action:nil keyEquivalent:@""]];
}
+ if (!_playingRadio) {
if ([defaults boolForKey:@"showAlbum"]) {
NSString *curAlbum = [currentRemote currentSongAlbum];
ITDebugLog(@"Add Track Album (\"%@\") menu item.", curAlbum);
ITDebugLog(@"Add Track Rating (\"%@\") menu item.", string);
[menu indentItem:[menu addItemWithTitle:string action:nil keyEquivalent:@""]];
}
-
+ }
} else {
ITDebugLog(@"No Track is Playing, Add \"No Song\" menu item.");
[menu addItemWithTitle:NSLocalizedString(@"noSong", @"No Song") action:NULL keyEquivalent:@""];