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:
Philippe Saint-Pierre
2012-01-07 17:29:46 -05:00
parent 174676503b
commit a5a013ca40
11 changed files with 30 additions and 24 deletions
+4
View File
@@ -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;