summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorh67ma <szycikm@gmail.com>2021-08-10 18:13:47 +0200
committerh67ma <szycikm@gmail.com>2021-08-10 18:13:47 +0200
commitf5a68325127f1c1467e61714ba29971fcd32cc6a (patch)
tree69b1f96c50d2efee1f6a3048edc02e2cc4fee1a0 /res
parentf35255f0350b17d52d4476ed10455fbdc3b79e4d (diff)
refactoring of shift button
Diffstat (limited to 'res')
-rw-r--r--res/controllers/Numark-Mixtrack-Pro-FX-scripts.js32
1 files changed, 23 insertions, 9 deletions
diff --git a/res/controllers/Numark-Mixtrack-Pro-FX-scripts.js b/res/controllers/Numark-Mixtrack-Pro-FX-scripts.js
index 9adfb29a81..eee4c7197f 100644
--- a/res/controllers/Numark-Mixtrack-Pro-FX-scripts.js
+++ b/res/controllers/Numark-Mixtrack-Pro-FX-scripts.js
@@ -115,6 +115,20 @@ MixtrackProFX.shutdown = function() {
midi.sendSysexMsg(shutdownSysex, shutdownSysex.length);
};
+MixtrackProFX.shift = function() {
+ MixtrackProFX.shifted = true;
+ MixtrackProFX.deck.shift();
+ MixtrackProFX.browse.shift();
+ MixtrackProFX.effect.shift();
+};
+
+MixtrackProFX.unshift = function() {
+ MixtrackProFX.shifted = false;
+ MixtrackProFX.deck.unshift();
+ MixtrackProFX.browse.unshift();
+ MixtrackProFX.effect.unshift();
+};
+
// TODO in 2.3 it is not possible to "properly" map the FX selection buttons.
// this should be done with load_preset and QuickEffects instead (when effect
// chain preset saving/loading is available in Mixxx)
@@ -266,17 +280,17 @@ MixtrackProFX.Deck = function(number) {
input: function(channel, control, value) {
// each shift button shifts both decks
// more consistent with the logic burned into hardware
+ if (this.isPress(channel, control, value)) {
+ MixtrackProFX.shift();
+ } else {
+ MixtrackProFX.unshift();
+ }
+ },
+ isPress: function(channel, control, value) {
if (value === 0x7F) {
- MixtrackProFX.shifted = true;
- MixtrackProFX.deck.shift();
- MixtrackProFX.browse.shift();
- MixtrackProFX.effect.shift();
- } else if (value === 0x00) {
- MixtrackProFX.shifted = false;
- MixtrackProFX.deck.unshift();
- MixtrackProFX.browse.unshift();
- MixtrackProFX.effect.unshift();
+ return true;
}
+ return false;
}
});