Skip to content

Commit ed6128d

Browse files
committed
feat(QML): add controller settings
1 parent 33037e7 commit ed6128d

43 files changed

Lines changed: 4250 additions & 239 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,8 +3314,9 @@ else()
33143314
find_package(QT 5.12 NAMES Qt5 COMPONENTS Core REQUIRED)
33153315
endif()
33163316
if(QML)
3317-
list(APPEND QT_EXTRA_COMPONENTS "Quick")
33183317
list(APPEND QT_EXTRA_COMPONENTS "LabsQmlModels")
3318+
list(APPEND QT_EXTRA_COMPONENTS "Multimedia")
3319+
list(APPEND QT_EXTRA_COMPONENTS "Quick")
33193320
list(APPEND QT_EXTRA_COMPONENTS "QuickControls2")
33203321
list(APPEND QT_EXTRA_COMPONENTS "QuickControls2Impl")
33213322
list(APPEND QT_EXTRA_COMPONENTS "QuickLayouts")
@@ -3455,6 +3456,7 @@ if(QML)
34553456
src/qml/qmlwaveformrenderer.cpp
34563457
src/qml/qmlsettingparameter.cpp
34573458
src/qml/qmltrackproxy.cpp
3459+
src/qml/qmlpreferencesproxy.cpp
34583460
src/waveform/renderers/allshader/digitsrenderer.cpp
34593461
src/waveform/renderers/allshader/waveformrenderbeat.cpp
34603462
src/waveform/renderers/allshader/waveformrenderer.cpp
@@ -3811,6 +3813,22 @@ else()
38113813
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/Qt/labs"
38123814
COMPONENT applocal
38133815
)
3816+
3817+
# install qml6-module-qtquick-dialogs
3818+
install(
3819+
DIRECTORY
3820+
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/QtQuick/Dialogs"
3821+
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick"
3822+
COMPONENT applocal
3823+
)
3824+
3825+
# install qml6-module-qt-labs-folderlistmodel
3826+
install(
3827+
DIRECTORY
3828+
"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/Qt6/qml/Qt/labs/folderlistmodel"
3829+
DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/Qt/labs"
3830+
COMPONENT applocal
3831+
)
38143832
endif()
38153833

