-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
DeckInfoBar.qml
222 lines (180 loc) · 5.33 KB
/
DeckInfoBar.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
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
import "." as Skin
import Mixxx 1.0 as Mixxx
import Mixxx.Controls 1.0 as MixxxControls
import Qt5Compat.GraphicalEffects
import QtQuick 2.12
import "Theme"
Rectangle {
id: root
required property string group
required property int rightColumnWidth
property var deckPlayer: Mixxx.PlayerManager.getPlayer(group)
property color lineColor: Theme.deckLineColor
border.width: 2
border.color: Theme.deckBackgroundColor
radius: 5
height: 56
Image {
id: coverArt
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: 5
width: height
source: root.deckPlayer.coverArtUrl
visible: false
asynchronous: true
}
Rectangle {
id: coverArtCircle
anchors.fill: coverArt
radius: height / 2
visible: false
}
OpacityMask {
anchors.fill: coverArt
source: coverArt
maskSource: coverArtCircle
}
Rectangle {
id: spinnyCircle
anchors.fill: coverArt
radius: height / 2
border.width: 2
border.color: Theme.deckLineColor
color: "transparent"
}
Item {
id: spinny
anchors.fill: coverArt
// The Spinnies are automatically hidden if the track
// is stopped. This is not really useful, but is nice for
// demo'ing transitions.
Mixxx.ControlProxy {
group: root.group
key: "play"
onValueChanged: (value) => {
spinnyIndicator.indicatorVisible = (value > 0);
}
}
MixxxControls.Spinny {
id: spinnyIndicator
anchors.fill: parent
group: root.group
indicatorVisible: false
indicator: Item {
width: spinnyIndicator.width
height: spinnyIndicator.height
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
width: 2
height: parent.height / 2
color: Theme.deckTextColor
}
}
}
}
Skin.EmbeddedText {
id: infoBarTitle
text: root.deckPlayer.title
anchors.top: infoBarHSeparator1.top
anchors.left: infoBarVSeparator.left
anchors.right: infoBarHSeparator1.left
anchors.bottom: infoBarVSeparator.bottom
horizontalAlignment: Text.AlignLeft
font.bold: false
font.pixelSize: Theme.textFontPixelSize
}
Rectangle {
id: infoBarVSeparator
anchors.left: coverArt.right
anchors.right: root.right
anchors.verticalCenter: root.verticalCenter
anchors.margins: 5
height: 2
color: root.lineColor
}
Skin.EmbeddedText {
id: infoBarArtist
text: root.deckPlayer.artist
anchors.top: infoBarVSeparator.bottom
anchors.left: infoBarVSeparator.left
anchors.right: infoBarHSeparator1.left
anchors.bottom: infoBarHSeparator1.bottom
horizontalAlignment: Text.AlignLeft
font.bold: false
font.pixelSize: Theme.textFontPixelSize
}
Rectangle {
id: infoBarHSeparator1
anchors.top: root.top
anchors.bottom: root.bottom
anchors.right: infoBarKey.left
anchors.topMargin: 5
anchors.bottomMargin: 5
width: 2
color: root.lineColor
}
Skin.EmbeddedText {
id: infoBarKey
text: root.deckPlayer.keyText
anchors.top: infoBarHSeparator1.top
anchors.bottom: infoBarVSeparator.top
anchors.right: infoBarHSeparator2.left
width: root.rightColumnWidth
}
Rectangle {
id: infoBarHSeparator2
anchors.top: root.top
anchors.bottom: root.bottom
anchors.right: infoBarRateRatio.left
anchors.topMargin: 5
anchors.bottomMargin: 5
width: 2
color: root.lineColor
}
Skin.EmbeddedText {
id: infoBarRate
anchors.top: infoBarHSeparator2.top
anchors.bottom: infoBarVSeparator.top
anchors.right: root.right
anchors.rightMargin: 5
width: root.rightColumnWidth
Mixxx.ControlProxy {
id: bpmControl
group: root.group
key: "bpm"
}
}
Skin.EmbeddedText {
id: infoBarRateRatio
property real ratio: ((rateRatioControl.value - 1) * 100).toPrecision(2)
anchors.top: infoBarVSeparator.bottom
anchors.bottom: infoBarHSeparator1.bottom
width: root.rightColumnWidth
anchors.right: root.right
anchors.rightMargin: 5
text: (ratio > 0) ? "+" + ratio.toFixed(2) : ratio.toFixed(2)
Mixxx.ControlProxy {
id: rateRatioControl
group: root.group
key: "rate_ratio"
}
}
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
position: 0
color: {
const trackColor = root.deckPlayer.color;
if (!trackColor.valid)
return Theme.deckBackgroundColor;
return Qt.darker(root.deckPlayer.color, 2);
}
}
GradientStop {
position: 1
color: Theme.deckBackgroundColor
}
}
}