import QtQuick 2.11
import QtQuick.Layouts 1.11
import QtQuick.Controls 2.4
+import QtQuick.Window 2.13
+
import AGL.Demo.Controls 1.0
ApplicationWindow {
}
}
+ Component.onCompleted : {
+ // Let the mediaplayer backend know we're ready for metadata events
+ mediaplayer.start()
+
+ VehicleSignals.connect()
+ }
+
Connections {
target: mediaplayer
}
}
+ Connections {
+ target: VehicleSignals
+
+ onConnected: {
+ VehicleSignals.authorize()
+ }
+
+ onAuthorized: {
+ VehicleSignals.subscribe("Vehicle.Cabin.Infotainment.Media.Action")
+ }
+
+ onSignalNotification: {
+ if (path === "Vehicle.Cabin.Infotainment.Media.Action") {
+ if (value == "SkipForward") {
+ mediaplayer.next()
+ } else if (value == "SkipBackward") {
+ mediaplayer.previous()
+ } else if (value == "NextSource") {
+ if (player.av_connected)
+ mediaplayer.connect()
+ else
+ mediaplayer.disconnect()
+ }
+ }
+ }
+ }
+
Timer {
id: timer
interval: 250
Item {
id: container
anchors.centerIn: parent
- width: 1080
- height: 1487
- scale: screenInfo.scale_factor()
+ width: Window.width
+ height: Window.height
+ //scale: screenInfo.scale_factor()
+ scale: 1
ColumnLayout {
anchors.fill: parent