Skip to content

Commit

Permalink
Roland DJ-505: Add support for saved loop mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Jul 9, 2019
1 parent 89b74da commit 455340c
Showing 1 changed file with 41 additions and 5 deletions.
46 changes: 41 additions & 5 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ DJ505.PadSection = function (deck, offset) {
"roll": new DJ505.RollMode(deck, offset),
"sampler": new DJ505.SamplerMode(deck, offset),
"velocitysampler": new DJ505.VelocitySamplerMode(deck, offset),
"loop": new DJ505.SavedLoopMode(deck, offset),
"pitchplay": new DJ505.PitchPlayMode(deck, offset),
};
this.offset = offset;
Expand Down Expand Up @@ -1076,11 +1077,9 @@ DJ505.PadSection.prototype.controlToPadMode = function (control) {
case DJ505.PadMode.VELOCITYSAMPLER:
mode = this.modes.velocitysampler;
break;
// FIXME: Loop mode can be added as soon as Saved Loops are
// implemented: https://bugs.launchpad.net/mixxx/+bug/692926
//case DJ505.PadMode.LOOP:
// mode = this.modes.loop;
// break;
case DJ505.PadMode.LOOP:
mode = this.modes.loop;
break;
case DJ505.PadMode.PITCHPLAY:
mode = this.modes.pitchplay;
break;
Expand Down Expand Up @@ -1403,6 +1402,43 @@ DJ505.RollMode.prototype.setLoopSize = function (loopSize) {
this.reconnectComponents();
};

DJ505.SavedLoopMode = function (deck, offset) {
components.ComponentContainer.call(this);
this.ledControl = DJ505.PadMode.ROLL;
this.color = DJ505.PadColor.GREEN;

var savedloopColors = [this.color].concat(DJ505.PadColorMap.slice(1));
this.PerformancePad = function(n) {
this.midi = [0x94 + offset, 0x14 + n];
this.number = n + 9;
this.outKey = "hotcue_" + this.number + "_enabled";

components.Button.call(this);
};
this.PerformancePad.prototype = new components.Button({
sendShifted: true,
shiftControl: true,
shiftOffset: 8,
group: deck.currentDeck,
colors: savedloopColors,
outConnect: false,
on: this.color,
unshift: function() {
this.inKey = "hotcue_" + this.number + "_activateloop";
},
shift: function() {
this.inKey = "hotcue_" + this.number + "_reloop";
},
});

this.pads = new components.ComponentContainer();
for (var n = 0; n <= 7; n++) {
this.pads[n] = new this.PerformancePad(n);
}
};
DJ505.SavedLoopMode.prototype = Object.create(components.ComponentContainer.prototype);


DJ505.SamplerMode = function (deck, offset) {
components.ComponentContainer.call(this);
this.ledControl = DJ505.PadMode.SAMPLER;
Expand Down

0 comments on commit 455340c

Please sign in to comment.