2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 import QtQuick.Layouts 1.1
20 import QtQuick.Controls 2.0
21 import AGL.Demo.Controls 1.0
22 import MasterVolume 1.0
27 source: './images/Utility_Logo_Background-01.svg'
28 property bool displayVolume: false;
32 function enableVolumeDisplay() {
35 master_volume.visible = true
36 volume_timer.restart()
39 onClicked: enableVolumeDisplay()
44 anchors.centerIn: parent
45 source: './images/Utility_Logo_Grey-01.svg'
50 interval: 3000; running: false; repeat: false
51 onTriggered: displayVolume = false
55 State { when: displayVolume;
56 PropertyChanges { target: master_volume; opacity: 1.0 }
57 PropertyChanges { target: slider; enabled: true }
58 PropertyChanges { target: logo_image; opacity: 0.0 }
59 PropertyChanges { target: speech_chrome; visible: false }
61 State { when: !displayVolume;
62 PropertyChanges { target: master_volume; opacity: 0.0 }
63 PropertyChanges { target: slider; enabled: false }
64 PropertyChanges { target: logo_image; opacity: 1.0 }
65 PropertyChanges { target: speech_chrome; visible: speech_chrome.agentPresent }
69 transitions: Transition {
70 NumberAnimation { property: "opacity"; duration: 500}
76 onVolumeChanged: slider.value = volume
77 Component.onCompleted: {
78 mv.open(bindingAddress);
85 anchors.centerIn: parent
90 anchors.horizontalCenter: parent.horizontalCenter
92 text: qsTr("Master Volume")
97 anchors.centerIn: parent
107 Layout.fillWidth: true
111 snapMode: Slider.SnapOnRelease
112 onValueChanged: mv.volume = value
113 Component.onCompleted: value = mv.volume
115 if (pressed) {volume_timer.stop()}
116 else {volume_timer.restart()}
129 anchors.left: parent.left
130 anchors.right: parent.right
131 anchors.bottom: parent.bottom
132 height: parent.height