diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-05-22 11:31:46 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-05-29 16:28:45 +0200 |
commit | 4b821a59671ab0af1e5732e912e5ca7ad6cc40ab (patch) | |
tree | 4915562041c0ca0a5c720b1ccf527db7cb9d8d3b | |
parent | 116860d38a72dbcf4cfc782776f3e1518a289777 (diff) |
MC6000MK2: Fix components.Button.prototype customizations
-rw-r--r-- | res/controllers/Denon-MC6000MK2-scripts.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/res/controllers/Denon-MC6000MK2-scripts.js b/res/controllers/Denon-MC6000MK2-scripts.js index e83b71b783..a2df841aa8 100644 --- a/res/controllers/Denon-MC6000MK2-scripts.js +++ b/res/controllers/Denon-MC6000MK2-scripts.js @@ -1712,15 +1712,29 @@ DenonMC6000MK2.init = function(id, debug) { components.Button.prototype.off = DenonMC6000MK2.MIDI_TRI_LED_OFF; components.Button.prototype.on = DenonMC6000MK2.MIDI_TRI_LED_ON; components.Button.prototype.onShifted = DenonMC6000MK2.MIDI_TRI_LED_BLINK; + components.Button.prototype.outValueScale = function(value) { + if (value > 0) { + if (this.sendShifted) { + return this.onShifted; + } else { + return this.on; + } + } else { + return this.off; + } + }, components.Button.prototype.send = function(value) { if (this.midi === undefined || this.midi[0] === undefined || this.midi[1] === undefined) { return; } // For Denon hardware we need to swap the 2 midi bytes (= 2nd/3rd param) in sendShortMsg()! - if (value === this.on && this.sendShifted) { - midi.sendShortMsg(this.midi[0], this.onShifted, this.midi[1]); - } else { - midi.sendShortMsg(this.midi[0], value, this.midi[1]); + midi.sendShortMsg(this.midi[0], value, this.midi[1]); + if (this.sendShifted) { + if (this.shiftChannel) { + midi.sendShortMsg(this.midi[0] + this.shiftOffset, value, this.midi[1]); + } else if (this.shiftControl) { + midi.sendShortMsg(this.midi[0], value, this.midi[1] + this.shiftOffset); + } } }; |