MediaPlayer: Double-click on playlist item to restart it

Double-clicking on the currently playing playlist item restart that
item's playback from the beginning.

Ticket #6560.
This commit is contained in:
Philippe Saint-Pierre 2012-01-05 18:28:21 -05:00
parent 8df5e79d2c
commit bac3774d59
3 changed files with 5 additions and 4 deletions

View File

@ -360,7 +360,7 @@ Playlist::ItemAtFast(int32 index) const
bool
Playlist::SetCurrentItemIndex(int32 index)
Playlist::SetCurrentItemIndex(int32 index, bool forceNotify)
{
bool result = true;
if (index >= CountItems()) {
@ -371,7 +371,7 @@ Playlist::SetCurrentItemIndex(int32 index)
index = -1;
result = false;
}
if (index == fCurrentIndex)
if (index == fCurrentIndex && !forceNotify)
return result;
fCurrentIndex = index;

View File

@ -91,7 +91,8 @@ public:
PlaylistItem* ItemAtFast(int32 index) const;
// navigating current ref
bool SetCurrentItemIndex(int32 index);
bool SetCurrentItemIndex(int32 index,
bool forceNotify = false);
int32 CurrentItemIndex() const;
void GetSkipInfo(bool* canSkipPrevious,

View File

@ -331,7 +331,7 @@ PlaylistListView::MouseDown(BPoint where)
// only do something if user clicked the same item twice
if (fLastClickedItem == item) {
BAutolock _(fPlaylist);
fPlaylist->SetCurrentItemIndex(i);
fPlaylist->SetCurrentItemIndex(i, true);
handled = true;
}
} else {