Skip to content

Commit

Permalink
Clean up deckOffset calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed May 16, 2022
1 parent c6e590d commit ffdaa4e
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions res/controllers/Denon-MC7000-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,26 +895,11 @@ MC7000.crossFaderCurve = function(control, value) {
};

// Update state on deck changes
MC7000.switchDeck = function(channel, control, value, status, group) {
var deckOffset = script.deckFromGroup(group) - 1;
MC7000.switchDeck = function(channel, control, value, status) {
var deckOffset = status - 0x90;
var isTopDeck = deckOffset < 2;
var side = deckOffset % 2;

var previousDeckOffset;
switch (deckOffset) {
case 0:
previousDeckOffset = 2;
break;
case 1:
previousDeckOffset = 3;
break;
case 2:
previousDeckOffset = 0;
break;
case 3:
previousDeckOffset = 1;
break;
}
var previousDeckOffset = (deckOffset + 2) % 4;

// We need to 'transfer' the shift state when switching decks,
// otherwise it will get stuck and result in an 'inverted'
Expand Down

0 comments on commit ffdaa4e

Please sign in to comment.