diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-05-25 18:56:58 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2019-06-06 17:01:07 +0200 |
commit | 5ea38279877c74d6b359127ace05232155a49a46 (patch) | |
tree | f28334509b7d46ea2e2509bef36a9dd331559642 /res | |
parent | defd7119b78ea6dd37e27ef3184d2ecc1f0edefe (diff) |
Roland DJ-505: Map buttons for library sorting
Diffstat (limited to 'res')
-rw-r--r-- | res/controllers/Roland_DJ-505-scripts.js | 30 | ||||
-rw-r--r-- | res/controllers/Roland_DJ-505.midi.xml | 12 |
2 files changed, 34 insertions, 8 deletions
diff --git a/res/controllers/Roland_DJ-505-scripts.js b/res/controllers/Roland_DJ-505-scripts.js index da386d86eb..a5fb3d4e75 100644 --- a/res/controllers/Roland_DJ-505-scripts.js +++ b/res/controllers/Roland_DJ-505-scripts.js @@ -227,7 +227,7 @@ DJ505.browseEncoder = new components.Encoder({ }); DJ505.backButton = new components.Button({ - // TODO: Map the BACK/SONG button + // TODO: Map the BACK button midi: [0x9F, 0x07], shiftOffset: 11, sendShifted: true, @@ -236,7 +236,6 @@ DJ505.backButton = new components.Button({ }); DJ505.addPrepareButton = new components.Button({ - // TODO: Map the ARTIST button midi: [0x9F, 0x1B], shiftOffset: -7, sendShifted: true, @@ -246,6 +245,33 @@ DJ505.addPrepareButton = new components.Button({ type: components.Button.prototype.types.toggle, }); + +DJ505.sortLibrary = function (channel, control, value, status, group) { + if (value === 0) { + return; + } + + var sortColumn; + switch(control) { + case 0x12: // SONG + sortColumn = 1; + break; + case 0x13: // BPM + sortColumn = 14; + break; + case 0x14: // ARTIST + sortColumn = 0; + break; + case 0x1E: // KEY + sortColumn = 19; + break; + default: + // unknown sort column + return; + } + engine.setValue("[Library]", "sort_column_toggle", sortColumn); +}; + DJ505.crossfader = new components.Pot({ midi: [0xBF, 0x08], group: "[Master]", diff --git a/res/controllers/Roland_DJ-505.midi.xml b/res/controllers/Roland_DJ-505.midi.xml index ebf7a5456d..8331d6263b 100644 --- a/res/controllers/Roland_DJ-505.midi.xml +++ b/res/controllers/Roland_DJ-505.midi.xml @@ -3343,9 +3343,9 @@ <script-binding/> </options> </control> - <!-- <control> - <group>[Master]</group> + <group>[Library]</group> + <key>DJ505.sortLibrary</key> <description>BPM</description> <status>0x9F</status> <midino>0x13</midino> @@ -3354,7 +3354,8 @@ </options> </control> <control> - <group>[Master]</group> + <group>[Library]</group> + <key>DJ505.sortLibrary</key> <description>KEY</description> <status>0x9F</status> <midino>0x1E</midino> @@ -3362,7 +3363,6 @@ <script-binding/> </options> </control> - --> <control> <group>[Library]</group> <key>DJ505.browseEncoder.input</key> @@ -3405,7 +3405,7 @@ </control> <control> <group>[Library]</group> - <key>DJ505.backButton.input</key> + <key>DJ505.sortLibrary</key> <description>SONG</description> <status>0x9F</status> <midino>0x12</midino> @@ -3425,7 +3425,7 @@ </control> <control> <group>[Library]</group> - <key>DJ505.addPrepareButton.input</key> + <key>DJ505.sortLibrary</key> <description>ARTIST</description> <status>0x9F</status> <midino>0x14</midino> |