Skip to content

Commit

Permalink
feat: controller screen renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Mar 26, 2023
1 parent 060b0e9 commit 5cffedb
Show file tree
Hide file tree
Showing 30 changed files with 2,334 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ src/mixxx.rc.include
src/mixxx.res
src/test/**/*.actual
res/qrc_mixxx.cc
.vscode/settings.json
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp
src/controllers/scripting/legacy/scriptconnection.cpp
src/controllers/scripting/legacy/scriptconnectionjsproxy.cpp
src/controllers/rendering/controllerrenderingtransform.cpp
src/controllers/rendering/controllerrenderingengine.cpp
src/controllers/keyboard/keyboardeventfilter.cpp
src/controllers/learningutils.cpp
src/controllers/midi/legacymidicontrollermapping.cpp
Expand Down
36 changes: 36 additions & 0 deletions res/controllers/Dummy Device Screen.hid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset mixxxVersion="2.4.0" schemaVersion="1">
<info>
<name>Dummy Device (Screens)</name>
<author>A. Colombier</author>
<description>Dummy device screens</description>
<devices>
<product protocol="hid" vendor_id="0xdead" product_id="0xbeaf" />
</devices>
</info>
<controller id="DummyDevice">
<renderfiles>
<screen filename="Dummy-Device-Default-Screen.qml" identifier="deck" width="320" height="240" screenCount="2" targetFps="50">
<library path="Dummy-Device-Default-Screen" />
<transformfunction type="javascript">
(function(input, screen_id) {
data = new Array(320*240*2 + 20).fill(0);
input = new Uint8Array(input);
data[0] = 0x84;
data[3] = 0x21;
data[12] = 0x1;
data[13] = 0x40;
data[15] = 0xf0;
data[320*240*2 + 16] = 0x40;
data[2] = screen_id;
for (var i = 0; i &lt; 320 * 240; i ++){
data[16 + 2 * i] = (input[i * 4] &amp; 0xf8) | (input[i * 4 + 1] >> 5);
data[16 + 2 * i + 1] = (input[i * 4 + 1] &lt;&lt; 3) &amp; 0xe0 | (input[i * 4 + 2] >> 3);
}
return data;
})
</transformfunction>
</screen>
</renderfiles>
</controller>
</MixxxControllerPreset>
Loading

0 comments on commit 5cffedb

Please sign in to comment.