Skip to content

Commit

Permalink
Roland DJ-505: Use indicator_250millis for blinking loop pads
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Jul 29, 2021
1 parent 8a3d88c commit 1d157bf
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1610,9 +1610,6 @@ DJ505.SavedLoopMode = function(deck, offset) {
on: this.color,
longPressTimeout: 500,
colorMapper: DJ505.PadColorMap,
blinkTimer: 0,
blinkTimeout: 250,
blinkStateOn: false,
unshift: function() {
this.inKey = "hotcue_" + this.number + "_activateloop";
this.input = components.Button.prototype.input;
Expand All @@ -1637,26 +1634,23 @@ DJ505.SavedLoopMode = function(deck, offset) {
}.bind(this);
},
stopBlinking: function() {
if (this.blinkTimer !== 0) {
engine.stopTimer(this.blinkTimer);
this.blinkTimer = 0;
if (this.connection[2] !== undefined) {
this.connection[2].disconnect();
delete this.connection[2];
}
},
output: function(value, _group, _control) {
this.stopBlinking();
if (value === 2) {
this.blinkTimer = engine.beginTimer(
this.blinkTimeout, function() {
var colorValue = this.colorMapper.getValueForNearestColor(
engine.getValue(this.group, this.colorKey));
if (this.blinkStateOn) {
this.send(colorValue + DJ505.PadColor.DIM_MODIFIER);
this.blinkStateOn = false;
} else {
this.send(colorValue);
this.blinkStateOn = true;
}
}.bind(this));
this.connections[2] = engine.makeConnection("[Master]", "indicator_250millis", function(value, _group, _control) {
var colorValue = this.colorMapper.getValueForNearestColor(
engine.getValue(this.group, this.colorKey));
if (value) {
this.send(colorValue);
} else {
this.send(colorValue + DJ505.PadColor.DIM_MODIFIER);
}
}.bind(this));
} else if (value === 1) {
var colorValue = this.colorMapper.getValueForNearestColor(
engine.getValue(this.group, this.colorKey));
Expand Down

0 comments on commit 1d157bf

Please sign in to comment.