diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-07-17 16:50:01 +0200 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-07-17 16:50:01 +0200 |
commit | d9d84e93e92832cf9fa64d2e8dba8cccc698ec11 (patch) | |
tree | 983740ab047cccd4090f7049bf5b1e150b2cf028 /res/controllers/midi-components-0.0.js | |
parent | 6f0c69028f5f958c03e1140dd44733e37dac2466 (diff) |
midi-components: Also improve deckNumbers check
Diffstat (limited to 'res/controllers/midi-components-0.0.js')
-rw-r--r-- | res/controllers/midi-components-0.0.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 7d7b2165ad..c5605f016c 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -664,22 +664,19 @@ }; var Deck = function(deckNumbers) { - if (deckNumbers !== undefined) { - if (Array.isArray(deckNumbers)) { - // These must be unique to each instance, - // so they cannot be in the prototype. - this.currentDeck = "[Channel" + deckNumbers[0] + "]"; - this.deckNumbers = deckNumbers; - } else if (typeof deckNumbers === "number" && - Math.floor(deckNumbers) === deckNumbers && - isFinite(deckNumbers)) { - this.currentDeck = "[Channel" + deckNumbers + "]"; - this.deckNumbers = [deckNumbers]; - } + if (deckNumbers !== undefined && Array.isArray(deckNumbers)) { + // These must be unique to each instance, + // so they cannot be in the prototype. + this.deckNumbers = deckNumbers; + } else if (deckNumbers !== undefined && typeof deckNumbers === "number" && + Math.floor(deckNumbers) === deckNumbers && + isFinite(deckNumbers)) { + this.deckNumbers = [deckNumbers]; } else { print("ERROR! new Deck() called without specifying any deck numbers"); return; } + this.currentDeck = "[Channel" + deckNumbers[0] + "]"; }; Deck.prototype = new ComponentContainer({ setCurrentDeck: function(newGroup) { |