Skip to content

Commit b79fcbd

Browse files
QML-based components API for controllers
1 parent 50b10e5 commit b79fcbd

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<MixxxControllerPreset mixxxVersion="2.2.3" schemaVersion="1">
3+
<info>
4+
<name>Denon DN-S3700 (QML)</name>
5+
<author>christophehenry</author>
6+
<description>Controller preset for Denon DN-S3700 turntable</description>
7+
</info>
8+
<controller id="DN-S3700">
9+
<scriptfiles>
10+
<file filename="Denon-DN-S3700.qml" functionprefix=""/>
11+
</scriptfiles>
12+
<controls />
13+
<outputs/>
14+
</controller>
15+
</MixxxControllerPreset>

res/controllers/Denon-DN-S3700.qml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import QtQml
2+
3+
QtObject {
4+
id: controller
5+
6+
property string controllerId: ""
7+
property bool debugMode: false
8+
9+
function init(controllerId, debugMode) {
10+
controller.controllerId = controllerId;
11+
controller.debugMode = debugMode;
12+
console.log(controllerId, debugMode);
13+
}
14+
function shutdown() {
15+
console.log(`Shutting down ${controller.controllerId} with debug mode ${controller.controllerId}`);
16+
}
17+
}

src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ bool ControllerScriptEngineLegacy::callFunctionOnObjects(
9595

9696
const QJSValue global = m_pJSEngine->globalObject();
9797

98+
// TODO: ICI
9899
bool success = true;
99100
for (const QString& prefixName : scriptFunctionPrefixes) {
100101
QJSValue prefix = global.property(prefixName);

0 commit comments

Comments
 (0)