@@ -55,6 +55,13 @@ GenericPreview {
56 height: childrenRect.height
56 height: childrenRect.height
58 Repeater {
65 Repeater {
59 id: trackRepeater
66 id: trackRepeater
@@ -115,23 +122,29 @@ GenericPreview {
115 styleColor: "black"
122 styleColor: "black"
116 elide: Text.ElideRight
123 elide: Text.ElideRight
118− // FIXME: get color values from design
119 UbuntuShape {
125 UbuntuShape {
120− color: "#66000000"
126+ id: progressBarFill
127+ color: UbuntuColors.orange
128+ anchors.left: progressBarImage.left
129+ anchors.right: progressBarImage.right
130+ anchors.verticalCenter: progressBarImage.verticalCenter
132+ anchors.margins: units.dp(2)
133+ anchors.rightMargin: maxWidth - (maxWidth * audioPlayer.percent / 100) + units.dp(2)
134+ visible: progressBarImage.visible
135+ property int maxWidth: progressBarImage.width - units.dp(4)
138+ id: progressBarImage
121 anchors {
139 anchors {
122 left: parent.left
140 left: parent.left
123 top: parent.bottom
141 top: parent.bottom
124 right: parent.right
142 right: parent.right
125− topMargin: units.dp(3)
127− height: units.dp(2)
144+ height: units.dp(6)
128 visible: audioPlayer.playbackState != Audio.StoppedState
145 visible: audioPlayer.playbackState != Audio.StoppedState
146+ source: "graphics/music_progress_bg.png"
132− anchors.fill: parent
133− anchors.rightMargin: parent.width - (parent.width * audioPlayer.percent / 100)
@@ -161,8 +174,21 @@ GenericPreview {
161 id: audioPlayer
174 id: audioPlayer
162 source: uri
175 source: uri
163 property real percent: audioPlayer.position * 100 / audioPlayer.duration
176 property real percent: audioPlayer.position * 100 / audioPlayer.duration
164− onPositionChanged: print("got percent", percent, position, duration)
178+ Component.onDestruction: {
182+ onErrorStringChanged: print("Audio player error:", errorString)
187+ onIsCurrentChanged: {
188+ if (!root.isCurrent) {
167 Connections {
193 Connections {
168 target: trackRepeater
194 target: trackRepeater