@@ -59,6 +59,8 @@ GenericPreview {
59 objectName: "audioPlayer"
59 objectName: "audioPlayer"
60 property real percent: audioPlayer.position * 100 / audioPlayer.duration
60 property real percent: audioPlayer.position * 100 / audioPlayer.duration
62+ property Item playingItem
62 Component.onDestruction: {
64 Component.onDestruction: {
63 audioPlayer.stop();
65 audioPlayer.stop();
@@ -78,11 +80,11 @@ GenericPreview {
80 anchors { left: parent.left; right: parent.right }
82 anchors { left: parent.left; right: parent.right }
83+ visible: trackRepeater.count > 0
82 ThinDivider {
85 ThinDivider {
83 objectName: "topDivider"
86 objectName: "topDivider"
84 anchors { left: parent.left; right: parent.right }
87 anchors { left: parent.left; right: parent.right }
85− visible: trackRepeater.count > 0
88 Repeater {
90 Repeater {
@@ -96,19 +98,14 @@ GenericPreview {
96 objectName: "trackItem" + index
98 objectName: "trackItem" + index
97 width: parent.width
99 width: parent.width
98 height: units.gu(5)
100 height: units.gu(5)
99− property bool isPlayingItem: false
101+ property bool isPlayingItem: audioPlayer.playingItem == trackItem
103− onSourceChanged: trackItem.isPlayingItem = false;
106 function play() {
103 function play() {
107 audioPlayer.stop();
104 audioPlayer.stop();
108 // Make sure we change the source, even if two items point to the same uri location
105 // Make sure we change the source, even if two items point to the same uri location
109 audioPlayer.source = "";
106 audioPlayer.source = "";
110 audioPlayer.source = model.uri;
107 audioPlayer.source = model.uri;
111− isPlayingItem = true;
108+ audioPlayer.playingItem = trackItem;
112 audioPlayer.play();
109 audioPlayer.play();