forked from viktorgino/headunit-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaaVideo.qml
54 lines (49 loc) · 1.32 KB
/
aaVideo.qml
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
import QtQuick 2.0
import QtGStreamer 1.0
import Qt.labs.settings 1.0
Item{
id:__root
Rectangle {
id: rectangle
color: "#505050"
anchors.fill: parent
}
property int margin_width
property int margin_height
property string resolution
VideoItem {
id: aaVideo
anchors.verticalCenter: parent.verticalCenter
width:parent.width
height: width * headunit.videoHeight/headunit.videoWidth
surface: videoSurface1
MouseArea {
id: mouseArea1
anchors.fill: parent
onPressed:{
headunit.mouseDown(Qt.point(mouse.x, mouse.y));
}
onPositionChanged:{
headunit.mouseMove(Qt.point(mouse.x, mouse.y));
}
onReleased:{
headunit.mouseUp(Qt.point(mouse.x, mouse.y));
}
}
Keys.onPressed: {
switch(event.key){
case Qt.Key_Left:
console.log("Key Left");
break;
}
}
}
Connections{
target: headunit
onVideoResized:{
aaVideo.height = aaVideo.width * headunit.videoHeight/headunit.videoWidth
headunit.outputHeight = aaVideo.height
headunit.outputWidth = aaVideo.width
}
}
}