From ffd86c7fa83b0b64814eb488af4807bcfae4c51f Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 15 May 2018 14:34:01 +0200 Subject: [PATCH 1/2] Denon MC6000MK2: Delete unused script code for hotcues --- res/controllers/Denon-MC6000MK2-scripts.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/res/controllers/Denon-MC6000MK2-scripts.js b/res/controllers/Denon-MC6000MK2-scripts.js index 7f1189ce9c..0ee05e4cd2 100644 --- a/res/controllers/Denon-MC6000MK2-scripts.js +++ b/res/controllers/Denon-MC6000MK2-scripts.js @@ -333,27 +333,6 @@ DenonMC6000MK2.disconnectControls = function () { }; -//////////////////////////////////////////////////////////////////////// -// Hotcues // -//////////////////////////////////////////////////////////////////////// - -DenonMC6000MK2.Hotcue = function (deck, number, midiLedValue, midiDimmerLedValue) { - this.deck = deck; - this.number = number; - this.ctrlPrefix = "hotcue_" + number; - this.midiLedValue = midiLedValue; - this.midiDimmerLedValue = midiDimmerLedValue; -}; - -DenonMC6000MK2.Hotcue.prototype.connectControls = function (callbackFunc) { - this.deck.connectControl(this.ctrlPrefix + "_enabled", callbackFunc); -}; - -DenonMC6000MK2.Hotcue.prototype.isEnabled = function () { - return this.deck.getValue(this.ctrlPrefix + "_enabled"); -}; - - //////////////////////////////////////////////////////////////////////// // Samplers // //////////////////////////////////////////////////////////////////////// @@ -484,11 +463,6 @@ DenonMC6000MK2.OldDeck = function (number, midiChannel) { this.setValue("rate_dir", -1); this.vinylMode = undefined; this.syncMode = undefined; - this.hotcues = []; - this.hotcues[1] = new DenonMC6000MK2.Hotcue(this, 1, 0x11, 0x12); - this.hotcues[2] = new DenonMC6000MK2.Hotcue(this, 2, 0x13, 0x14); - this.hotcues[3] = new DenonMC6000MK2.Hotcue(this, 3, 0x15, 0x16); - this.hotcues[4] = new DenonMC6000MK2.Hotcue(this, 4, 0x17, 0x18); }; /* Shift */ @@ -934,10 +908,6 @@ DenonMC6000MK2.OldDeck.prototype.connectControls = function () { this.connectControl("loop_end_position", DenonMC6000MK2.ctrlLoopEndPosition); DenonMC6000MK2.leftSide.efxUnit.connectDeckControls(this, DenonMC6000MK2.leftSide.efxUnit.ctrlDeck); DenonMC6000MK2.rightSide.efxUnit.connectDeckControls(this, DenonMC6000MK2.rightSide.efxUnit.ctrlDeck); - this.hotcues[1].connectControls(DenonMC6000MK2.ctrlHotcue1); - this.hotcues[2].connectControls(DenonMC6000MK2.ctrlHotcue2); - this.hotcues[3].connectControls(DenonMC6000MK2.ctrlHotcue3); - this.hotcues[4].connectControls(DenonMC6000MK2.ctrlHotcue4); // default settings this.enableKeyLock(); this.enableVinylMode(); From 14626e909bc98b97bd1d24a09fbcc99b557f5547 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 15 May 2018 15:23:14 +0200 Subject: [PATCH 2/2] Denon MC6000MK2: Fix looping by capturing button release events --- res/controllers/Denon-MC6000MK2-scripts.js | 33 +++++---- res/controllers/Denon-MC6000MK2.midi.xml | 108 ++++++++++++++++++++++++----- 2 files changed, 108 insertions(+), 33 deletions(-) diff --git a/res/controllers/Denon-MC6000MK2-scripts.js b/res/controllers/Denon-MC6000MK2-scripts.js index 0ee05e4cd2..fccb95cae2 100644 --- a/res/controllers/Denon-MC6000MK2-scripts.js +++ b/res/controllers/Denon-MC6000MK2-scripts.js @@ -767,14 +767,16 @@ DenonMC6000MK2.OldDeck.prototype.hasLoopEnd = function () { }; DenonMC6000MK2.OldDeck.prototype.hasLoop = function () { - return this.hasLoopStart() && this.hasLoopEnd(); + return this.hasLoopStart() && this.hasLoopEnd() && this.getValue("loop_start_position") < this.getValue("loop_end_position"); }; DenonMC6000MK2.OldDeck.prototype.deleteLoopStart = function () { + this.setValue("loop_in", false); this.setValue("loop_start_position", DenonMC6000MK2.MIXXX_LOOP_POSITION_UNDEFINED); }; DenonMC6000MK2.OldDeck.prototype.deleteLoopEnd = function () { + this.setValue("loop_out", false); this.setValue("loop_end_position", DenonMC6000MK2.MIXXX_LOOP_POSITION_UNDEFINED); }; @@ -861,11 +863,13 @@ DenonMC6000MK2.OldDeck.prototype.onLoopCutPlusButton = function (isButtonPressed }; DenonMC6000MK2.OldDeck.prototype.updateLoopLeds = function (value) { - this.loopInLed.setStateBoolean(this.hasLoopStart()); - this.loopOutLed.setStateBoolean(this.hasLoopEnd()); if (this.getValue("loop_enabled")) { + this.loopInLed.setTriState(DenonMC6000MK2.TRI_LED_BLINK); + this.loopOutLed.setTriState(DenonMC6000MK2.TRI_LED_BLINK); this.autoLoopLed.setTriState(DenonMC6000MK2.TRI_LED_BLINK); } else { + this.loopInLed.setStateBoolean(this.hasLoopStart()); + this.loopOutLed.setStateBoolean(this.hasLoopEnd()); this.autoLoopDimmerLed.setStateBoolean(this.hasLoop()); } }; @@ -1418,18 +1422,6 @@ DenonMC6000MK2.recvAutoLoopButton = function (channel, control, value, status, g deck.onAutoLoopButton(isButtonPressed); }; -DenonMC6000MK2.recvLoopInButton = function (channel, control, value, status, group) { - var isButtonPressed = DenonMC6000MK2.isButtonPressed(value); - var deck = DenonMC6000MK2.getDeckByGroup(group); - deck.onLoopInButton(isButtonPressed); -}; - -DenonMC6000MK2.recvLoopOutButton = function (channel, control, value, status, group) { - var isButtonPressed = DenonMC6000MK2.isButtonPressed(value); - var deck = DenonMC6000MK2.getDeckByGroup(group); - deck.onLoopOutButton(isButtonPressed); -}; - DenonMC6000MK2.recvLoopCutMinusButton = function (channel, control, value, status, group) { var isButtonPressed = DenonMC6000MK2.isButtonPressed(value); var deck = DenonMC6000MK2.getDeckByGroup(group); @@ -1708,6 +1700,17 @@ DenonMC6000MK2.Deck.prototype.shiftButtonInput = function (channel, control, val this.side.shiftButtonInput(channel, control, value, status); }; +DenonMC6000MK2.Deck.prototype.loopInButtonInput = function (channel, control, value, status, group) { + var isButtonPressed = DenonMC6000MK2.isButtonPressed(value); + var deck = DenonMC6000MK2.getDeckByGroup(group); + deck.onLoopInButton(isButtonPressed); +}; + +DenonMC6000MK2.Deck.prototype.loopOutButtonInput = function (channel, control, value, status, group) { + var isButtonPressed = DenonMC6000MK2.isButtonPressed(value); + var deck = DenonMC6000MK2.getDeckByGroup(group); + deck.onLoopOutButton(isButtonPressed); +}; //////////////////////////////////////////////////////////////////////// // Mixxx Callback Functions // diff --git a/res/controllers/Denon-MC6000MK2.midi.xml b/res/controllers/Denon-MC6000MK2.midi.xml index 7f175f0aee..7295201670 100644 --- a/res/controllers/Denon-MC6000MK2.midi.xml +++ b/res/controllers/Denon-MC6000MK2.midi.xml @@ -769,9 +769,27 @@ + + [Channel2] + DenonMC6000MK2.rightDeck2.loopOutButtonInput + 0x92 + 0x39 + + + + + + [Channel4] + DenonMC6000MK2.rightDeck4.loopOutButtonInput + 0x93 + 0x39 + + + + [Channel1] - DenonMC6000MK2.recvLoopOutButton + DenonMC6000MK2.leftDeck1.loopOutButtonInput 0x90 0x39 @@ -780,7 +798,7 @@ [Channel3] - DenonMC6000MK2.recvLoopOutButton + DenonMC6000MK2.leftDeck3.loopOutButtonInput 0x91 0x39 @@ -789,8 +807,8 @@ [Channel2] - DenonMC6000MK2.recvLoopOutButton - 0x92 + DenonMC6000MK2.rightDeck2.loopOutButtonInput + 0x82 0x39 @@ -798,8 +816,8 @@ [Channel4] - DenonMC6000MK2.recvLoopOutButton - 0x93 + DenonMC6000MK2.rightDeck4.loopOutButtonInput + 0x83 0x39 @@ -807,34 +825,61 @@ [Channel1] - DenonMC6000MK2.recvLoopInButton - 0x90 - 0x37 + DenonMC6000MK2.leftDeck1.loopOutButtonInput + 0x80 + 0x39 [Channel3] - DenonMC6000MK2.recvLoopInButton - 0x91 + DenonMC6000MK2.leftDeck3.loopOutButtonInput + 0x81 + 0x39 + + + + + + [Channel2] + DenonMC6000MK2.rightDeck2.loopInButtonInput + 0x82 0x37 - [EqualizerRack1_[Channel1]_Effect1] - parameter1 - 0xB0 - 0x04 + [Channel4] + DenonMC6000MK2.rightDeck4.loopInButtonInput + 0x83 + 0x37 - + + + + + [Channel1] + DenonMC6000MK2.leftDeck1.loopInButtonInput + 0x80 + 0x37 + + + + + + [Channel3] + DenonMC6000MK2.leftDeck3.loopInButtonInput + 0x81 + 0x37 + + [Channel2] - DenonMC6000MK2.recvLoopInButton + DenonMC6000MK2.rightDeck2.loopInButtonInput 0x92 0x37 @@ -843,13 +888,40 @@ [Channel4] - DenonMC6000MK2.recvLoopInButton + DenonMC6000MK2.rightDeck4.loopInButtonInput 0x93 0x37 + + [Channel1] + DenonMC6000MK2.leftDeck1.loopInButtonInput + 0x90 + 0x37 + + + + + + [Channel3] + DenonMC6000MK2.leftDeck3.loopInButtonInput + 0x91 + 0x37 + + + + + + [EqualizerRack1_[Channel1]_Effect1] + parameter1 + 0xB0 + 0x04 + + + + [Channel2] DenonMC6000MK2.recvXfaderAssignThruButton