Skip to content

Commit 84f8f89

Browse files
committed
Fix code style issues in Numark Party Mix controller mapping
1 parent 8327e8b commit 84f8f89

2 files changed

Lines changed: 33 additions & 33 deletions

File tree

res/controllers/Numark-Party-Mix.midi.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<MixxxMIDIPreset schemaVersion="1" mixxxVersion="2.3.3">
2+
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.3.3">
33
<info>
44
<name>Numark Party Mix</name>
55
<!-- inspired by https://github.com/mixxxdj/mixxx/blob/main/res/controllers/Numark%20Mixtrack%20Pro%20FX.midi.xml -->
@@ -10,7 +10,6 @@
1010
</info>
1111
<controller id="Numark Party Mix">
1212
<scriptfiles>
13-
<file functionprefix="" filename="lodash.mixxx.js" />
1413
<file functionprefix="" filename="midi-components-0.0.js" />
1514
<file filename="Numark-Party-Mix.scripts.js" functionprefix="NumarkPartyMix" />
1615
</scriptfiles>
@@ -22,7 +21,7 @@
2221
<status>0xBF</status>
2322
<midino>0x0A</midino>
2423
<options>
25-
<Normal />
24+
<normal />
2625
</options>
2726
</control>
2827
<control>
@@ -31,7 +30,7 @@
3130
<status>0xBF</status>
3231
<midino>0x0D</midino>
3332
<options>
34-
<Normal />
33+
<normal />
3534
</options>
3635
</control>
3736
<control>
@@ -40,7 +39,7 @@
4039
<status>0xBF</status>
4140
<midino>0x0C</midino>
4241
<options>
43-
<Normal />
42+
<normal />
4443
</options>
4544
</control>
4645
<control>
@@ -49,7 +48,7 @@
4948
<status>0xBF</status>
5049
<midino>0x08</midino>
5150
<options>
52-
<Normal />
51+
<normal />
5352
</options>
5453
</control>
5554
<!-- PFL buttons (press) -->
@@ -566,7 +565,7 @@
566565
<status>0xBF</status>
567566
<midino>0x00</midino>
568567
<options>
569-
<Script-Binding />
568+
<script-binding />
570569
</options>
571570
</control>
572571
<control>
@@ -608,4 +607,4 @@
608607
</control>
609608
</controls>
610609
</controller>
611-
</MixxxMIDIPreset>
610+
</MixxxControllerPreset>

res/controllers/Numark-Party-Mix.scripts.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line no-var
12
var NumarkPartyMix = {};
23

