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>
This commit is contained in:
parent
b6330279ce
commit
9a2ac6ae5a
1 changed files with 6 additions and 1 deletions
|
@ -140,7 +140,12 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
|
||||||
|
|
||||||
- (IBAction)play:(id)sender {
|
- (IBAction)play:(id)sender {
|
||||||
if([playlistController shuffle] != ShuffleOff) {
|
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];
|
[self playEntryAtIndex:pe.index];
|
||||||
} else {
|
} else {
|
||||||
if([playlistView selectedRow] == -1)
|
if([playlistView selectedRow] == -1)
|
||||||
|
|
Loading…
Reference in a new issue