1 /******************************************************************************
2 QtAV: Multimedia framework based on Qt and FFmpeg
4 * This file is part of QtAV (from 2013)
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13 You should have received a copy of the GNU Lesser General Public
14 License along with this library; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 ******************************************************************************/
19 import "utils.js" as Utils
20 import QtQuick.Window 2.1
26 console.log("Screen " + screenPixelDensity + "; r: " + Screen.pixelDensity/Screen.logicalPixelDensity + "; size: " + Screen.width + "x" + Screen.height);
27 console.log("screen density logical: " + Screen.logicalPixelDensity + " pixel: " + Screen.pixelDensity + "; " + x + ">>>" +x*Screen.pixelDensity/Screen.logicalPixelDensity);
28 return x*Screen.pixelDensity/Screen.logicalPixelDensity;
33 radius: Utils.scaled(10)
34 height: Utils.scaled(80)
35 width: itemWidth-25*pixDens
37 property string playState: "stop"
38 property int duration: 0
39 property real volume: 1
40 property bool mute: false
41 property bool hiding: false
45 signal resizeWindowFullScreen
49 signal openOptionConnections
53 signal donotRepeatVideo
55 signal saveExitFullScreen
63 function setPlayingProgress(value)
68 function setStopState()
71 playBtn.checked = false
75 function setPlayingState() {
76 playBtn.checked = true
81 function setPauseState() {
82 playBtn.checked = false
86 function toggleFullScreen() {
87 fullScreenBtn.checked = !fullScreenBtn.checked
91 GradientStop { position: 0.0; color: "#88445566" }
92 GradientStop { position: 0.618; color: "#cc1a2b3a" }
93 GradientStop { position: 1.0; color: "#ee000000" }
101 if (timer.running) //timer may ran a few seconds(<3) ago
110 if (timer.running) //timer may ran a few seconds(<3) ago
118 objectName: "progress"
122 topMargin: Utils.scaled(8)
124 leftMargin: Utils.scaled(20)
126 rightMargin: Utils.scaled(20)
128 height: Utils.scaled(8)
129 onValueChangedByUi: {
130 dashPlayer.seekVideo(value);
134 if (playState == "stop")
139 if (playState == "stop")
143 if (playState == "stop")
152 bottom: parent.bottom
155 margins: Utils.scaled(8)
161 text: "00:00:00"//Utils.msec2string(progress.value*duration)
164 topMargin: Utils.scaled(2)
169 pixelSize: Utils.scaled(12) //or point size?
175 text: "00:00:00"//Utils.msec2string(duration)
178 topMargin: Utils.scaled(2)
183 pixelSize: Utils.scaled(12)
189 objectName: "playBtn"
190 anchors.centerIn: parent
192 bgColor: "transparent"
193 bgColorSelected: "transparent"
194 width: Utils.scaled(50)
195 height: Utils.scaled(50)
196 icon: "qrc:///qml/images/play.svg"
197 iconChecked: "qrc:///qml/images/pause.svg"
200 if (checked === true) {
201 console.log(adaptationLogic)
202 dashPlayer.downloadMPD(adaptationLogic, icn)
212 anchors.verticalCenter: playBtn.verticalCenter
213 anchors.right: playBtn.left
214 bgColor: "transparent"
215 bgColorSelected: "transparent"
216 width: Utils.scaled(35)
217 height: Utils.scaled(35)
218 icon: "qrc:///qml/images/stop.svg"
220 playBtn.checked = false
223 dashPlayer.onStopButtonPressed()
229 anchors.left: parent.left
230 anchors.leftMargin: Utils.scaled(60)
231 anchors.verticalCenter: parent.verticalCenter
233 bgColor: "transparent"
234 bgColorSelected: "transparent"
235 width: Utils.scaled(30)
236 height: Utils.scaled(30)
237 icon: "qrc:///qml/images/fullscreen.png"
238 iconChecked: "qrc:///qml/images/fullscreen-selected.png"
239 visible: (Qt.platform.os != "android")
240 checked: enabledFullScreen
253 anchors.right: parent.right
254 anchors.rightMargin: Utils.scaled(70)
255 anchors.verticalCenter: parent.verticalCenter
256 spacing: Utils.scaled(20)
260 bgColor: "transparent"
261 bgColorSelected: "transparent"
263 width: Utils.scaled(30)
264 height: Utils.scaled(30)
265 icon: "qrc:///qml/images/graph.png"
266 iconChecked: "qrc:///qml/images/graph-selected.png"
270 if ( !graphBtn.checked) {
280 bgColor: "transparent"
281 bgColorSelected: "transparent"
283 width: Utils.scaled(30)
284 height: Utils.scaled(30)
285 icon: "qrc:///qml/images/options.png"
286 iconChecked: "qrc:///qml/images/options-selected.png"
295 id: optionConnectionsBtn
296 bgColor: "transparent"
297 bgColorSelected: "transparent"
299 width: Utils.scaled(30)
300 height: Utils.scaled(30)
301 icon: "qrc:///qml/images/option-connections.png"
302 iconChecked: "qrc:///qml/images/option-connections-selected.png"
307 openOptionConnections()
313 bgColor: "transparent"
314 bgColorSelected: "transparent"
316 width: Utils.scaled(30)
317 height: Utils.scaled(30)
318 icon: "qrc:///qml/images/open.png"
319 iconChecked: "qrc:///qml/images/open-selected.png"
327 bgColor: "transparent"
328 bgColorSelected: "transparent"
330 width: Utils.scaled(30)
331 height: Utils.scaled(30)
332 icon: "qrc:///qml/images/repeat.png"
333 iconChecked: "qrc:///qml/images/repeat-selected.png"
336 if ( !repeatBtn.checked) {
356 function hideIfTimedout()
364 properties: "opacity"
396 function toggleVisible()
406 playBtn.enabled = true
407 stopBtn.enabled = true
412 playBtn.enabled = false
413 stopBtn.enabled = false
417 function fullScreen()
420 resizeWindowFullScreen()
423 function exitFullScreen()
429 function checkRepeatButton()
431 repeatBtn.checked = !repeatBtn.checked;
434 function uncheckOpenBtn()
436 openBtn.checked = false;
439 function enableOpenBtn()
441 openBtn.enabled = true;
444 function uncheckOptionsBtn()
447 optionsBtn.checked = false;
450 function uncheckOptionConnectionsBtn()
453 optionConnectionsBtn.checked = false;
456 function enableOptionsBtn()
458 optionsBtn.enabled = true;