Start playback on first shuffle item in shuffle

When in shuffle mode, start playback on the first item in the shuffle
list, rather than the selection, or the start of the playlist.

Fixes #241

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-21 21:53:41 -08:00
parent b63a076e21
commit b6330279ce
1 changed files with 9 additions and 4 deletions

View File

@ -139,11 +139,16 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
}
- (IBAction)play:(id)sender {
if([playlistView selectedRow] == -1)
[playlistView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
if([playlistController shuffle] != ShuffleOff) {
PlaylistEntry *pe = [playlistController shuffledEntryAtIndex:0];
[self playEntryAtIndex:pe.index];
} else {
if([playlistView selectedRow] == -1)
[playlistView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
if([playlistView selectedRow] > -1)
[self playEntryAtIndex:(int)[playlistView selectedRow]];
if([playlistView selectedRow] > -1)
[self playEntryAtIndex:(int)[playlistView selectedRow]];
}
}
NSDictionary *makeRGInfo(PlaylistEntry *pe) {