X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2FMediaPlayer.qml;h=ec7b4e0579d9ea4275f00fefeca3068bde0d6a34;hb=refs%2Ftags%2Fguppy_6.99.4;hp=7cca337af9d64db6d610a079bc5c4c9b8db9f180;hpb=01820c0e9c4a64eca10ede8222c2c7ad719f286d;p=apps%2Fmediaplayer.git diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml index 7cca337..ec7b4e0 100644 --- a/app/MediaPlayer.qml +++ b/app/MediaPlayer.qml @@ -37,7 +37,6 @@ ApplicationWindow { property int duration: 0 property int position: 0 - property string cover_art: "" property string status: "stopped" function time2str(value) { @@ -59,15 +58,7 @@ ApplicationWindow { player.av_connected = metadata.connected } - if ('position' in metadata) { - player.position = metadata.position - } - if (track) { - if ('image' in track) { - player.cover_art = track.image - } - player.title = track.title player.album = track.album player.artist = track.artist @@ -77,6 +68,10 @@ ApplicationWindow { playlistview.currentIndex = track.index } } + + if ('position' in metadata) { + player.position = metadata.position + } } } @@ -105,13 +100,12 @@ ApplicationWindow { Layout.preferredHeight: 1080 clip: true Image { - id: albumart anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom height: sourceSize.height * width / sourceSize.width fillMode: Image.PreserveAspectCrop - source: player.cover_art ? player.cover_art : '' + source: AlbumArt visible: player.av_connected === false } @@ -213,7 +207,6 @@ ApplicationWindow { target: play offImage: './images/AGL_MediaPlayer_Player_Pause.svg' onClicked: { - player.status = "stopped" mediaplayer.pause() } } @@ -247,8 +240,9 @@ ApplicationWindow { else mediaplayer.disconnect() } - offImage: './images/AGL_MediaPlayer_Bluetooth_Inactive.svg' - onImage: './images/AGL_MediaPlayer_Bluetooth_Active.svg' + contentItem: Image { + source: player.av_connected ? './images/AGL_MediaPlayer_Bluetooth_Active.svg' : './images/AGL_MediaPlayer_Bluetooth_Inactive.svg' + } } } }