/usr/share/kdenlive/kdenlivemonitoreffectscene.qml is in kdenlive-data 4:15.12.3-0ubuntu1.
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 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | import QtQuick 2.0
Item {
id: root
objectName: "rooteffectscene"
// default size, but scalable by user
height: 300; width: 400
property string comment
property string framenum
property rect framesize
property point profile
property point center
property double scale
onScaleChanged: canvas.requestPaint()
property bool iskeyframe
property int requestedKeyFrame
property var centerPoints: []
onCenterPointsChanged: canvas.requestPaint()
signal effectChanged()
signal addKeyframe()
signal seekToKeyframe()
Text {
id: fontReference
property int fontSize
fontSize: font.pointSize
}
Canvas {
id: canvas
property double handleSize
width: root.width
height: root.height
anchors.centerIn: root
contextType: "2d";
handleSize: fontReference.fontSize / 2
renderStrategy: Canvas.Threaded;
onPaint:
{
if (context) {
context.clearRect(0,0, width, height);
context.beginPath()
context.strokeStyle = Qt.rgba(1, 0, 0, 0.5)
context.fillStyle = Qt.rgba(1, 0, 0, 0.5)
context.lineWidth = 2
for(var i = 0; i < root.centerPoints.length; i++)
{
var p1 = convertPoint(root.centerPoints[i])
if(i == 0)
{
context.moveTo(p1.x, p1.y)
context.fillRect(p1.x - handleSize, p1.y - handleSize, 2 * handleSize, 2 * handleSize);
continue
}
context.lineTo(p1.x, p1.y)
context.fillRect(p1.x - handleSize, p1.y - handleSize, 2 * handleSize, 2 * handleSize);
}
context.stroke()
context.restore()
}
}
function convertPoint(p)
{
var x = frame.x + p.x * root.scale
var y = frame.y + p.y * root.scale
return Qt.point(x,y);
}
}
Rectangle {
id: frame
objectName: "referenceframe"
property color hoverColor: "#ff0000"
width: root.profile.x * root.scale
height: root.profile.y * root.scale
x: root.center.x - width / 2
y: root.center.y - height / 2
color: "transparent"
border.color: "#ffffff00"
}
MouseArea {
id: global
objectName: "global"
width: root.width; height: root.height
anchors.centerIn: root
hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
readonly property bool containsMouse: {
for(var i = 0; i < root.centerPoints.length; i++)
{
var p1 = canvas.convertPoint(root.centerPoints[i])
if (Math.abs(p1.x - mouseX) <= canvas.handleSize && Math.abs(p1.y - mouseY) <= canvas.handleSize) {
root.requestedKeyFrame = i
return true
}
}
root.requestedKeyFrame = -1
return false
}
onClicked: {
if (root.requestedKeyFrame >= 0) {
root.seekToKeyframe();
}
}
onDoubleClicked: {
root.addKeyframe()
}
}
Rectangle {
id: framerect
property color hoverColor: "#ffffff"
x: frame.x + root.framesize.x * root.scale
y: frame.y + root.framesize.y * root.scale
width: root.framesize.width * root.scale
height: root.framesize.height * root.scale
color: "transparent"
border.color: "#ffff0000"
Rectangle {
id: "tlhandle"
anchors {
top: parent.top
left: parent.left
}
visible: root.iskeyframe
width: effectsize.height * 0.7
height: this.width
color: "red"
MouseArea {
property int oldMouseX
property int oldMouseY
width: parent.width; height: parent.height
anchors.centerIn: parent
hoverEnabled: true
cursorShape: Qt.SizeFDiagCursor
onEntered: { tlhandle.color = '#ffff00'}
onExited: { tlhandle.color = '#ff0000'}
onPressed: {
oldMouseX = mouseX
oldMouseY = mouseY
effectsize.visible = true
}
onPositionChanged: {
if (pressed) {
framesize.x = (framerect.x + (mouseX - oldMouseX) - frame.x) / root.scale;
framesize.width = (framerect.width - (mouseX - oldMouseX)) / root.scale;
framesize.y = (framerect.y + (mouseY - oldMouseY) - frame.y) / root.scale;
framesize.height = (framerect.height - (mouseY - oldMouseY)) / root.scale;
root.effectChanged()
}
}
onReleased: {
effectsize.visible = false
}
}
Text {
id: effectpos
objectName: "effectpos"
color: "red"
visible: false
anchors {
top: parent.bottom
left: parent.right
}
text: framesize.x.toFixed(0) + "x" + framesize.y.toFixed(0)
}
}
Rectangle {
id: "trhandle"
anchors {
top: parent.top
right: parent.right
}
width: effectsize.height * 0.7
height: this.width
color: "red"
visible: root.iskeyframe
MouseArea {
property int oldMouseX
property int oldMouseY
width: parent.width; height: parent.height
anchors.centerIn: parent
hoverEnabled: true
cursorShape: Qt.SizeBDiagCursor
onEntered: { trhandle.color = '#ffff00'}
onExited: { trhandle.color = '#ff0000'}
onPressed: {
oldMouseX = mouseX
oldMouseY = mouseY
effectsize.visible = true
}
onPositionChanged: {
if (pressed) {
framesize.width = (framerect.width + (mouseX - oldMouseX)) / root.scale;
framesize.y = (framerect.y + (mouseY - oldMouseY) - frame.y) / root.scale;
framesize.height = (framerect.height - (mouseY - oldMouseY)) / root.scale;
root.effectChanged()
}
}
onReleased: {
effectsize.visible = false
}
}
}
Rectangle {
id: "blhandle"
anchors {
bottom: parent.bottom
left: parent.left
}
width: effectsize.height * 0.7
height: this.width
color: "red"
visible: root.iskeyframe
MouseArea {
property int oldMouseX
property int oldMouseY
width: parent.width; height: parent.height
anchors.centerIn: parent
hoverEnabled: true
cursorShape: Qt.SizeBDiagCursor
onEntered: { blhandle.color = '#ffff00'}
onExited: { blhandle.color = '#ff0000'}
onPressed: {
oldMouseX = mouseX
oldMouseY = mouseY
effectsize.visible = true
}
onPositionChanged: {
if (pressed) {
framesize.x = (framerect.x + (mouseX - oldMouseX) - frame.x) / root.scale;
framesize.width = (framerect.width - (mouseX - oldMouseX)) / root.scale;
framesize.height = (framerect.height + (mouseY - oldMouseY)) / root.scale;
root.effectChanged()
}
}
onReleased: {
effectsize.visible = false
}
}
}
Rectangle {
id: "brhandle"
anchors {
bottom: parent.bottom
right: parent.right
}
width: effectsize.height * 0.7
height: this.width
color: "red"
visible: root.iskeyframe
MouseArea {
property int oldMouseX
property int oldMouseY
width: parent.width; height: parent.height
anchors.centerIn: parent
hoverEnabled: true
cursorShape: Qt.SizeFDiagCursor
onEntered: { brhandle.color = '#ffff00'}
onExited: { brhandle.color = '#ff0000'}
onPressed: {
oldMouseX = mouseX
oldMouseY = mouseY
effectsize.visible = true
}
onPositionChanged: {
if (pressed) {
framesize.width = (framerect.width + (mouseX - oldMouseX)) / root.scale;
framesize.height = (framerect.height + (mouseY - oldMouseY)) / root.scale;
root.effectChanged()
}
}
onReleased: {
effectsize.visible = false
}
}
Text {
id: effectsize
objectName: "effectsize"
color: "red"
visible: false
anchors {
bottom: parent.top
right: parent.left
}
text: framesize.width.toFixed(0) + "x" + framesize.height.toFixed(0)
}
}
Rectangle {
anchors.centerIn: parent
width: 1
height: root.iskeyframe ? effectsize.height * 1.5 : effectsize.height / 2
color: framerect.hoverColor
MouseArea {
width: effectsize.height * 1.5; height: effectsize.height * 1.5
anchors.centerIn: parent
property int oldMouseX
property int oldMouseY
hoverEnabled: true
enabled: root.iskeyframe
cursorShape: root.iskeyframe ? Qt.SizeAllCursor : Qt.ArrowCursor
onEntered: { framerect.hoverColor = '#ffff00'}
onExited: { framerect.hoverColor = '#ffffff'}
onPressed: {
oldMouseX = mouseX
oldMouseY = mouseY
effectpos.visible = true
}
onPositionChanged: {
if (pressed) {
framesize.x = (framerect.x + (mouseX - oldMouseX) - frame.x) / root.scale;
framesize.y = (framerect.y + (mouseY - oldMouseY) - frame.y) / root.scale;
root.effectChanged()
}
}
onReleased: {
effectpos.visible = false
}
}
}
Rectangle {
anchors.centerIn: parent
width: root.iskeyframe ? effectsize.height * 1.5 : effectsize.height / 2
height: 1
color: framerect.hoverColor
}
}
}
|