From 03bf58518ead2c796a64b653ed8f50561a5583f3 Mon Sep 17 00:00:00 2001 From: Owen Williams Date: Sun, 6 Feb 2022 18:14:23 -0500 Subject: [PATCH 1/2] Traktor S3: Push two deck switches to explicitly clone decks. Because the S3 has individual buttons for each deck, deck cloning is as easy as pressing and holding the deck you want to clone from, and tapping the deck you want to copy to. --- .../Traktor-Kontrol-S3-hid-scripts.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js index 19a559ceec7..89188dcc1eb 100644 --- a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js +++ b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js @@ -146,6 +146,9 @@ TraktorS3.Controller = function() { // If true, channel 4 is in input mode this.channel4InputMode = false; + // Represents the first-pressed deck switch button, used for tracking deck clones. + this.deckSwitchPressed = ""; + // callbacks this.samplerCallbacks = []; }; @@ -1791,9 +1794,22 @@ TraktorS3.Controller.prototype.headphoneHandler = function(field) { TraktorS3.Controller.prototype.deckSwitchHandler = function(field) { if (field.value === 0) { + if (this.deckSwitchPressed === field.group) { + this.deckSwitchPressed = ""; + } return; } + if (this.deckSwitchPressed === "") { + this.deckSwitchPressed = field.group; + } else { + // If a different deck switch is already pressed, do an instant double. + var cloneFrom = this.Channels[this.deckSwitchPressed]; + var cloneFromNum = cloneFrom.parentDeck.deckNumber; + engine.setValue(field.group, "CloneFromDeck", cloneFromNum); + } + + // Always activated pressed deck switch. var channel = this.Channels[field.group]; var deck = channel.parentDeck; From 5bce77d1840a98c8bb60d1ec7a48f76319612db4 Mon Sep 17 00:00:00 2001 From: Owen Williams Date: Mon, 7 Feb 2022 10:10:09 -0500 Subject: [PATCH 2/2] Traktor S3: Don't switch to deck that received instant double --- res/controllers/Traktor-Kontrol-S3-hid-scripts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js index 89188dcc1eb..1b0984d8fc1 100644 --- a/res/controllers/Traktor-Kontrol-S3-hid-scripts.js +++ b/res/controllers/Traktor-Kontrol-S3-hid-scripts.js @@ -1803,13 +1803,14 @@ TraktorS3.Controller.prototype.deckSwitchHandler = function(field) { if (this.deckSwitchPressed === "") { this.deckSwitchPressed = field.group; } else { - // If a different deck switch is already pressed, do an instant double. + // If a different deck switch is already pressed, do an instant double and do not select the + // deck. var cloneFrom = this.Channels[this.deckSwitchPressed]; var cloneFromNum = cloneFrom.parentDeck.deckNumber; engine.setValue(field.group, "CloneFromDeck", cloneFromNum); + return; } - // Always activated pressed deck switch. var channel = this.Channels[field.group]; var deck = channel.parentDeck;