X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2FMediaPlayer.qml;h=4a29d9503102280dac88d5b370e59be340c0d45a;hb=583a1da88bfc703bad7568d182a99cf4ead8b65b;hp=9019a3fd9004eb16ebc00d82bb4ec1dfcb9bbf1f;hpb=ba7c74937dfbe12ab2ef2419c934a3fc6b51c711;p=apps%2Fmediaplayer.git diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml index 9019a3f..4a29d95 100644 --- a/app/MediaPlayer.qml +++ b/app/MediaPlayer.qml @@ -33,12 +33,14 @@ ApplicationWindow { 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 } } @@ -46,6 +48,13 @@ ApplicationWindow { Connections { target: dbus + onStopPlayback: { + player.stop() + playlist.clear() + playlistmodel.setSource(playlist) + playlistview.visible = false + } + onProcessPlaylistUpdate: { playlist.clear() playlist.addItems(mediaFiles) @@ -70,6 +79,7 @@ ApplicationWindow { if (avrcp_title) bluetooth.title = avrcp_title bluetooth.duration = avrcp_duration + bluetooth.pos_offset = 0 } onUpdatePlayerStatus: { @@ -102,7 +112,7 @@ ApplicationWindow { running: (bluetooth.connected && bluetooth.state == "playing") repeat: true onTriggered: { - bluetooth.position = dbus.getCurrentPosition() + bluetooth.position = dbus.getCurrentPosition() - bluetooth.pos_offset slider.value = bluetooth.position } } @@ -226,6 +236,7 @@ ApplicationWindow { offImage: './images/AGL_MediaPlayer_BackArrow.svg' onClicked: { if (bluetooth.connected) { + bluetooth.pos_offset = dbus.getCurrentPosition() dbus.processQMLEvent("Previous") } else { playlist.previous()