34
// The jogwheel is behaving inconsistently
@@ -51,7 +52,7 @@ NumarkPartyMix.init = function(_id, _debugging) {
5152
engine.setValue("[App]", "num_samplers", 8);
5253
}
5354
NumarkPartyMix.deck = new components.ComponentContainer();
54-
for (var i = 0; i < 2; i++) {
55+
for (let i = 0; i < 2; i++) {
5556
NumarkPartyMix.deck[i] = new NumarkPartyMix.Deck(i + 1);
5657
}
5758

@@ -69,8 +70,8 @@ NumarkPartyMix.shutdown = function() {
6970
NumarkPartyMix.Deck = function(deckNumber) {
7071
components.Deck.call(this, deckNumber);
7172

72-
var channel = deckNumber - 1;
73-
var deck = this;
73+
const channel = deckNumber - 1;
74+
const deck = this;
7475
this.scratchModeEnabled = false;
7576

7677
this.playButton = new components.PlayButton({
@@ -89,7 +90,7 @@ NumarkPartyMix.Deck = function(deckNumber) {
8990
midi: [0x90 + channel, 0x1B],
9091
key: "pfl",
9192
output: function(value) {
92-
var note = (value === 0x00 ? 0x80 : 0x90) + channel;
93+
const note = (value === 0x00 ? 0x80 : 0x90) + channel;
9394
midi.sendShortMsg(note, 0x1B, this.outValueScale(value));
9495
}
9596
});
@@ -108,12 +109,12 @@ NumarkPartyMix.Deck = function(deckNumber) {
108109
});
109110

110111
this.treble = new components.Pot({
111-
group: "[EqualizerRack1_" + this.currentDeck + "_Effect1]",
112+
group: `[EqualizerRack1_${ this.currentDeck }_Effect1]`,
112113
inKey: "parameter3"
113114
});
114115

115116
this.bass = new components.Pot({
116-
group: "[EqualizerRack1_" + this.currentDeck + "_Effect1]",
117+
group: `[EqualizerRack1_${ this.currentDeck }_Effect1]`,
117118
inKey: "parameter1"
118119
});
119120

@@ -181,7 +182,7 @@ NumarkPartyMix.Deck = function(deckNumber) {
181182
});
182183
};
183184

184-
NumarkPartyMix.Deck.prototype = new components.Deck();
185+
NumarkPartyMix.Deck.prototype = Object.create(components.Deck.prototype);
185186

186187
NumarkPartyMix.PadSection = function(deckNumber) {
187188
components.ComponentContainer.call(this);
@@ -200,12 +201,12 @@ NumarkPartyMix.PadSection = function(deckNumber) {
200201
};
201202

202203
this.padPress = function(channel, control, value, status, group) {
203-
var i = (control - 0x14) % 8;
204+
const i = (control - 0x14) % 8;
204205
this.currentMode.connections[i].input(channel, control, value, status, group);
205206
};
206207

207208
this.setMode = function(control) {
208-
var newMode = this.modes[control];
209+
const newMode = this.modes[control];
209210
this.currentMode.forEachComponent(function(component) {
210211
component.disconnect();
211212
});
@@ -229,9 +230,9 @@ NumarkPartyMix.ModeHotcue = function(deckNumber) {
229230
this.control = NumarkPartyMix.PadModeControls.HOTCUE;
230231

231232
this.connections = new components.ComponentContainer();
232-
for (var i = 0; i < 4; i++) {
233+
for (let i = 0; i < 4; i++) {
233234
this.connections[i] = new components.HotcueButton({
234-
group: "[Channel" + deckNumber + "]",
235+
group: `[Channel${ deckNumber }]`,
235236
midi: [0x93 + deckNumber, 0x14 + i],
236237
number: i + 1,
237238
outConnect: false
@@ -246,13 +247,13 @@ NumarkPartyMix.ModeLoop = function(deckNumber) {
246247
this.control = NumarkPartyMix.PadModeControls.AUTOLOOP;
247248

248249
this.connections = new components.ComponentContainer();
249-
for (var i = 0; i < 4; i++) {
250+
for (let i = 0; i < 4; i++) {
250251
this.connections[i] = new components.Button({
251-
group: "[Channel" + deckNumber + "]",
252+
group: `[Channel${ deckNumber }]`,
252253
midi: [0x93 + deckNumber, 0x14 + i],
253254
size: NumarkPartyMix.autoLoopSizes[i],
254-
inKey: "beatloop_" + NumarkPartyMix.autoLoopSizes[i] + "_toggle",
255-
outKey: "beatloop_" + NumarkPartyMix.autoLoopSizes[i] + "_enabled",
255+
inKey: `beatloop_${ NumarkPartyMix.autoLoopSizes[i] }_toggle`,
256+
outKey: `beatloop_${ NumarkPartyMix.autoLoopSizes[i] }_enabled`,
256257
outConnect: false
257258
});
258259
}
@@ -267,9 +268,9 @@ NumarkPartyMix.ModeLoop.prototype = Object.create(components.ComponentContainer.
267268
NumarkPartyMix.ModeSampler = function(deckNumber) {
268269
components.ComponentContainer.call(this);
269270
this.control = NumarkPartyMix.PadModeControls.SAMPLER;
270-
var sampleoffset = (deckNumber - 1) * 4;
271+
const sampleoffset = (deckNumber - 1) * 4;
271272
this.connections = new components.ComponentContainer();
272-
for (var i = 0; i < 4; i++) {
273+
for (let i = 0; i < 4; i++) {
273274
this.connections[i] = new components.SamplerButton({
274275
midi: [0x93 + deckNumber, 0x14 + i],
275276
number: 1 + i + sampleoffset,
@@ -299,14 +300,14 @@ NumarkPartyMix.ModeEFX = function(deckNumber) {
299300

300301
this.control = NumarkPartyMix.PadModeControls.EFX;
301302

302-
var fx = [
303-
"[EffectRack1_EffectUnit" + deckNumber + "_Effect1]",
304-
"[EffectRack1_EffectUnit" + deckNumber + "_Effect2]",
305-
"[EffectRack1_EffectUnit" + deckNumber + "_Effect3]"
303+
const fx = [
304+
`[EffectRack1_EffectUnit${ deckNumber }_Effect1]`,
305+
`[EffectRack1_EffectUnit${ deckNumber }_Effect2]`,
306+
`[EffectRack1_EffectUnit${ deckNumber }_Effect3]`
306307
];
307308

308309
this.connections = new components.ComponentContainer();
309-
var p = this.connections;
310+
const p = this.connections;
310311

311312
fx.forEach(function(fx, i) {
312313
p[i] = new components.Button({
@@ -318,7 +319,7 @@ NumarkPartyMix.ModeEFX = function(deckNumber) {
318319
});
319320
p[3] = new components.Button({
320321
midi: [0x93 + deckNumber, 0x17],
321-
group: "[EffectRack1_EffectUnit" + deckNumber + "]",
322+
group: `[EffectRack1_EffectUnit${ deckNumber }]`,
322323
key: "mix_mode",
323324
type: components.Button.prototype.types.toggle,
324325
outValueScale: function(val) {
@@ -332,12 +333,12 @@ NumarkPartyMix.ModeEFX.prototype = Object.create(components.ComponentContainer.p
332333
NumarkPartyMix.Browse = function() {
333334
components.ComponentContainer.call(this);
334335

335-
var browse = this;
336+
const browse = this;
336337
this.knobpressed = false;
337338

338339
this.knob = new components.Encoder({
339340
input: function(channel, control, value) {
340-
var direction;
341+
let direction;
341342
if (browse.knobpressed) {
342343
if (value > 0x40) {
343344
engine.setParameter("[Library]", "MoveFocusForward", 1);

0 commit comments

Comments
 (0)