property string title
property int duration: 0
property int position: 0
+ property int pos_offset: 0
function disableBluetooth() {
bluetooth.artist = ''
bluetooth.title = ''
bluetooth.duration = 0
bluetooth.position = 0
+ bluetooth.pos_offset = 0
bluetooth.connected = false
}
}
Connections {
target: dbus
+ onStopPlayback: {
+ player.stop()
+ playlist.clear()
+ playlistmodel.setSource(playlist)
+ playlistview.visible = false
+ }
+
onProcessPlaylistUpdate: {
playlist.clear()
playlist.addItems(mediaFiles)
if (avrcp_title)
bluetooth.title = avrcp_title
bluetooth.duration = avrcp_duration
+ bluetooth.pos_offset = 0
}
onUpdatePlayerStatus: {
running: (bluetooth.connected && bluetooth.state == "playing")
repeat: true
onTriggered: {
- bluetooth.position = dbus.getCurrentPosition()
+ bluetooth.position = dbus.getCurrentPosition() - bluetooth.pos_offset
slider.value = bluetooth.position
}
}
offImage: './images/AGL_MediaPlayer_BackArrow.svg'
onClicked: {
if (bluetooth.connected) {
+ bluetooth.pos_offset = dbus.getCurrentPosition()
dbus.processQMLEvent("Previous")
} else {
playlist.previous()