In Obj-C, the boolean data type is BOOL, not bool. This seems to be the only class...
[MenuTunes.git] / MenuTunes.m
index 487a5bb..1dd7df6 100755 (executable)
@@ -126,7 +126,7 @@ Things to do:
 {
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     if (![defaults objectForKey:@"menu"]) {
-        bool found = NO;
+        BOOL found = NO;
         NSMutableDictionary *loginwindow;
         NSMutableArray *loginarray;
         int i;
@@ -460,7 +460,7 @@ Things to do:
                     NSMenuItem *songItem;
                     songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
                     [songItem setTarget:self];
-                    [songItem setRepresentedObject:[NSNumber numberWithInt:i]];
+                    [songItem setRepresentedObject:[NSNumber numberWithInt:i + 1]];
                     [upcomingSongsMenu addItem:songItem];
                     [songItem release];
                 } else {
@@ -494,7 +494,7 @@ Things to do:
         NSMenuItem *tempItem;
         tempItem = [[NSMenuItem alloc] initWithTitle:playlistName action:@selector(selectPlaylist:) keyEquivalent:@""];
         [tempItem setTarget:self];
-        [tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
+        [tempItem setRepresentedObject:[NSNumber numberWithInt:i + 1]];
         [playlistMenu addItem:tempItem];
         [tempItem release];
     }
@@ -583,7 +583,7 @@ Things to do:
         int playlist = [currentRemote currentPlaylistIndex];
         
         if (trackPlayingIndex != lastSongIndex) {
-            bool wasPlayingRadio = isPlayingRadio;
+            BOOL wasPlayingRadio = isPlayingRadio;
             isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
             if (isPlayingRadio && !wasPlayingRadio) {
                 int i;
@@ -603,7 +603,7 @@ Things to do:
         else
         {
             if (playlist != [currentRemote currentPlaylistIndex]) {
-                bool wasPlayingRadio = isPlayingRadio;
+                BOOL wasPlayingRadio = isPlayingRadio;
                 isPlayingRadio = [[currentRemote classOfPlaylistAtIndex:playlist] isEqualToString:@"radio tuner playlist"];
                 if (isPlayingRadio && !wasPlayingRadio) {
                     int i;
@@ -701,8 +701,8 @@ Things to do:
         [currentRemote pause];
         [playPauseMenuItem setTitle:@"Play"];
     } else if ((state == forwarding) || (state == rewinding)) {
-        [currentRemote play];
         [currentRemote pause];
+        [currentRemote play];
     } else {
         [currentRemote play];
         [playPauseMenuItem setTitle:@"Pause"];
@@ -722,11 +722,13 @@ Things to do:
 - (void)fastForward:(id)sender
 {
     [currentRemote fastForward];
+    [playPauseMenuItem setTitle:@"Play"];
 }
 
 - (void)rewind:(id)sender
 {
     [currentRemote rewind];
+    [playPauseMenuItem setTitle:@"Play"];
 }
 
 //