When starting playback, start shuffle at selection

If starting playback from a given playlist entry, or selection, then
start shuffle mode from that track. Otherwise, start shuffle from the
beginning of the shuffle list.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-21 22:01:01 -08:00
parent b6330279ce
commit 9a2ac6ae5a
1 changed files with 6 additions and 1 deletions

View File

@ -140,7 +140,12 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
- (IBAction)play:(id)sender {
if([playlistController shuffle] != ShuffleOff) {
PlaylistEntry *pe = [playlistController shuffledEntryAtIndex:0];
PlaylistEntry *pe = nil;
NSInteger index = [playlistView selectedRow];
if(index != -1) pe = [playlistController entryAtIndex:index];
pe = [playlistController shuffledEntryAtIndex:(pe ? pe.shuffleIndex : 0)];
[self playEntryAtIndex:pe.index];
} else {
if([playlistView selectedRow] == -1)