diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index d35a4d49b..42c31d826 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -491,7 +491,12 @@ - (void)audioPlayer:(AudioPlayer *)player requestNextStream:(id)userInfo { PlaylistEntry *curEntry = (PlaylistEntry *)userInfo; - PlaylistEntry *pe = [playlistController getNextEntry:curEntry]; + PlaylistEntry *pe; + + if (curEntry.status == kCogEntryStoppingAfterCurrent) + return; + else + pe = [playlistController getNextEntry:curEntry]; [player setNextStream:[pe URL] withUserInfo:pe]; } diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 1b649a0ca..4dfff0b75 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -382,9 +382,6 @@ - (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe { - if (pe.status == kCogEntryStoppingAfterCurrent) - return nil; - if (repeat == RepeatOne) { return pe; } @@ -687,6 +684,14 @@ } } +- (IBAction)stopAfterCurrent:(id)sender +{ + if (currentEntry.status != kCogEntryStoppingAfterCurrent) + currentEntry.status = kCogEntryStoppingAfterCurrent; + else + currentEntry.status = kCogEntryPlaying; +} + -(BOOL)validateMenuItem:(NSMenuItem*)menuItem { SEL action = [menuItem action]; @@ -703,6 +708,9 @@ if (action == @selector(emptyQueueList:) && ([queueList count] < 1)) return NO; + if (action == @selector(stopAfterCurrent:) && (currentEntry.status == kCogEntryNormal)) + return NO; + // if nothing is selected, gray out these if ([[self selectedObjects] count] < 1) { @@ -723,12 +731,5 @@ return YES; } -- (IBAction)stopAfterCurrent:(id)sender -{ - if (currentEntry.status != kCogEntryStoppingAfterCurrent) - currentEntry.status = kCogEntryStoppingAfterCurrent; - else - currentEntry.status = kCogEntryPlaying; -} @end