Skip to content

Commit

Permalink
Fix bug in MediaPlayer with next/prev buttons
Browse files Browse the repository at this point in the history
Using the next/prev buttons in Music app would cause the
CurrentTrackScreen to stop reacting to changes from MusicService,
so switching song using e.g. Library View wouldn't update
CurrentTrackScreen.

Change-Id: I4c0405b8d626a512d3d59edf98ec3497553b41a4
Reviewed-by: Nedim Hadzic <[email protected]>
  • Loading branch information
Erik Botö committed Oct 5, 2016
1 parent 8c18130 commit c9679d6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions apps/com.pelagicore.music/CurrentTrackScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ UIScreen {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: Style.vspan(-1)
onClicked: {
if (pathView.currentViewIndex === 0)
pathView.currentViewIndex = MusicProvider.count - 1
if (MusicProvider.currentIndex === 0)
MusicProvider.currentIndex = MusicProvider.count - 1
else
pathView.currentViewIndex --
MusicProvider.currentIndex --
}
}

Expand All @@ -84,8 +84,6 @@ UIScreen {

currentViewIndex: MusicProvider.currentIndex

onCurrentViewIndexChanged: MusicProvider.currentIndex = pathView.currentViewIndex

delegate: CoverItem {
z: PathView.z
scale: PathView.scale
Expand All @@ -105,10 +103,10 @@ UIScreen {
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: Style.vspan(-1)
onClicked: {
if (pathView.currentViewIndex === MusicProvider.count - 1)
pathView.currentViewIndex = 0
if (MusicProvider.currentIndex === MusicProvider.count - 1)
MusicProvider.currentIndex = 0
else
pathView.currentViewIndex ++
MusicProvider.currentIndex ++
}
}
}
Expand Down

0 comments on commit c9679d6

Please sign in to comment.