- if ([curSongName length] > 0) {
- int index = [menu indexOfItemWithTitle:@"Now Playing"];
- if (index > -1) {
- if ([defaults boolForKey:@"showName"]) {
- [menu removeItemAtIndex:index + 1];
- }
- if (didHaveAlbumName && [defaults boolForKey:@"showAlbum"]) {
- [menu removeItemAtIndex:index + 1];
- }
- if (didHaveArtistName && [defaults boolForKey:@"showArtist"]) {
- [menu removeItemAtIndex:index + 1];
- }
- if ([defaults boolForKey:@"showTime"]) {
- [menu removeItemAtIndex:index + 1];
- }
- }
-
- if (!isPlayingRadio) {
- if ([defaults boolForKey:@"showTime"]) {
- menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongLength]]
- action:nil
- keyEquivalent:@""];
- [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
- [menuItem release];
- }
-
- if ([curArtistName length] > 0) {
- menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", curArtistName]
- action:nil
- keyEquivalent:@""];
- [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
- [menuItem release];
- }
-
- if ([curAlbumName length] > 0) {
- menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", curAlbumName]
- action:nil
- keyEquivalent:@""];
- [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
- [menuItem release];
- }
-
- if (songRatingMenuItem) {
- int rating = (int)[currentRemote currentSongRating] * 10;
- int i;
- for (i = 0; i < 5; i++) {
- [[ratingMenu itemAtIndex:i] setState:NSOffState];
- [[ratingMenu itemAtIndex:i] setTarget:self];
- }
- [[ratingMenu itemAtIndex:rating / 2] setState:NSOnState];
- }
- }
-
- if ([defaults boolForKey:@"showName"]) {
- menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", curSongName]
- action:nil
- keyEquivalent:@""];
- [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
- [menuItem release];
- }
-
- if (index == -1) {
- menuItem = [[NSMenuItem alloc] initWithTitle:@"Now Playing" action:nil keyEquivalent:@""];
- [menu removeItemAtIndex:[menu indexOfItemWithTitle:@"No Song"]];
- [menu insertItem:menuItem atIndex:trackInfoIndex];
- [menuItem release];
-
- [songRatingMenuItem setSubmenu:ratingMenu];
- [songRatingMenuItem setEnabled:YES];
+ title = [currentRemote currentSongTitle];
+
+ if (!isPlayingRadio) {
+ ([defaults boolForKey:@"showAlbum"]) ? (album = [currentRemote currentSongAlbum]) :
+ (album = @"");
+ ([defaults boolForKey:@"showArtist"]) ? (artist = [currentRemote currentSongArtist]) :
+ (artist = @"");
+ if ([defaults boolForKey:@"showTime"]) {
+ [menu insertItemWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongLength]] action:nil keyEquivalent:@"" atIndex:trackInfoIndex + 1];