Skip to content

Commit

Permalink
Roland DJ-505: Rename Component.colors to .colorMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Feb 27, 2020
1 parent 7df40a8 commit 9f3a4db
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,6 @@ DJ505.HotcueMode = function(deck, offset) {
this.ledControl = DJ505.PadMode.HOTCUE;
this.color = DJ505.PadColor.WHITE;

var hotcueColors = DJ505.PadColorMap;
this.pads = new components.ComponentContainer();
for (var i = 0; i <= 7; i++) {
this.pads[i] = new components.HotcueButton({
Expand All @@ -1258,7 +1257,7 @@ DJ505.HotcueMode = function(deck, offset) {
group: deck.currentDeck,
on: this.color,
off: this.color + DJ505.PadColor.DIM_MODIFIER,
colors: hotcueColors,
colorMapper: DJ505.PadColorMap,
outConnect: false,
});
}
Expand Down Expand Up @@ -1294,7 +1293,6 @@ DJ505.CueLoopMode = function(deck, offset) {
this.ledControl = DJ505.PadMode.HOTCUE;
this.color = DJ505.PadColor.BLUE;

var cueloopColors = DJ505.PadColorMap;
this.PerformancePad = function(n) {
this.midi = [0x94 + offset, 0x14 + n];
this.number = n + 1;
Expand All @@ -1310,7 +1308,7 @@ DJ505.CueLoopMode = function(deck, offset) {
group: deck.currentDeck,
on: this.color,
off: this.color + DJ505.PadColor.DIM_MODIFIER,
colors: cueloopColors,
colorMapper: DJ505.PadColorMap,
outConnect: false,
unshift: function() {
this.input = function(channel, control, value, status, group) {
Expand Down Expand Up @@ -1603,13 +1601,12 @@ DJ505.PitchPlayMode = function(deck, offset) {
this.color = DJ505.PadColor.GREEN;
this.cuepoint = 1;
this.range = PitchPlayRange.MID;
var pitchplayColors = DJ505.PadColorMap;

this.PerformancePad = function(n) {
this.midi = [0x94 + offset, 0x14 + n];
this.number = n + 1;
this.on = this.color + DJ505.PadColor.DIM_MODIFIER;
this.colors = pitchplayColors;
this.colorMapper = DJ505.PadColorMap;
this.colorKey = "hotcue_" + this.number + "_color";
components.Button.call(this);
};
Expand All @@ -1623,7 +1620,7 @@ DJ505.PitchPlayMode = function(deck, offset) {
off: DJ505.PadColor.OFF,
outputColor: function(colorCode) {
// For colored hotcues (shifted only)
var midiColor = this.colors.getNearestValue(colorCode);
var midiColor = this.colorMapper.getNearestValue(colorCode);
this.send((this.mode.cuepoint === this.number) ? midiColor : (midiColor + DJ505.PadColor.DIM_MODIFIER));
},
unshift: function() {
Expand Down

0 comments on commit 9f3a4db

Please sign in to comment.