- }
-
- 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"]];
+
+ 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];
+ }
+
+ } else if ([menu indexOfItemWithTitle:@"No Song"] == -1) {
+ [menu removeItemAtIndex:trackInfoIndex];
+ [menu removeItemAtIndex:trackInfoIndex];
+
+ if (didHaveAlbumName) {
+ [menu removeItemAtIndex:trackInfoIndex];
+ }
+
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"No Song" action:nil keyEquivalent:@""];