Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traktor S3: Push two deck switches to explicitly clone decks. #4665

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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