aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2017-10-10 16:01:20 +0200
committerBramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>2017-10-15 16:19:43 +0000
commit76db76982e3d89c0e47215b04b90cea2e07f89e3 (patch)
treeb97e50187464d8e87d1e15dd674a978e0673b954
parent62a338c519ca5ee74846d37987ceb686025c3076 (diff)
Make the MusicWidget show the current track info again
The AppMan IPC cannot serialize the QIviAudioTrack objects which are used to represent the current track. The needed data is now converted in a var before sending it. Change-Id: I624241d63fbb9925bab8b9a9f12129c4c6549c8a Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
-rw-r--r--apps/com.pelagicore.music/models/MusicModel.qml15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/com.pelagicore.music/models/MusicModel.qml b/apps/com.pelagicore.music/models/MusicModel.qml
index 3bea129..0e1d274 100644
--- a/apps/com.pelagicore.music/models/MusicModel.qml
+++ b/apps/com.pelagicore.music/models/MusicModel.qml
@@ -113,7 +113,20 @@ QtObject {
name: "com.pelagicore.music.control"
}
- Binding { target: musicRemoteControl.object; property: "currentTrack"; value: player.currentTrack }
+ // A binding for the currentTrack doesn't work as it is a custom type which cannot be
+ // serialized easily.
+ Connections {
+ target: player
+ onCurrentTrackChanged: {
+ var trackInfo = {
+ artist: currentTrack.artist,
+ album: currentTrack.album,
+ title: currentTrack.title
+ }
+ musicRemoteControl.object.currentTrack = trackInfo
+ }
+ }
+
Binding { target: musicRemoteControl.object; property: "currentTime"; value: root.currentTime }
Binding { target: musicRemoteControl.object; property: "durationTime"; value: root.durationTime }
Binding { target: musicRemoteControl.object; property: "playing"; value: root.playing }