MediaPlayer: Fix movement of items in playlist
In Playlist, whenever a move of items occured causing the currently playing song to change its position, so : 1. Importing files (D&D for example) before its position 2. Removings files before it 3. Moving files before it was causing the currently playing song to restart because it was thinking a new entry was asked (it had a different index number suddently). Also adjusted the behaviour when you delete the currently playing track. Should fix ticket #6689.
This commit is contained in:
@@ -605,6 +605,10 @@ MainWin::MessageReceived(BMessage* msg)
|
||||
BAutolock _(fPlaylist);
|
||||
|
||||
int32 index;
|
||||
// if false, the message was meant to only update the GUI
|
||||
bool play;
|
||||
if (msg->FindBool("play", &play) < B_OK || !play)
|
||||
break;
|
||||
if (msg->FindInt32("index", &index) < B_OK
|
||||
|| index != fPlaylist->CurrentItemIndex())
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user