Skip to content

Commit a2ddfa3

Browse files
committed
trace logging, disabled
1 parent 030d6de commit a2ddfa3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

res/controllers/Traktor-Kontrol-S4-MK3.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ class Component {
480480
this.send(value);
481481
}
482482
outConnect() {
483+
// console.warn(`** outConnect ${this.constructor.name}: outKey ${this.outKey}`);
483484
if (this.outKey !== undefined && this.group !== undefined && this.outConnections.length === 0) {
484485
const connection = engine.makeConnection(this.group, this.outKey, this.output.bind(this));
485486
// This is useful for case where effect would have been fully disabled in Mixxx. This appears to be the case during unit tests.
@@ -497,8 +498,10 @@ class Component {
497498
this.outConnections = [];
498499
}
499500
outTrigger() {
501+
// console.warn(` ** outTrigger ${this.constructor.name} `);
500502
for (const connection of this.outConnections) {
501503
if (!connection) { continue; }
504+
// console.warn(` *** outTrigger ${this.outConnections.indexOf(connection)}**`);
502505
connection.trigger();
503506
}
504507
}
@@ -1877,6 +1880,7 @@ class S4Mk3EffectUnit extends ComponentContainer {
18771880
// empty 'key' is not considered in Button/PowerWindowButton
18781881
onShortPress: function() {},
18791882
onShortRelease: function() {
1883+
// console.warn("focusButton shortRelease");
18801884
if (this.shifted) {
18811885
if (this.unit.unitNumbers.length === 1) {
18821886
return;
@@ -1893,21 +1897,26 @@ class S4Mk3EffectUnit extends ComponentContainer {
18931897
}
18941898
this.unit.setCurrentUnit(newUnitNumber);
18951899
} else if (this.unit.focusedEffect !== null) {
1900+
// console.warn("focusButton shortRelease: unfocus");
18961901
this.unit.setFocusedEffect(null);
18971902
this.unit.stopFocusSelectMode();
18981903
} else {
1904+
// console.warn("focusButton shortRelease: toggle showParam");
18991905
script.toggleControl(this.group, "show_parameters");
19001906
}
19011907
this.output(0);
19021908
},
19031909
onLongPress: function() {
19041910
if (this.shifted) {
1911+
// console.warn("focusButton longPress SHIFT");
19051912
script.toggleControl("Skin", "show_4effectunits");
19061913
} else {
1914+
// console.warn("focusButton longPress -> focusSelectMode");
19071915
this.unit.startFocusSelectMode();
19081916
}
19091917
},
19101918
onLongRelease: function() {
1919+
// console.warn("focusButton longRelease -> focusSelectMode OFF");
19111920
this.unit.stopFocusSelectMode();
19121921
this.output(0);
19131922
}
@@ -1924,6 +1933,7 @@ class S4Mk3EffectUnit extends ComponentContainer {
19241933
inReport: inReports[2],
19251934
inByte: io.knobs[index].inByte,
19261935
stopFocusSelectMode: function(effectGroup, unfocusGroup, noEffectFocused) {
1936+
// console.warn(`-- knob ${index + 1} stopFocusSelectMode, effectGroup: ${effectGroup}`);
19271937
this.group = noEffectFocused ? unfocusGroup : effectGroup;
19281938
this.inKey = noEffectFocused ? "meta" : `parameter${index + 1}`;
19291939
this.shift = noEffectFocused ? undefined : function() {
@@ -1947,39 +1957,47 @@ class S4Mk3EffectUnit extends ComponentContainer {
19471957
onShortPress: function() {
19481958
// Connections for normal/focused mode are set in stopFocusSelectMode()
19491959
if (this.unit.focusSelectMode) {
1960+
// console.warn(`--button ${index + 1} in focusSelectMode`);
19501961
// Set/clear focused effect
19511962
this.unit.setFocusedEffect(index);
19521963
} else if (this.shifted) {
1964+
// console.warn(`--button ${index + 1} shifted`);
19531965
// Normal: select next effect
19541966
// Focused: toggle button parameter [index + 1]
19551967
if (this.unit.focusedEffect === null) {
1968+
// console.warn(`---- focusedEffect === null`);
19561969
script.triggerControl(this.group, "next_effect");
19571970
} else {
19581971
script.toggleControl(this.group, this.inKey);
19591972
}
19601973
} else {
1974+
// console.warn(`--button ${index + 1} else: toggle ${this.group},${this.inKey}`);
19611975
// Normal: toggle effect [index + 1]
19621976
// Focused: toggle button parameter [index + 1]
19631977
script.toggleControl(this.group, this.inKey);
19641978
}
19651979
},
19661980
onLongRelease: function() {
19671981
if (!this.shifted) {
1982+
// console.warn(`--button ${index + 1} longRel: toggle ${this.group},${this.inKey}`);
19681983
script.toggleControl(this.group, this.inKey);
19691984
}
19701985
},
19711986
startFocusSelectMode: function() {
19721987
this.outDisconnect();
19731988
this.outConnections[0] = engine.makeConnection(this.unit.group, "focused_effect", (value) => {
1989+
// console.warn(`--button ${index + 1}: outConn val: ${value}`);
19741990
this.output(value === index + 1);
19751991
});
19761992
this.outTrigger();
19771993
},
19781994
stopFocusSelectMode: function(effectGroup, unfocusGroup, noEffectFocused) {
19791995
this.outDisconnect();
1996+
// console.warn(`button/knob ${index + 1} outConns: ${this.outConnections}`);
19801997
this.group = noEffectFocused ? unfocusGroup : effectGroup;
19811998
this.inKey = noEffectFocused ? "enabled" : `button_parameter${index + 1}`;
19821999
this.shift = noEffectFocused ? undefined : function() {
2000+
// console.warn(`button SHIFT: ${unfocusGroup},enabled`);
19832001
// TODO add setGroupKey() to Button?
19842002
// for Pot, this is a wrapper for these 4 commands:
19852003
this.setGroup(unfocusGroup);
@@ -1988,6 +2006,7 @@ class S4Mk3EffectUnit extends ComponentContainer {
19882006
this.outTrigger();
19892007
};
19902008
this.unshift = noEffectFocused ? undefined : function() {
2009+
// console.warn(`button unSHIFT: ${effectGroup},buttonPara${index + 1}`);
19912010
this.setGroup(effectGroup);
19922011
this.setKey(`button_parameter${index + 1}`);
19932012
this.outConnect();
@@ -2034,6 +2053,7 @@ class S4Mk3EffectUnit extends ComponentContainer {
20342053
// With Shift we get the unfocus mapping: Meta knobs / effect toggles 1-3.
20352054
const effectGroup = this.effectGroupForNumber(this.focusedEffect + 1);
20362055
const noEffectFocused = this.focusedEffect === null;
2056+
// console.warn("-- stopFocusSelectMode");
20372057
for (const index of this.effectIndices) {
20382058
const unfocusGroup = this.effectGroupForNumber(index + 1);
20392059
this.buttons[index].stopFocusSelectMode(effectGroup, unfocusGroup, noEffectFocused);
@@ -2044,8 +2064,10 @@ class S4Mk3EffectUnit extends ComponentContainer {
20442064
setFocusedEffect(effectIdx) {
20452065
// Set/clear focused effect
20462066
if (this.focusedEffect === effectIdx) {
2067+
// console.warn("--> already focused, unfocus");
20472068
this.focusedEffect = null;
20482069
} else {
2070+
// console.warn(`--> set to ${effectIdx}`);
20492071
this.focusedEffect = effectIdx;
20502072
}
20512073
this.effectFocusButton.indicator(this.focusedEffect !== null);
@@ -2060,6 +2082,7 @@ class S4Mk3EffectUnit extends ComponentContainer {
20602082
}
20612083

20622084
setCurrentUnit(newNumber) {
2085+
// console.warn(`setCurrentUnit: ${newNumber}`);
20632086
engine.setValue(this.group, "controller_input_active", 0);
20642087
engine.setValue(this.group, "show_focus", 0);
20652088

0 commit comments

Comments
 (0)