- function clearMetadata() {
- title.text = ''
- artist.text = ''
- duration.text = player.time2str(0)
- albumart.visible = false
+ width: container.width * container.scale
+ height: container.height * container.scale
+
+ Item {
+ id: player
+
+ property string title: ""
+ property string album: ""
+ property string artist: ""
+
+ property bool av_connected: false
+
+ property int duration: 0
+ property int position: 0
+
+ property string status: "stopped"
+
+ function time2str(value) {
+ return Qt.formatTime(new Date(value), (value > 3600000) ? 'hh:mm:ss' : 'mm:ss')
+ }
+ }
+
+ Component.onCompleted : {
+ // Let the mediaplayer backend know we're ready for metadata events
+ mediaplayer.start()
+
+ VehicleSignals.connect()