代码拉取完成,页面将自动刷新
同步操作将从 韦东山/Qtmxapp-desktop 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4
Rectangle {
id: root
visible: true
width: def.win_width
height: def.win_height/5
color: "transparent"
// border.color: "white"
// border.width: 2
//单位ms
//作为输入
property real media_duration; //400000=400ms=06:40
property real media_postion; //120000=120ms=02:00
//作为输出
property real slider_value: 0; //0.7*400000=280000
property bool playing: false
property real media_volume: 0.2
property bool volume_showFlag: false
property bool hourFlag: false
signal clicked_play
signal clicked_pause
signal clicked_stop
signal clicked_backward
signal clicked_step_backward
signal clicked_step_forward
signal clicked_forward
signal moved_slider
// signal clicked_volume
Define {id: def}
RowLayout {
id: row_display
spacing: 10
anchors.bottom: row_control.top
anchors.left: root.left
anchors.right: root.right
Text {
id: time_now
text: (hourFlag) ? def.msToHHMMSS(media_postion) : def.msToMMSS(media_postion)
color: "white"
}
Slider {
id: progress
value: media_postion/media_duration
Layout.fillWidth: true
onMoved:
{
slider_value = value * media_duration;
root.moved_slider()
// root.clicked_play()
}
}
Text {
id: time_long
text: (hourFlag) ? def.msToHHMMSS(media_duration) : def.msToMMSS(media_duration)
color: "white"
}
MyToolButton {
id: btn_volume
icon_code: (media_volume == 0) ? def.iconCode_volume_mute : ((media_volume < 0.5) ? def.iconCode_volume_down : def.iconCode_volume_up);
onClicked: {
root.volume_showFlag = !root.volume_showFlag;
// root.volume_showFlag = true;
// console.log("clicked")
}
}
}
RowLayout {
id: row_control
anchors.horizontalCenter: root.horizontalCenter
anchors.bottom: root.bottom
spacing: 10
MyToolButton {
id: btn_backward //上一曲
icon_code: def.iconCode_backward
onClicked: root.clicked_backward()
}
MyToolButton {
id: btn_step_backward //快退
icon_code: def.iconCode_step_backward
onClicked: root.clicked_step_backward()
}
MyToolButton {
id: btn_play
icon_code: (root.playing) ? def.iconCode_play : def.iconCode_pause;
onClicked:
{
root.playing = !root.playing;
if(root.playing)
{
root.clicked_play()
}
else
{
root.clicked_pause()
}
}
}
MyToolButton {
id: btn_stop
icon_code: def.iconCode_stop
onClicked:
{
root.clicked_stop()
root.playing = false;
}
}
MyToolButton {
id: btn_step_forward //快进
icon_code: def.iconCode_step_forward
onClicked: root.clicked_step_forward()
}
MyToolButton {
id: btn_forward //下一曲
icon_code: def.iconCode_forward
onClicked: root.clicked_forward()
}
}
/*
Keys.onSpacePressed:
{
root.playing = !root.playing;
if(root.playing)
{
root.clicked_play()
}
else
{
root.clicked_pause()
}
}
Keys.onLeftPressed: root.clicked_step_backward();
Keys.onRightPressed: root.clicked_step_forward();
Keys.onUpPressed: {
volume_showFlag = true;
if(media_volume <= 0.9)
media_volume += 0.1;
volumeSlider.value = media_volume
}
Keys.onDownPressed: {
volume_showFlag = true;
if(media_volume >= 0.1)
media_volume -= 0.1;
volumeSlider.value = media_volume
}
*/
Slider {
id: volumeSlider
orientation: Qt.Vertical
anchors.bottom: root.top
anchors.right: root.right
anchors.rightMargin: 10
visible: root.volume_showFlag
width: 20
height: 100
from: 0
to: 1
value: 0.2
onValueChanged: media_volume = value;
/* onPositionChanged: hoverTimer.stop()
MouseArea {
anchors.fill: parent
hoverEnabled: true
enabled: true
propagateComposedEvents: true
onExited: {
hoverTimer.start()
}
Timer {
id: hoverTimer
interval: 1000
onTriggered: {
root.volume_showFlag = false;
console.log("slider hide")
}
}
}*/
// onActiveFocusChanged: console.log("slider active:" + activeFocus)
// onFocusChanged: console.log("focus: " + focus)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。