2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2017 Konsulko Group
4 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 import QtQuick.Layouts 1.1
21 import QtQuick.Controls 2.0
22 import AGL.Demo.Controls 1.0
33 onBandChanged: frequency = minimumFrequency
34 onStationFound: title = stationId
37 slider.value = frequency
41 API.BindingSoundManager {
57 Layout.fillWidth: true
58 Layout.fillHeight: true
59 Layout.preferredHeight: 3
62 anchors.left: parent.left
63 anchors.right: parent.right
64 anchors.bottom: parent.bottom
65 fillMode: Image.PreserveAspectFit
66 source: './images/HMI_Radio_Equalizer.svg'
69 anchors.left: parent.left
70 anchors.right: parent.right
71 anchors.bottom: parent.bottom
81 anchors.margins: root.width * 0.02
83 Layout.fillWidth: true
84 Layout.fillHeight: true
88 source: './images/FM_Icons_FM.svg'
91 // offImage: './images/FM_Icons_FM.svg'
92 // onImage: './images/FM_Icons_AM.svg'
93 // onCheckedChanged: {
94 // radio.band = checked ? radio.amBand : radio.fmBand
95 // radio.frequency = radio.minimumFrequency
103 Layout.alignment: Layout.Center
104 text: radio.freq2str(radio.frequency)
105 horizontalAlignment: Label.AlignHCenter
106 verticalAlignment: Label.AlignVCenter
110 Layout.alignment: Layout.Center
112 horizontalAlignment: Label.AlignHCenter
113 verticalAlignment: Label.AlignVCenter
114 font.pixelSize: label.font.pixelSize * 0.6
120 Layout.fillWidth: true
121 from: radio.minimumFrequency
122 to: radio.maximumFrequency
123 stepSize: radio.frequencyStep
124 snapMode: Slider.SnapOnRelease
125 onValueChanged: radio.frequency = value
127 anchors.left: parent.left
128 anchors.bottom: parent.top
130 text: radio.freq2str(radio.minimumFrequency)
133 anchors.right: parent.right
134 anchors.bottom: parent.top
136 text: radio.freq2str(radio.maximumFrequency)
140 Layout.fillHeight: true
147 offImage: './images/AGL_MediaPlayer_BackArrow.svg'
149 running: parent.pressed
150 triggeredOnStart: true
153 onTriggered: radio.tuneDown()
158 offImage: './images/AGL_MediaPlayer_ForwardArrow.svg'
160 running: parent.pressed
161 triggeredOnStart: true
164 onTriggered: radio.tuneUp()
168 Item { Layout.fillWidth: true }
172 offImage: './images/AGL_MediaPlayer_Player_Play.svg'
174 console.log("connect")
180 when: radio.state === radio.activeState
183 offImage: './images/AGL_MediaPlayer_Player_Pause.svg'
184 onClicked: soundmgr.disconnect()//radio.stop()
190 Item { Layout.fillWidth: true }
193 //Layout.fillWidth: true
198 offImage: './images/AGL_MediaPlayer_BackArrow.svg'
200 running: parent.pressed
201 triggeredOnStart: true
204 onTriggered: radio.scanDown()
209 offImage: './images/AGL_MediaPlayer_ForwardArrow.svg'
211 running: parent.pressed
212 triggeredOnStart: true
215 onTriggered: radio.scanUp()
224 Layout.fillWidth: true
225 Layout.fillHeight: true
226 Layout.preferredHeight: 2
229 anchors.leftMargin: 50
230 anchors.rightMargin: 50
232 header: Label { text: 'PRESETS'; opacity: 0.5 }
235 delegate: MouseArea {
236 width: ListView.view.width
237 height: ListView.view.height / 4
240 radio.band = model.modelData.band
241 radio.frequency = model.modelData.frequency
242 radio.title = model.modelData.title
248 source: './images/Radio_Active_Icon.svg'
251 Layout.fillWidth: true
253 Layout.fillWidth: true
257 Layout.fillWidth: true
258 text: radio.freq2str(model.frequency)
265 switch (model.modelData.band) {
267 return './images/FM_Icons_FM.svg'
269 return './images/FM_Icons_AM.svg'