/usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/mediacenter/elements/mediacontroller/MediaController.qml is in plasma-mediacenter 5.7.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | /***************************************************************************
* Copyright 2012 Sinny Kumari <ksinny@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
import QtQuick 2.1
import org.kde.plasma.mediacenter 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
import org.kde.plasma.mediacenter.components 2.0 as MediaCenterComponents
MouseArea {
id: controlBarFrame
property QtObject runtimeDataObject
property bool backStopped: false
hoverEnabled: true
property int currentMediaTime
property int totalMediaTime
property int remainingMediaTime: totalMediaTime - currentMediaTime
property alias playlistButtonVisible: playlistButton.visible
property alias playerButtonVisible: playerButton.visible
signal playlistButtonClicked()
signal playerButtonClicked()
signal playNext()
signal playPrevious()
signal playPause()
signal stop()
signal backButtonClicked()
signal seekRequested(int newPosition)
signal wantToLoseFocus()
FocusScope {
anchors.fill:parent
Rectangle {
id: controllerRect
anchors.fill: parent
color: theme.backgroundColor
radius: 5
Row {
id: mediaController
anchors {
fill: parent;
}
spacing: 10
PlasmaComponents.ToolButton {
id: backButton
height: parent.height
width: height
iconSource: "draw-arrow-back";
onClicked: controlBarFrame.backButtonClicked();
}
PlasmaComponents.ToolButton {
id: backwardButton
height: parent.height
width: height
visible: true
enabled: playlistModel.currentIndex != -1
iconSource: "media-skip-backward"
onClicked: {
runtimeDataObject.userTrigerredStop = true;
controlBarFrame.playPrevious();
runtimeDataObject.userTrigerredStop = false;
}
}
PlasmaComponents.ToolButton {
id: playPauseButton
height: parent.height
width: height
enabled: runtimeData.url !== undefined
iconSource: (runtimeDataObject.status == RuntimeData.Playing) ? "media-playback-pause" : "media-playback-start"
onClicked: controlBarFrame.playPause()
}
PlasmaComponents.ToolButton {
id: stopButton
height: parent.height
width: height
enabled: runtimeDataObject.status == RuntimeData.Playing || runtimeDataObject.status == RuntimeData.Paused
iconSource: "media-playback-stop"
onClicked: controlBarFrame.stop()
}
PlasmaComponents.ToolButton {
id: forwardButton
height: parent.height
width: height
visible: true
enabled: playlistModel.currentIndex != -1
iconSource: "media-skip-forward"
onClicked: {
runtimeDataObject.userTrigerredStop = true;
controlBarFrame.playNext();
runtimeDataObject.userTrigerredStop = false;
}
}
PlasmaComponents.Slider {
id: progressSlider
width: (parent.width - backButton.width - backwardButton.width - playPauseButton.width
- stopButton.width - forwardButton.width - volumeButton.width - volumeSlider.width
- playlistButton.width - curMediaTime.width) * 0.8
height: parent.height
enabled: runtimeData.url !== undefined
Binding {
when: !progressSlider.pressed
target: progressSlider
property: "value"
value: controlBarFrame.currentMediaTime
}
onValueChanged: if (pressed) controlBarFrame.seekRequested(value);
onPressedChanged: if (!pressed) controlBarFrame.wantToLoseFocus()
maximumValue: controlBarFrame.totalMediaTime
}
PlasmaComponents.Label {
id: curMediaTime
property bool checked: false
enabled: runtimeData.url !== undefined
text: checked ? '- ' + getTimeString(controlBarFrame.remainingMediaTime) : getTimeString(controlBarFrame.currentMediaTime)
height: parent.height
font.pixelSize: height*0.5
verticalAlignment: Text.AlignVCenter
MouseArea {
anchors.fill: parent
onClicked: parent.checked = !parent.checked
}
function getTimeString(time) {
return Qt.formatTime(new Date(0, 0, 0, 0, 0, 0, time), "hh:mm:ss");
}
}
KQuickControlsAddons.MouseEventListener {
width: parent.height
height: width
onWheelMoved: {
if (wheel.delta < 0) {
volumeSlider.value=volumeSlider.value-3;
runtimeDataObject.volume=volumeSlider.value/100
} else {
volumeSlider.value=volumeSlider.value+3;
runtimeDataObject.volume=volumeSlider.value/100
}
}
PlasmaComponents.ToolButton {
id: volumeButton
anchors.fill: parent
iconSource: {
var value = volumeSlider.value
var max = volumeSlider.maximumValue
if (value > 0 && value < max/3) "audio-volume-low"
else if (value > max/3 && value < max*2/3) "audio-volume-medium"
else if (value <= 0) "audio-volume-muted"
else "audio-volume-high"
}
checkable: true
}
}
PlasmaComponents.Slider {
id: volumeSlider
height: parent.height
width: volumeButton.checked ? parent.width * 0.1 : 1
visible: volumeButton.checked
minimumValue: 0
maximumValue: 100
onPressedChanged: if (!pressed) controlBarFrame.wantToLoseFocus()
Binding {
when: volumeSlider.pressed
target: runtimeDataObject
property: "volume"
value: volumeSlider.value * 0.01
}
Binding {
when: !volumeSlider.pressed
target: volumeSlider
property: "value"
value: Math.round(100 * runtimeDataObject.volume)
}
}
PlasmaComponents.ToolButton {
id: playlistButton
width: parent.height
height: width
enabled: false
iconSource: "format-list-ordered"
onClicked: playlistButtonClicked();
}
PlasmaComponents.ToolButton {
id: playerButton
width: parent.height
height: width
enabled: false
iconSource: "applications-multimedia"
onClicked: playerButtonClicked();
}
}
}
MediaCenterComponents.AutoHide {
id: autoHide
inhibit: controlBarFrame.containsMouse
}
opacity: autoHide.shouldHide ? 0.0 : 1.0
Behavior on opacity {
NumberAnimation { duration: 500 }
}
}
}
|