From 68287bd6e310a32abeea0985330aa3658f5c11aa Mon Sep 17 00:00:00 2001 From: Antoine C Date: Sat, 21 Sep 2024 12:15:25 +0100 Subject: [PATCH] WIP --- res/controllers/Traktor-Kontrol-S4-MK3.js | 20 ++-- .../S4MK3/AdvancedScreen/Defines/Colors.qml | 98 ++++++++++--------- .../AdvancedScreen/Overlays/BankInfo.qml | 4 - .../AdvancedScreen/ViewModels/DeckInfo.qml | 2 +- .../Waveform/WaveformContainer.qml | 2 +- .../S4MK3/AdvancedScreen/Widgets/LoopSize.qml | 3 +- .../AdvancedScreen/Widgets/StemOverlay.qml | 2 +- 7 files changed, 63 insertions(+), 68 deletions(-) diff --git a/res/controllers/Traktor-Kontrol-S4-MK3.js b/res/controllers/Traktor-Kontrol-S4-MK3.js index 51403cafd1ea..c71e0cac4721 100644 --- a/res/controllers/Traktor-Kontrol-S4-MK3.js +++ b/res/controllers/Traktor-Kontrol-S4-MK3.js @@ -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); @@ -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 { @@ -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); @@ -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() { diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Defines/Colors.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Defines/Colors.qml index 320cce2e4c4c..0b084dd1a1a6 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Defines/Colors.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Defines/Colors.qml @@ -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 ] //-------------------------------------------------------------------------------------------------------------------- diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Overlays/BankInfo.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Overlays/BankInfo.qml index 6b2d765eb819..0104aca56629 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Overlays/BankInfo.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Overlays/BankInfo.qml @@ -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 } diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/ViewModels/DeckInfo.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/ViewModels/DeckInfo.qml index 6a1f5204f6f6..f47dc4077cb9 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/ViewModels/DeckInfo.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/ViewModels/DeckInfo.qml @@ -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 diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Waveform/WaveformContainer.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Waveform/WaveformContainer.qml index 72c1abadbb43..5b7dc361f409 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Waveform/WaveformContainer.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Waveform/WaveformContainer.qml @@ -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 { diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/LoopSize.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/LoopSize.qml index dfd19c98752b..9f5895c3e07c 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/LoopSize.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/LoopSize.qml @@ -8,6 +8,7 @@ Item { anchors.fill: parent Defines.Colors {id: colors} + Defines.Durations { id: durations } Mixxx.ControlProxy { group: `[Channel${parent.deckId}]` @@ -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 { diff --git a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/StemOverlay.qml b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/StemOverlay.qml index aef363714751..37c8497e06e1 100755 --- a/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/StemOverlay.qml +++ b/res/controllers/TraktorKontrolS4MK3Screens/S4MK3/AdvancedScreen/Widgets/StemOverlay.qml @@ -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 {