- } else if ([currentItem isEqualToString:@"Fast Forward"]) {
- [[mainMenu addItemWithTitle:@"Fast Forward"action:@selector(fastForward:) keyEquivalent:@""] setTarget:self];
- } else if ([currentItem isEqualToString:@"Rewind"]) {
- [[mainMenu addItemWithTitle:@"Rewind" action:@selector(rewind:) keyEquivalent:@""] setTarget:self];
- } else if ([currentItem isEqualToString:@"EQ Presets"]) {
- [[mainMenu addItemWithTitle:@"EQ Presets" action:NULL keyEquivalent:@""] setSubmenu:[self eqPresetsMenu]];
- } else if ([currentItem isEqualToString:@"Playlists"]) {
- [[mainMenu addItemWithTitle:@"Playlists" action:NULL keyEquivalent:@""] setSubmenu:[self playlistsMenu]];
- } else if ([currentItem isEqualToString:@"Song Rating"]) {
- [[mainMenu addItemWithTitle:@"Song Rating"action:NULL keyEquivalent:@""] setSubmenu:[self songRatingMenu]];
- } else if ([currentItem isEqualToString:@"Upcoming Songs"]) {
- [[mainMenu addItemWithTitle:@"Upcoming Songs"action:NULL keyEquivalent:@""] setSubmenu:[self upcomingSongsMenu]];
- } else if ([currentItem isEqualToString:@"PreferencesÉ"]) {
- [[mainMenu addItemWithTitle:@"Preferences..." action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
- } else if ([currentItem isEqualToString:@"Quit"]) {
- [[mainMenu addItemWithTitle:@"Quit" action:@selector(quitMenuTunes:) keyEquivalent:@""] setTarget:self];
- } else if ([currentItem isEqualToString:@"Current Song Info"]) {
- //Current Song Info
- {
- int currentSongIndex = [currentRemote currentSongIndex];
-
- if (currentSongIndex == 0) {
- [mainMenu addItemWithTitle:@"No Song" action:NULL keyEquivalent:@""];
- } else {
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- [mainMenu addItemWithTitle:@"Now Playing" action:NULL keyEquivalent:@""];
-
- if ([defaults objectForKey:@"showName"]) {
- [mainMenu addItemWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongTitle]] action:NULL keyEquivalent:@""];
- }
-
- if ([defaults objectForKey:@"showAlbum"]) {
- [mainMenu addItemWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongAlbum]] action:NULL keyEquivalent:@""];
- }
-
- if ([defaults objectForKey:@"showArtist"]) {
- [mainMenu addItemWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongArtist]] action:NULL keyEquivalent:@""];
- }
-
- if ([defaults objectForKey:@"showTime"]) {
- [mainMenu addItemWithTitle:[NSString stringWithFormat:@" %@", [currentRemote currentSongLength]] action:NULL keyEquivalent:@""];
- }
- }
- }
- } else if ([currentItem isEqualToString:@"<separator>"]) {
- [mainMenu addItem:[NSMenuItem separatorItem]];
+ } else if ([item isEqualToString:@"Fast Forward"]) {
+ [menu addItemWithTitle:@"Fast Forward"
+ action:@selector(fastForward:)
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Rewind"]) {
+ [menu addItemWithTitle:@"Rewind"
+ action:@selector(rewind:)
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Show Player"]) {
+ [menu addItemWithTitle:[NSString stringWithFormat:@"Show %@", [currentRemote playerSimpleName]]
+ action:@selector(showPlayer:)
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Upcoming Songs"]) {
+ upcomingSongsItem = [menu addItemWithTitle:@"Upcoming Songs"
+ action:nil
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Playlists"]) {
+ playlistItem = [menu addItemWithTitle:@"Playlists"
+ action:nil
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"EQ Presets"]) {
+ eqItem = [menu addItemWithTitle:@"EQ Presets"
+ action:nil
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"PreferencesÉ"]) {
+ [menu addItemWithTitle:@"PreferencesÉ"
+ action:@selector(showPreferences:)
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Quit"]) {
+ [menu addItemWithTitle:@"Quit"
+ action:@selector(quitMenuTunes:)
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Current Track Info"]) {
+ trackInfoIndex = [menu numberOfItems];
+ [menu addItemWithTitle:@"No Song"
+ action:nil
+ keyEquivalent:@""];
+ } else if ([item isEqualToString:@"Song Rating"]) {
+ unichar fullstar = 0x2605;
+ unichar emptystar = 0x2606;
+ NSString *fullStarChar = [NSString stringWithCharacters:&fullstar length:1];
+ NSString *emptyStarChar = [NSString stringWithCharacters:&emptystar length:1];
+ NSMenuItem *item;
+
+ ratingItem = [menu addItemWithTitle:@"Song Rating"
+ action:nil
+ keyEquivalent:@""];
+
+ ratingMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:0];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", fullStarChar, emptyStarChar, emptyStarChar, emptyStarChar, emptyStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:20];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", fullStarChar, fullStarChar, emptyStarChar, emptyStarChar, emptyStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:40];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", fullStarChar, fullStarChar, fullStarChar, emptyStarChar, emptyStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:60];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", fullStarChar, fullStarChar, fullStarChar, fullStarChar, emptyStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:80];
+
+ item = [ratingMenu addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@%@", fullStarChar, fullStarChar, fullStarChar, fullStarChar, fullStarChar] action:@selector(selectSongRating:) keyEquivalent:@""];
+ [item setTag:100];
+
+ [ratingItem setSubmenu:ratingMenu];
+ } else if ([item isEqualToString:@"<separator>"]) {
+ [menu addItem:[NSMenuItem separatorItem]];