Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.3' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Mar 26, 2023
2 parents 0ac86c0 + 9db1ac1 commit ee80231
Show file tree
Hide file tree
Showing 20 changed files with 298 additions and 160 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/labeler@main
# version between v4.0.3 and the one after which has not yet been tagged
# at the time of writing
- uses: actions/labeler@7012d51fe062f0b1e26e224a3c9fb52598ee3302
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

# This works around bug https://github.com/actions/labeler/issues/104.
# The workaround was proposed here:
# https://github.com/wesnoth/wesnoth/commit/958c82d0867568057caaf58356502ec8c87d8366
sync-labels: ""
sync-labels: false
7 changes: 7 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ jobs:
name: ${{ env.UPLOAD_PATCH_FILE }}
path: ${{ env.UPLOAD_PATCH_FILE }}

- name: "Upload pre-commit.log"
if: failure() && env.UPLOAD_PATCH_FILE == null
uses: actions/[email protected]
with:
name: pre-commit.log
path: /github/home/.cache/pre-commit/pre-commit.log

# AppStream metadata has been generated/updated by a pre-commit hook
- name: "Validate AppStream metadata"
if: runner.os == 'Linux'
Expand Down
10 changes: 5 additions & 5 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[main]
host = https://www.transifex.com

[mixxxdj.mixxx2-4]
file_filter = res/translations/mixxx_<lang>.ts
source_file = res/translations/mixxx.ts
source_lang = en
[o:mixxx-dj-software:p:mixxxdj:r:mixxx2-4]
file_filter = res/translations/mixxx_<lang>.ts
source_file = res/translations/mixxx.ts
source_lang = en
type = TS
minimum_perc = 0
type = QT
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@
* Allow search in external libraries [#11221](https://github.com/mixxxdj/mixxx/pull/11221) [#11216](https://github.com/mixxxdj/mixxx/issues/11216)
* JACK buffer size fix [#11121](https://github.com/mixxxdj/mixxx/pull/11121)
* Don't discard file tags with tuning information like "A#m +50" [#10992](https://github.com/mixxxdj/mixxx/pull/10992)
* Year search: Find also full date entries [#11251](https://github.com/mixxxdj/mixxx/pull/11251) [#11251](https://github.com/mixxxdj/mixxx/issues/11113)
* Year search: Find also full date entries [#11251](https://github.com/mixxxdj/mixxx/pull/11251) [#11113](https://github.com/mixxxdj/mixxx/issues/11113)
* Fix visual alignment of beats and waveform in case of decoding issues [#11162](https://github.com/mixxxdj/mixxx/pull/11162)
* Avoid "active key-value observers" messages during skin parsing on macOS [#11265](https://github.com/mixxxdj/mixxx/pull/11265)
* Fullscreen on Linux: Fix issues caused by Ubuntu Unity workaround [#11295](https://github.com/mixxxdj/mixxx/pull/11295) [#11281](https://github.com/mixxxdj/mixxx/issues/11281) [#11294](https://github.com/mixxxdj/mixxx/issues/11294)
Expand Down
95 changes: 54 additions & 41 deletions res/controllers/Pioneer-DDJ-400-script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Pioneer-DDJ-400-script.js
// ****************************************************************************
// * Mixxx mapping script file for the Pioneer DDJ-400.
// * Authors: Warker, nschloe, dj3730, jusko
// * Authors: Warker, nschloe, dj3730, jusko, tiesjan
// * Reviewers: Be-ing, Holzhaus
// * Manual: https://manual.mixxx.org/2.3/en/hardware/controllers/pioneer_ddj_400.html
// ****************************************************************************
Expand All @@ -19,22 +19,21 @@
//
// Custom (Mixxx specific mappings):
// * BeatFX: Assigned Effect Unit 1
// < LEFT focus EFFECT1
// > RIGHT focus EFFECT2
// v FX_SELECT focus EFFECT3.
// < LEFT toggles focus between Effects 1, 2 and 3 leftward
// > RIGHT toggles focus between Effects 1, 2 and 3 rightward
// v DOWN loads next effect entry for focused Effect
// SHIFT + v UP loads previous effect entry for focused Effect
// LEVEL/DEPTH controls the Mix knob of the Effect Unit
// SHIFT + LEVEL/DEPTH controls the Meta knob of the focused Effect
// ON/OFF toggles focused effect slot
// SHIFT + ON/OFF disables all three effect slots.
// SHIFT + < loads previous effect
// SHIFT + > loads next effect
//
// * 32 beat jump forward & back (Shift + </> CUE/LOOP CALL arrows)
// * Toggle quantize (Shift + channel cue)
//
// Not implemented (after discussion and trial attempts):
// * Loop Section:
// * -4BEAT auto loop (hacky---prefer a clean way to set a 4 beat loop
// from a previous position on long press)
//
// * CUE/LOOP CALL - memory & delete (complex and not useful. Hot cues are sufficient)
//
// * Secondary pad modes (trial attempts complex and too experimental)
Expand Down Expand Up @@ -173,7 +172,7 @@ PioneerDDJ400.init = function() {
engine.softTakeover("[EffectRack1_EffectUnit1_Effect3]", "meta", true);
engine.softTakeover("[EffectRack1_EffectUnit1]", "mix", true);

for (var i = 1; i <= 16; ++i) {
for (let i = 1; i <= 16; ++i) {
engine.makeConnection("[Sampler" + i + "]", "play", PioneerDDJ400.samplerPlayOutputCallbackFunction);
}

Expand All @@ -190,7 +189,7 @@ PioneerDDJ400.init = function() {
engine.makeConnection("[Channel1]", "loop_enabled", PioneerDDJ400.loopToggle);
engine.makeConnection("[Channel2]", "loop_enabled", PioneerDDJ400.loopToggle);

for (i = 1; i <= 3; i++) {
for (let i = 1; i <= 3; i++) {
engine.makeConnection("[EffectRack1_EffectUnit1_Effect" + i +"]", "enabled", PioneerDDJ400.toggleFxLight);
}
engine.makeConnection("[EffectRack1_EffectUnit1]", "focused_effect", PioneerDDJ400.toggleFxLight);
Expand All @@ -204,7 +203,7 @@ PioneerDDJ400.init = function() {
//

PioneerDDJ400.vuMeterUpdate = function(value, group) {
var newVal = value * 150;
const newVal = value * 150;

switch (group) {
case "[Channel1]":
Expand All @@ -222,14 +221,14 @@ PioneerDDJ400.vuMeterUpdate = function(value, group) {
//

PioneerDDJ400.toggleFxLight = function(_value, _group, _control) {
var enabled = engine.getValue(PioneerDDJ400.focusedFxGroup(), "enabled");
const enabled = engine.getValue(PioneerDDJ400.focusedFxGroup(), "enabled");

PioneerDDJ400.toggleLight(PioneerDDJ400.lights.beatFx, enabled);
PioneerDDJ400.toggleLight(PioneerDDJ400.lights.shiftBeatFx, enabled);
};

PioneerDDJ400.focusedFxGroup = function() {
var focusedFx = engine.getValue("[EffectRack1_EffectUnit1]", "focused_effect");
const focusedFx = engine.getValue("[EffectRack1_EffectUnit1]", "focused_effect");
return "[EffectRack1_EffectUnit1_Effect" + focusedFx + "]";
};

Expand All @@ -243,36 +242,50 @@ PioneerDDJ400.beatFxLevelDepthRotate = function(_channel, _control, value) {
}
};

PioneerDDJ400.beatFxSelectPreviousEffect = function(_channel, _control, value) {
engine.setValue(PioneerDDJ400.focusedFxGroup(), "prev_effect", value);
};
PioneerDDJ400.changeFocusedEffectBy = function(numberOfSteps) {
let focusedEffect = engine.getValue("[EffectRack1_EffectUnit1]", "focused_effect");

PioneerDDJ400.beatFxSelectNextEffect = function(_channel, _control, value) {
engine.setValue(PioneerDDJ400.focusedFxGroup(), "next_effect", value);
// Convert to zero-based index
focusedEffect -= 1;

// Standard Euclidean modulo by use of two plain modulos
const numberOfEffectsPerEffectUnit = 3;
focusedEffect = (((focusedEffect + numberOfSteps) % numberOfEffectsPerEffectUnit) + numberOfEffectsPerEffectUnit) % numberOfEffectsPerEffectUnit;

// Convert back to one-based index
focusedEffect += 1;

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", focusedEffect);
};

PioneerDDJ400.beatFxLeftPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 1);
PioneerDDJ400.changeFocusedEffectBy(-1);
};

PioneerDDJ400.beatFxRightPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 2);
PioneerDDJ400.changeFocusedEffectBy(1);
};

PioneerDDJ400.beatFxSelectPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 3);
engine.setValue(PioneerDDJ400.focusedFxGroup(), "next_effect", value);
};

PioneerDDJ400.beatFxSelectShiftPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue(PioneerDDJ400.focusedFxGroup(), "prev_effect", value);
};

PioneerDDJ400.beatFxOnOffPressed = function(_channel, _control, value) {
if (value === 0) { return; }

var toggleEnabled = !engine.getValue(PioneerDDJ400.focusedFxGroup(), "enabled");
const toggleEnabled = !engine.getValue(PioneerDDJ400.focusedFxGroup(), "enabled");
engine.setValue(PioneerDDJ400.focusedFxGroup(), "enabled", toggleEnabled);
};

Expand All @@ -282,7 +295,7 @@ PioneerDDJ400.beatFxOnOffShiftPressed = function(_channel, _control, value) {
engine.setParameter("[EffectRack1_EffectUnit1]", "mix", 0);
engine.softTakeoverIgnoreNextValue("[EffectRack1_EffectUnit1]", "mix");

for (var i = 1; i <= 3; i++) {
for (let i = 1; i <= 3; i++) {
engine.setValue("[EffectRack1_EffectUnit1_Effect" + i + "]", "enabled", 0);
}
PioneerDDJ400.toggleLight(PioneerDDJ400.lights.beatFx, false);
Expand All @@ -292,7 +305,7 @@ PioneerDDJ400.beatFxOnOffShiftPressed = function(_channel, _control, value) {
PioneerDDJ400.beatFxChannel = function(_channel, control, value, _status, group) {
if (value === 0x00) { return; }

var enableChannel1 = control === 0x10 ? 1 : 0,
const enableChannel1 = control === 0x10 ? 1 : 0,
enableChannel2 = control === 0x11 ? 1 : 0,
enableMaster = control === 0x14 ? 1 : 0;

Expand Down Expand Up @@ -335,7 +348,7 @@ PioneerDDJ400.setLoopButtonLights = function(status, value) {
};

PioneerDDJ400.startLoopLightsBlink = function(channel, control, status, group) {
var blink = 0x7F;
let blink = 0x7F;

PioneerDDJ400.stopLoopLightsBlink(group, control, status);

Expand Down Expand Up @@ -374,7 +387,7 @@ PioneerDDJ400.stopLoopLightsBlink = function(group, control, status) {
};

PioneerDDJ400.loopToggle = function(value, group, control) {
var status = group === "[Channel1]" ? 0x90 : 0x91,
const status = group === "[Channel1]" ? 0x90 : 0x91,
channel = group === "[Channel1]" ? 0 : 1;

PioneerDDJ400.setReloopLight(status, value ? 0x7F : 0x00);
Expand Down Expand Up @@ -426,12 +439,12 @@ PioneerDDJ400.syncLongPressed = function(channel, control, value, status, group)
};

PioneerDDJ400.cycleTempoRange = function(_channel, _control, value, _status, group) {
if (value === 0) return; // ignore release
if (value === 0) { return; } // ignore release

var currRange = engine.getValue(group, "rateRange");
var idx = 0;
const currRange = engine.getValue(group, "rateRange");
let idx = 0;

for (var i = 0; i < this.tempoRanges.length; i++) {
for (let i = 0; i < this.tempoRanges.length; i++) {
if (currRange === this.tempoRanges[i]) {
idx = (i + 1) % this.tempoRanges.length;
break;
Expand All @@ -445,12 +458,12 @@ PioneerDDJ400.cycleTempoRange = function(_channel, _control, value, _status, gro
//

PioneerDDJ400.jogTurn = function(channel, _control, value, _status, group) {
var deckNum = channel + 1;
const deckNum = channel + 1;
// wheel center at 64; <64 rew >64 fwd
var newVal = value - 64;
let newVal = value - 64;

// loop_in / out adjust
var loopEnabled = engine.getValue(group, "loop_enabled");
const loopEnabled = engine.getValue(group, "loop_enabled");
if (loopEnabled > 0) {
if (PioneerDDJ400.loopAdjustIn[channel]) {
newVal = newVal * PioneerDDJ400.loopAdjustMultiply + engine.getValue(group, "loop_start_position");
Expand All @@ -473,12 +486,12 @@ PioneerDDJ400.jogTurn = function(channel, _control, value, _status, group) {


PioneerDDJ400.jogSearch = function(_channel, _control, value, _status, group) {
var newVal = (value - 64) * PioneerDDJ400.fastSeekScale;
const newVal = (value - 64) * PioneerDDJ400.fastSeekScale;
engine.setValue(group, "jog", newVal);
};

PioneerDDJ400.jogTouch = function(channel, _control, value) {
var deckNum = channel + 1;
const deckNum = channel + 1;

// skip while adjusting the loop points
if (PioneerDDJ400.loopAdjustIn[channel] || PioneerDDJ400.loopAdjustOut[channel]) {
Expand Down Expand Up @@ -514,7 +527,7 @@ PioneerDDJ400.tempoSliderMSB = function(channel, control, value, status, group)
};

PioneerDDJ400.tempoSliderLSB = function(channel, control, value, status, group) {
var fullValue = (PioneerDDJ400.highResMSB[group].tempoSlider << 7) + value;
const fullValue = (PioneerDDJ400.highResMSB[group].tempoSlider << 7) + value;

engine.setValue(
group,
Expand Down Expand Up @@ -565,7 +578,7 @@ PioneerDDJ400.decreaseBeatjumpSizes = function(_channel, control, value, _status

PioneerDDJ400.samplerPlayOutputCallbackFunction = function(value, group, _control) {
if (value === 1) {
var curPad = group.match(script.samplerRegEx)[1];
const curPad = group.match(script.samplerRegEx)[1];
PioneerDDJ400.startSamplerBlink(
0x97 + (curPad > 8 ? 2 : 0),
0x30 + ((curPad > 8 ? curPad - 8 : curPad) - 1),
Expand All @@ -590,7 +603,7 @@ PioneerDDJ400.samplerPadShiftPressed = function(_channel, _control, value, _stat
};

PioneerDDJ400.startSamplerBlink = function(channel, control, group) {
var val = 0x7f;
let val = 0x7f;

PioneerDDJ400.stopSamplerBlink(channel, control);
PioneerDDJ400.timers[channel][control] = engine.beginTimer(250, function() {
Expand All @@ -601,7 +614,7 @@ PioneerDDJ400.startSamplerBlink = function(channel, control, group) {
// also blink the pad while SHIFT is pressed
midi.sendShortMsg((channel+1), control, val);

var isPlaying = engine.getValue(group, "play") === 1;
const isPlaying = engine.getValue(group, "play") === 1;

if (!isPlaying) {
// kill timer
Expand Down Expand Up @@ -656,14 +669,14 @@ PioneerDDJ400.shutdown = function() {

// housekeeping
// turn off all Sampler LEDs
for (var i = 0; i <= 7; ++i) {
for (let i = 0; i <= 7; ++i) {
midi.sendShortMsg(0x97, 0x30 + i, 0x00); // Deck 1 pads
midi.sendShortMsg(0x98, 0x30 + i, 0x00); // Deck 1 pads with SHIFT
midi.sendShortMsg(0x99, 0x30 + i, 0x00); // Deck 2 pads
midi.sendShortMsg(0x9A, 0x30 + i, 0x00); // Deck 2 pads with SHIFT
}
// turn off all Hotcue LEDs
for (i = 0; i <= 7; ++i) {
for (let i = 0; i <= 7; ++i) {
midi.sendShortMsg(0x97, 0x00 + i, 0x00); // Deck 1 pads
midi.sendShortMsg(0x98, 0x00 + i, 0x00); // Deck 1 pads with SHIFT
midi.sendShortMsg(0x99, 0x00 + i, 0x00); // Deck 2 pads
Expand Down
Loading

0 comments on commit ee80231

Please sign in to comment.