Skip to content

Commit

Permalink
Merge pull request #4665 from ywwg/traktor-s3-deck-clone
Browse files Browse the repository at this point in the history
Traktor S3: Push two deck switches to explicitly clone decks.
  • Loading branch information
Swiftb0y committed Feb 9, 2022
2 parents 05d0a59 + 5bce77d commit 20f1345
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions res/controllers/Traktor-Kontrol-S3-hid-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
};
Expand Down Expand Up @@ -1791,6 +1794,20 @@ 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 and do not select the
// deck.
var cloneFrom = this.Channels[this.deckSwitchPressed];
var cloneFromNum = cloneFrom.parentDeck.deckNumber;
engine.setValue(field.group, "CloneFromDeck", cloneFromNum);
return;
}

Expand Down

0 comments on commit 20f1345

Please sign in to comment.