Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Oct 16, 2024
1 parent 33855e9 commit 68287bd
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 68 deletions.
20 changes: 8 additions & 12 deletions res/controllers/Traktor-Kontrol-S4-MK3.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ class HotcueButton extends PushButton {
engine.setSharedData(data);
}

} else if (this.deck.libraryPlayButton.pressed) {
engine.setValue(this.deck.libraryPlayButton.group, this.inKey, pressed);
} else {
engine.setValue(this.group, "scratch2_enable", false);
engine.setValue(this.group, this.inKey, pressed);
Expand Down Expand Up @@ -2400,12 +2402,6 @@ class S4Mk3Deck extends Deck {
const valueOut = engine.getValue(this.group, "loop_end_position") + (right ? moveFactor : -moveFactor);
engine.setValue(this.group, "loop_start_position", valueIn);
engine.setValue(this.group, "loop_end_position", valueOut);
} else if (this.shifted && this.deck.samplesPadModeButton.pressed) {
const position = engine.getValue(this.group, "loop_start_position");
const size = engine.getValue(this.group, "beatloop_size");
const delta = engine.getValue(this.group, "loop_end_position") - position;
engine.setValue(this.group, "loop_start_position", right ? position - delta : position + delta / 2);
engine.setValue(this.group, "beatloop_size", right ? size * 2 : size / 2);
} else if (this.shifted) {
script.triggerControl(this.group, right ? "loop_move_1_forward" : "loop_move_1_backward");
} else {
Expand Down Expand Up @@ -2504,8 +2500,13 @@ class S4Mk3Deck extends Deck {
});
this.libraryPlayButton = new PushButton({
group: "[PreviewDeck1]",
deck: this,
onPress: function() {
script.triggerControl(this.group, "LoadSelectedTrackAndPlay");
if (this.shifted) {
engine.setValue(this.group, "CloneFromDeck", this.deck.currentDeckNumber);
} else {
script.triggerControl(this.group, "LoadSelectedTrackAndPlay");
}
},
onRelease: function() {
engine.setValue(this.group, "play", 0);
Expand Down Expand Up @@ -2894,11 +2895,6 @@ class S4Mk3Deck extends Deck {
});

this.wheelMode = wheelModes.vinyl;
// let motorWindDownTimer = 0;
// const motorWindDownTimerCallback = () => {
// engine.stopTimer(motorWindDownTimer);
// motorWindDownTimer = 0;
// };
this.turntableButton = new Button({
deck: this,
onShortPress: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,57 +356,59 @@ QtObject {
property variant color16Bright2: rgba (248, 8, 64, 120)

property variant musicalKeyColors: [
color15Bright, //0 -11 c
color06Bright, //1 -4 c#, db
color11MusicalKey, //2 -13 d
color03Bright, //3 -6 d#, eb
color09MusicalKey, //4 -16 e
color01Bright, //5 -9 f
color07MusicalKey, //6 -2 f#, gb
color13Bright, //7 -12 g
color04MusicalKey, //8 -5 g#, ab
color10MusicalKey, //9 -15 a
color02MusicalKey, //10 -7 a#, bb
color08MusicalKey, //11 -1 b
color03Bright, //12 -6 cm
color09MusicalKey, //13 -16 c#m, dbm
color01Bright, //14 -9 dm
color07MusicalKey, //15 -2 d#m, ebm
color13Bright, //16 -12 em
color04MusicalKey, //17 -5 fm
color10MusicalKey, //18 -15 f#m, gbm
color02MusicalKey, //19 -7 gm
color08MusicalKey, //20 -1 g#m, abm
color15Bright, //21 -11 am
color06Bright, //22 -4 a#m, bbm
color11MusicalKey //23 -13 bm
'grey', //0 No key
color15Bright, //1 -11 c
color06Bright, //2 -4 c#, db
color11MusicalKey, //3 -13 d
color03Bright, //4 -6 d#, eb
color09MusicalKey, //5 -16 e
color01Bright, //6 -9 f
color07MusicalKey, //7 -2 f#, gb
color13Bright, //8 -12 g
color04MusicalKey, //9 -5 g#, ab
color10MusicalKey, //10 -15 a
color02MusicalKey, //11 -7 a#, bb
color08MusicalKey, //12 -1 b
color03Bright, //13 -6 cm
color09MusicalKey, //14 -16 c#m, dbm
color01Bright, //15 -9 dm
color07MusicalKey, //16 -2 d#m, ebm
color13Bright, //17 -12 em
color04MusicalKey, //18 -5 fm
color10MusicalKey, //19 -15 f#m, gbm
color02MusicalKey, //20 -7 gm
color08MusicalKey, //21 -1 g#m, abm
color15Bright, //22 -11 am
color06Bright, //23 -4 a#m, bbm
color11MusicalKey //24 -13 bm
]

property variant musicalKeyColorsDark: [
Qt.darker(color15Bright, 5), //0 -11 c
Qt.darker(color06Bright, 5), //1 -4 c#, db
Qt.darker(color11MusicalKey, 5), //2 -13 d
Qt.darker(color03Bright, 5), //3 -6 d#, eb
Qt.darker(color09MusicalKey, 5), //4 -16 e
Qt.darker(color01Bright, 5), //5 -9 f
Qt.darker(color07MusicalKey, 5), //6 -2 f#, gb
Qt.darker(color13Bright, 5), //7 -12 g
Qt.darker(color04MusicalKey, 5), //8 -5 g#, ab
Qt.darker(color10MusicalKey, 5), //9 -15 a
Qt.darker(color02MusicalKey, 5), //10 -7 a#, bb
Qt.darker(color08MusicalKey, 5), //11 -1 b
Qt.darker(color03Bright, 5), //12 -6 cm
Qt.darker(color09MusicalKey, 5), //13 -16 c#m, dbm
Qt.darker(color01Bright, 5), //14 -9 dm
Qt.darker(color07MusicalKey, 5), //15 -2 d#m, ebm
Qt.darker(color13Bright, 5), //16 -12 em
Qt.darker(color04MusicalKey, 5), //17 -5 fm
Qt.darker(color10MusicalKey, 5), //18 -15 f#m, gbm
Qt.darker(color02MusicalKey, 5), //19 -7 gm
Qt.darker(color08MusicalKey, 5), //20 -1 g#m, abm
Qt.darker(color15Bright, 5), //21 -11 am
Qt.darker(color06Bright, 5), //22 -4 a#m, bbm
Qt.darker(color11MusicalKey, 5) //23 -13 bm
'grey', //0 No key
Qt.darker(color15Bright, 5), //1 -11 c
Qt.darker(color06Bright, 5), //2 -4 c#, db
Qt.darker(color11MusicalKey, 5), //3 -13 d
Qt.darker(color03Bright, 5), //4 -6 d#, eb
Qt.darker(color09MusicalKey, 5), //5 -16 e
Qt.darker(color01Bright, 5), //6 -9 f
Qt.darker(color07MusicalKey, 5), //7 -2 f#, gb
Qt.darker(color13Bright, 5), //8 -12 g
Qt.darker(color04MusicalKey, 5), //9 -5 g#, ab
Qt.darker(color10MusicalKey, 5), //10 -15 a
Qt.darker(color02MusicalKey, 5), //11 -7 a#, bb
Qt.darker(color08MusicalKey, 5), //12 -1 b
Qt.darker(color03Bright, 5), //13 -6 cm
Qt.darker(color09MusicalKey, 5), //14 -16 c#m, dbm
Qt.darker(color01Bright, 5), //15 -9 dm
Qt.darker(color07MusicalKey, 5), //16 -2 d#m, ebm
Qt.darker(color13Bright, 5), //17 -12 em
Qt.darker(color04MusicalKey, 5), //18 -5 fm
Qt.darker(color10MusicalKey, 5), //19 -15 f#m, gbm
Qt.darker(color02MusicalKey, 5), //20 -7 gm
Qt.darker(color08MusicalKey, 5), //21 -1 g#m, abm
Qt.darker(color15Bright, 5), //22 -11 am
Qt.darker(color06Bright, 5), //23 -4 a#m, bbm
Qt.darker(color11MusicalKey, 5) //24 -13 bm
]

//--------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ Item {
property var value: 0
}

// property string name1: name1Prop.value == "" ? "No Effect" : name1Prop.value
// property string name2: name2Prop.value == "" ? "No Effect" : name2Prop.value
// property string name3: name3Prop.value == "" ? "No Effect" : name3Prop.value

Defines.Colors { id: colors }
Defines.Durations { id: durations }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ Item {
key: "show_maximized_library"
}

readonly property bool viewButton: propView.value
readonly property bool viewButton: propView.value && false

property int hotcueId: 0
readonly property bool hotcueDisplay: hotcuePressed || cueTimer.running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Item {
id: loopSize
anchors.topMargin: 1
anchors.fill: parent
visible: (deckInfo.showLoopInfo || deckInfo.loopActive || settings.alwaysShowLoopSize) && !deckInfo.adjustEnabled && !hideLoop
visible: (deckInfo.showLoopInfo || deckInfo.loopActive || settings.alwaysShowLoopSize) && !hideLoop
}

Widgets.KeyDisplay {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Item {
anchors.fill: parent

Defines.Colors {id: colors}
Defines.Durations { id: durations }

Mixxx.ControlProxy {
group: `[Channel${parent.deckId}]`
Expand All @@ -30,7 +31,7 @@ Item {
color: deckInfo.loopActive ? (loopActiveBlinkTimer.blink ? loopActiveColour : (settings.loopActiveRedFlash ? colors.colorRed : loopDimmedColour))
: deckInfo.loopActive ? (deckInfo.shift ? loopDimmedColour : loopActiveColour)
: deckInfo.shift ? colors.colorDeckDarkGrey : colors.colorDeckGrey
Behavior on opacity { NumberAnimation { duration: 100; easing.type: Easing.Linear} }
Behavior on opacity { NumberAnimation { duration: durations.mainTransitionSpeed; easing.type: Easing.Linear} }
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
Rectangle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Item {
// STATES
//------------------------------------------------------------------------------------------------------------------

Behavior on y { PropertyAnimation { duration: 100; easing.type: Easing.InOutQuad } }
Behavior on y { PropertyAnimation { duration: durations.mainTransitionSpeed; easing.type: Easing.InOutQuad } }

states: [
State {
Expand Down

0 comments on commit 68287bd

Please sign in to comment.