Skip to content

Commit

Permalink
Roland DJ-505: Allow changing track color via SHIFT + press and turn …
Browse files Browse the repository at this point in the history
…Browse
  • Loading branch information
Holzhaus committed Mar 20, 2020
1 parent 3eca24b commit 22d5f23
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions res/controllers/Roland_DJ-505-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ DJ505.shutdown = function() {
DJ505.browseEncoder = new components.Encoder({
longPressTimer: 0,
longPressTimeout: 250,
trackColorCycleEnabled: false,
trackColorCycleHappened: false,
previewSeekEnabled: false,
previewSeekHappened: false,
unshift: function() {
Expand Down Expand Up @@ -249,12 +251,25 @@ DJ505.browseEncoder = new components.Encoder({
shift: function() {
this.onKnobEvent = function(rotateValue) {
if (rotateValue !== 0) {
engine.setValue("[Playlist]", "SelectPlaylist", rotateValue);
if (this.trackColorCycleEnabled) {
var key = (rotateValue > 0) ? "track_color_next" : "track_color_prev";
engine.setValue("[Library]", key, 1.0);
this.trackColorCycleHappened = true;
} else {
engine.setValue("[Playlist]", "SelectPlaylist", rotateValue);
}
}
};
this.onButtonEvent = function(value) {
if (value) {
script.triggerControl("[Playlist]", "ToggleSelectedSidebarItem");
this.trackColorCycleEnabled = true;
this.trackColorCycleHappened = false;
} else {
if (!this.trackColorCycleHappened) {
script.triggerControl("[Playlist]", "ToggleSelectedSidebarItem");
}
this.trackColorCycleEnabled = false;
this.trackColorCycleHappened = false;
}
};
},
Expand Down

0 comments on commit 22d5f23

Please sign in to comment.