38163834
if(WIN32)
@@ -4120,6 +4138,10 @@ if(RUBBERBAND)
41204138
find_package(rubberband REQUIRED)
41214139
target_link_libraries(mixxx-lib PRIVATE rubberband::rubberband)
41224140
target_compile_definitions(mixxx-lib PUBLIC __RUBBERBAND__)
4141+
if(QML)
4142+
target_link_libraries(mixxx-qml-lib PRIVATE rubberband::rubberband)
4143+
target_compile_definitions(mixxx-qml-lib PUBLIC __RUBBERBAND__)
4144+
endif()
41234145
target_sources(
41244146
mixxx-lib
41254147
PRIVATE
@@ -4897,7 +4919,7 @@ if(QT6)
48974919
if(QML)
48984920
set(
48994921
CPACK_DEBIAN_PACKAGE_DEPENDS
4900-
"libqt6sql6-sqlite, fonts-open-sans, fonts-ubuntu, qt6-qpa-plugins, qml6-module-qt5compat-graphicaleffects, qml6-module-qtquick-controls, qml6-module-qtquick-layouts, qml6-module-qtquick-nativestyle, qml6-module-qtquick-templates, qml6-module-qtquick-window, qml6-module-qt-labs-qmlmodels, qml6-module-qtquick-shapes, qml6-module-qtqml-workerscript"
4922+
"libqt6sql6-sqlite, fonts-open-sans, fonts-ubuntu, qt6-qpa-plugins, qml6-module-qt5compat-graphicaleffects, qml6-module-qtquick-controls, qml6-module-qtquick-layouts, qml6-module-qtquick-nativestyle, qml6-module-qtquick-templates, qml6-module-qtquick-window, qml6-module-qt-labs-qmlmodels, qml6-module-qtquick-dialogs, qml6-module-qtquick-shapes, qml6-module-qtqml-workerscript"
49014923
)
49024924
else()
49034925
set(

packaging/debian/control.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,21 @@ Build-Depends: debhelper (>= 11),
1313
qt6-base-private-dev,
1414
qt6-qpa-plugins,
1515
qml6-module-qt5compat-graphicaleffects,
16+
qml6-module-qtmultimedia,
1617
qml6-module-qtqml-workerscript,
1718
qml6-module-qtquick-controls,
1819
qml6-module-qtquick-layouts,
1920
qml6-module-qtquick-nativestyle,
2021
qml6-module-qtquick-shapes,
2122
qml6-module-qtquick-templates,
2223
qml6-module-qtquick-window,
24+
qml6-module-qtquick-dialogs,
2325
qml6-module-qt-labs-qmlmodels,
26+
qml6-module-qt-labs-folderlistmodel,
2427
libqt6core5compat6-dev,
2528
libqt6opengl6-dev,
29+
libqt6multimedia6,
30+
libqt6multimediaquick6,
2631
libqt6sql6-sqlite,
2732
libqt6svg6-dev,
2833
cmake (>= 3.13),

res/controllers/Dummy Device Screen.hid.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@
6262
<value color="#FFFFFF" label="White">white</value>
6363
</option>
6464
</row>
65+
<option
66+
variable="intValue"
67+
type="integer"
68+
min="20"
69+
max="500"
70+
step="2"
71+
default="50"
72+
label="Int value"/>
6573
</group>
6674
</settings>
6775
<controller id="DummyDevice">

res/controllers/DummyDeviceDefaultScreen.qml

Lines changed: 110 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Mixxx 1.0 as Mixxx
1212
import Mixxx.Controls 1.0 as MixxxControls
1313

1414
import "." as Skin
15+
import "Theme"
1516

1617
Mixxx.ControllerScreen {
1718
id: root
@@ -119,17 +120,17 @@ Mixxx.ControllerScreen {
119120

120121
antialiasing: true
121122

122-
ColumnLayout {
123+
GridLayout {
123124
id: column
124125
anchors.fill: parent
125-
anchors.leftMargin: 0
126-
anchors.rightMargin: 0
127-
anchors.topMargin: 0
128-
anchors.bottomMargin: 0
129-
spacing: 6
126+
rowSpacing: 6
127+
columns: 2
128+
columnSpacing: 10
130129

131130
RowLayout {
132131
Layout.fillWidth: true
132+
Layout.preferredHeight: 80
133+
Layout.columnSpan: 2
133134
spacing: 0
134135

135136
Repeater {
@@ -149,157 +150,151 @@ Mixxx.ControllerScreen {
149150

150151
color: modelData
151152
Layout.fillWidth: true
152-
height: 80
153+
Layout.preferredHeight: 80
153154
}
154155
}
155156
}
156157

157158
RowLayout {
158-
anchors.leftMargin: 6
159-
anchors.rightMargin: 6
160-
anchors.topMargin: 6
161-
anchors.bottomMargin: 6
162-
163-
Layout.fillWidth: true
164-
Layout.fillHeight: true
165159
spacing: 6
166-
167-
Rectangle {
168-
color: 'transparent'
160+
Text {
169161
Layout.fillWidth: true
170-
Layout.fillHeight: true
171-
Text {
172-
text: qsTr("Group")
173-
font.pixelSize: 18
174-
font.family: "Noto Sans"
175-
font.letterSpacing: -1
176-
color: fontColor
177-
}
162+
text: qsTr("Group")
163+
font.pixelSize: 18
164+
font.family: "Noto Sans"
165+
font.letterSpacing: -1
166+
color: fontColor
178167
}
179-
180-
Rectangle {
181-
color: 'transparent'
168+
Text {
182169
Layout.fillWidth: true
183-
Layout.fillHeight: true
184-
Text {
185-
text: `${root.group}`
186-
font.pixelSize: 18
187-
font.family: "Noto Sans"
188-
font.letterSpacing: -1
189-
color: fontColor
190-
}
170+
text: root.group
171+
font.pixelSize: 18
172+
font.family: "Noto Sans"
173+
font.letterSpacing: -1
174+
color: fontColor
191175
}
192176
}
193177

194178
RowLayout {
195-
anchors.leftMargin: 6
196-
anchors.rightMargin: 6
197-
anchors.topMargin: 6
198-
anchors.bottomMargin: 6
199-
200-
Layout.fillWidth: true
201-
Layout.fillHeight: true
202179
spacing: 6
203180

204-
Rectangle {
205-
color: 'transparent'
181+
Text {
206182
Layout.fillWidth: true
207-
Layout.fillHeight: true
208-
Text {
209-
text: qsTr("Widget")
210-
font.pixelSize: 18
211-
font.family: "Noto Sans"
212-
font.letterSpacing: -1
213-
color: fontColor
214-
}
183+
text: qsTr("Widget")
184+
font.pixelSize: 18
185+
font.family: "Noto Sans"
186+
font.letterSpacing: -1
187+
color: fontColor
215188
}
216189

217-
Rectangle {
218-
color: 'transparent'
219-
Layout.fillWidth: true
220-
Layout.fillHeight: true
190+
Skin.HotcueButton {
191+
hotcueNumber: 1
192+
group: root.group
193+
}
194+
Skin.ControlKnob {
195+
width: 42
196+
height: width
197+
arcStart: Knob.ArcStart.Minimum
198+
group: root.group
199+
key: "pregain"
200+
color: Theme.gainKnobColor
201+
}
202+
}
203+
204+
ColumnLayout {
205+
Layout.fillWidth: true
206+
Layout.fillHeight: true
207+
Repeater {
208+
model: [{
209+
controllerKey: "beatloop_size",
210+
title: "Beatloop Size"
211+
}, {
212+
controllerKey: "track_samples",
213+
title: "Track sample"
214+
}, {
215+
controllerKey: "track_samplerate",
216+
title: "Track sample rate"
217+
}, {
218+
controllerKey: "playposition",
219+
title: "Play position"
220+
}, {
221+
controllerKey: "rate_ratio",
222+
title: "Rate ratio"
223+
}, {
224+
controllerKey: "waveform_zoom",
225+
title: "Waveform zoom"
226+
}
227+
]
228+
229+
RowLayout {
230+
id: row
231+
spacing: 4
232+
required property var modelData
221233

222-
Skin.HotcueButton {
223-
anchors.fill: parent
234+
Mixxx.ControlProxy {
235+
id: mixxxValue
236+
group: root.group
237+
key: modelData.controllerKey
238+
}
239+
240+
Text {
241+
Layout.fillWidth: true
242+
text: qsTr(modelData.title)
243+
font.pixelSize: 18
244+
font.family: "Noto Sans"
245+
font.letterSpacing: -1
246+
color: fontColor
247+
}
224248

225-
hotcueNumber: 1
226-
group: root.group
249+
Text {
250+
text: mixxxValue.value
251+
font.pixelSize: 18
252+
font.family: "Noto Sans"
253+
font.letterSpacing: -1
254+
color: fontColor
255+
}
227256
}
228257
}
229258
}
259+
ColumnLayout {
260+
Layout.fillWidth: true
261+
Layout.fillHeight: true
262+
Repeater {
263+
model: [
264+
"theme",
265+
"idleBackground",
266+
"accentColor",
267+
"deckA",
268+
"intValue",
269+
]
230270

231-
Repeater {
232-
model: [{
233-
controllerKey: "beatloop_size",
234-
title: "Beatloop Size"
235-
}, {
236-
controllerKey: "track_samples",
237-
title: "Track sample"
238-
}, {
239-
controllerKey: "track_samplerate",
240-
title: "Track sample rate"
241-
}, {
242-
controllerKey: "playposition",
243-
title: "Play position"
244-
}, {
245-
controllerKey: "rate_ratio",
246-
title: "Rate ratio"
247-
}, {
248-
controllerKey: "waveform_zoom",
249-
title: "Waveform zoom"
250-
}
251-
]
252-
253-
RowLayout {
254-
id: row
255-
anchors.leftMargin: 6
256-
anchors.rightMargin: 6
257-
anchors.topMargin: 6
258-
anchors.bottomMargin: 6
259-
Layout.fillWidth: true
260-
Layout.fillHeight: true
261-
spacing: 4
262-
required property var modelData
263-
264-
Mixxx.ControlProxy {
265-
id: mixxxValue
266-
group: root.group
267-
key: modelData.controllerKey
268-
}
271+
RowLayout {
272+
spacing: 4
273+
required property var modelData
269274

270-
Rectangle {
271-
color: 'transparent'
272-
Layout.fillWidth: true
273-
Layout.fillHeight: true
274275
Text {
275-
text: qsTr(modelData.title)
276+
Layout.fillWidth: true
277+
text: modelData
276278
font.pixelSize: 18
277279
font.family: "Noto Sans"
278280
font.letterSpacing: -1
279281
color: fontColor
280282
}
281-
}
282283

283-
Rectangle {
284-
color: 'transparent'
285-
Layout.fillWidth: true
286-
Layout.fillHeight: true
287284
Text {
288-
text: `${mixxxValue.value}`
285+
Layout.maximumWidth: 160
286+
text: engine.getSetting(modelData)
289287
font.pixelSize: 18
290288
font.family: "Noto Sans"
291289
font.letterSpacing: -1
292290
color: fontColor
291+
elide: Text.ElideLeft
293292
}
294293
}
295294
}
296295
}
297296
RowLayout {
298-
anchors.leftMargin: 6
299-
anchors.rightMargin: 6
300-
anchors.topMargin: 6
301-
anchors.bottomMargin: 6
302-
297+
Layout.columnSpan: 2
303298
Layout.fillWidth: true
304299
Layout.fillHeight: true
305300

0 commit comments

Comments
 (0)