forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVuMeter.qml
79 lines (63 loc) · 1.58 KB
/
VuMeter.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
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
import Mixxx 1.0 as Mixxx
import Qt5Compat.GraphicalEffects
import QtQuick 2.12
import "Theme"
Rectangle {
id: root
required property string group
required property string key
radius: width / 2
color: "black"
Mixxx.ControlProxy {
id: control
group: root.group
key: root.key
}
Item {
id: meterMask
anchors.fill: parent
visible: false
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 1
antialiasing: false // for performance reasons
height: control.parameter * (parent.height - 2 * anchors.margins)
radius: width / 2
}
}
Rectangle {
id: meterGradient
antialiasing: false // for performance reasons
anchors.fill: parent
visible: false
gradient: Gradient {
GradientStop {
position: 0.1
color: Theme.red
}
GradientStop {
position: 0.15
color: Theme.yellow
}
GradientStop {
position: 0.25
color: Theme.yellow
}
GradientStop {
position: 0.3
color: Theme.green
}
GradientStop {
position: 1
color: Theme.green
}
}
}
OpacityMask {
anchors.fill: parent
source: meterGradient
maskSource: meterMask
}
}