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:
@@ -360,7 +360,7 @@ Playlist::ItemAtFast(int32 index) const
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Playlist::SetCurrentItemIndex(int32 index)
|
Playlist::SetCurrentItemIndex(int32 index, bool forceNotify)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
if (index >= CountItems()) {
|
if (index >= CountItems()) {
|
||||||
@@ -371,7 +371,7 @@ Playlist::SetCurrentItemIndex(int32 index)
|
|||||||
index = -1;
|
index = -1;
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
if (index == fCurrentIndex)
|
if (index == fCurrentIndex && !forceNotify)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
fCurrentIndex = index;
|
fCurrentIndex = index;
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ public:
|
|||||||
PlaylistItem* ItemAtFast(int32 index) const;
|
PlaylistItem* ItemAtFast(int32 index) const;
|
||||||
|
|
||||||
// navigating current ref
|
// navigating current ref
|
||||||
bool SetCurrentItemIndex(int32 index);
|
bool SetCurrentItemIndex(int32 index,
|
||||||
|
bool forceNotify = false);
|
||||||
int32 CurrentItemIndex() const;
|
int32 CurrentItemIndex() const;
|
||||||
|
|
||||||
void GetSkipInfo(bool* canSkipPrevious,
|
void GetSkipInfo(bool* canSkipPrevious,
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ PlaylistListView::MouseDown(BPoint where)
|
|||||||
// only do something if user clicked the same item twice
|
// only do something if user clicked the same item twice
|
||||||
if (fLastClickedItem == item) {
|
if (fLastClickedItem == item) {
|
||||||
BAutolock _(fPlaylist);
|
BAutolock _(fPlaylist);
|
||||||
fPlaylist->SetCurrentItemIndex(i);
|
fPlaylist->SetCurrentItemIndex(i, true);
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user