if ([defaults boolForKey:@"showAlbum"]) {
NSString *curAlbum = [currentRemote currentSongAlbum];
ITDebugLog(@"Add Track Album (\"%@\") menu item.", curAlbum);
- if ([curAlbum length]) {
+ if ( curAlbum ) {
[menu indentItem:
[menu addItemWithTitle:curAlbum action:nil keyEquivalent:@""]];
}
if ([defaults boolForKey:@"showArtist"]) {
NSString *curArtist = [currentRemote currentSongArtist];
ITDebugLog(@"Add Track Artist (\"%@\") menu item.", curArtist);
- if ([curArtist length]) {
+ if ( curArtist ) {
[menu indentItem:
[menu addItemWithTitle:curArtist action:nil keyEquivalent:@""]];
}
if ([defaults boolForKey:@"showTrackNumber"]) {
int track = [currentRemote currentSongTrack];
ITDebugLog(@"Add Track Number (\"Track %i\") menu item.", track);
- if (track) {
+ if ( track > 0 ) {
[menu indentItem:
[menu addItemWithTitle:[NSString stringWithFormat:@"%@ %i", NSLocalizedString(@"track", @"Track"), track] action:nil keyEquivalent:@""]];
}
}
- if ([defaults boolForKey:@"showTime"]) {
- int left = [[currentRemote currentSongRemaining] intValue];
- NSString *remaining = [NSString stringWithFormat:@"%i:%02i", left / 60, left % 60];
- ITDebugLog(@"Add Track Remaining (\"%@/%@\") menu item.", remaining, [currentRemote currentSongLength]);
- [menu indentItem:[menu addItemWithTitle:[NSString stringWithFormat:@"%@/%@", remaining, [currentRemote currentSongLength]] action:nil keyEquivalent:@""]];
+ if ([defaults boolForKey:@"showTime"] && ( ([currentRemote currentSongElapsed] != nil) || ([currentRemote currentSongLength] != nil) )) {
+ ITDebugLog(@"Add Track Elapsed (\"%@/%@\") menu item.", [currentRemote currentSongElapsed], [currentRemote currentSongLength]);
+ [menu indentItem:[menu addItemWithTitle:[NSString stringWithFormat:@"%@/%@", [currentRemote currentSongElapsed], [currentRemote currentSongLength]] action:nil keyEquivalent:@""]];
}
- if ([defaults boolForKey:@"showTrackRating"]) {
+ if ([defaults boolForKey:@"showTrackRating"] && ( [currentRemote currentSongRating] != -1.0 )) {
NSString *string = nil;
switch ((int)([currentRemote currentSongRating] * 5)) {
case 0:
[tempItem setState:NSOffState];
}
[[_eqMenu itemAtIndex:([currentRemote currentEQPresetIndex] - 1)] setState:NSOnState];
- }
-
- if (!_playingRadio) {
- if ([nextObject isEqualToString:@"songRating"]) {
+ } else if ([nextObject isEqualToString:@"songRating"] && ( [currentRemote currentSongRating] != -1 )) {
ITDebugLog(@"Add \"Song Rating\" submenu.");
tempItem = [menu addItemWithTitle:NSLocalizedString(@"songRating", @"Song Rating")
action:nil
}
}
}
- }
ITDebugLog(@"Finished building menu.");
[_currentMenu release];
_currentMenu = menu;
SetMenuItemKeyGlyph(menuRef, 0, kMenuBlankGlyph);
charcode = 'b';*/
unichar buffer;
- [[NSString stringWithString:@"_"] getCharacters:&buffer]; // this will have to do for now :(
+ [[NSString stringWithString:@" "] getCharacters:&buffer]; // this will have to do for now :(
charcode = buffer;
}
break;