diff --git a/res/controllers/Numark-Mixtrack-Platinum-scripts.js b/res/controllers/Numark-Mixtrack-Platinum-scripts.js index 7b523bdb5e6..e8c7a220585 100644 --- a/res/controllers/Numark-Mixtrack-Platinum-scripts.js +++ b/res/controllers/Numark-Mixtrack-Platinum-scripts.js @@ -265,7 +265,7 @@ MixtrackPlatinum.EffectUnit = function (unitNumbers) { components.Pot.prototype.input.call(this, channel, control, value, status, group); }, connect: function() { - this.focus_connection = engine.makeConnection(eu.group, "focused_effect", this.onFocusChange); + this.focus_connection = engine.makeConnection(eu.group, "focused_effect", this.onFocusChange.bind(this)); this.focus_connection.trigger(); }, disconnect: function() { @@ -367,7 +367,7 @@ MixtrackPlatinum.EffectUnit = function (unitNumbers) { }, connect: function() { components.Button.prototype.connect.call(this); - this.fx_connection = engine.makeConnection(eu.group, "focused_effect", this.onFocusChange); + this.fx_connection = engine.makeConnection(eu.group, "focused_effect", this.onFocusChange.bind(this)); }, disconnect: function() { components.Button.prototype.disconnect.call(this); @@ -405,7 +405,7 @@ MixtrackPlatinum.EffectUnit = function (unitNumbers) { button.send(button.off); button.flash_state = true; } - }); + }.bind(this)); }, stopFlash: function() { engine.stopTimer(this.flash_timer); @@ -426,7 +426,7 @@ MixtrackPlatinum.EffectUnit = function (unitNumbers) { engine.setValue(eu.group, "show_parameters", 1); } } - }); + }.bind(this)); this.show_focus_connection.trigger(); this.touch_strip = new this.EffectUnitTouchStrip(); @@ -563,7 +563,7 @@ MixtrackPlatinum.Deck = function(number, midi_chan, effects_unit) { type: components.Button.prototype.types.toggle, connect: function() { components.Button.prototype.connect.call(this); - this.connections[1] = engine.makeConnection(this.group, this.outKey, MixtrackPlatinum.pflToggle); + this.connections[1] = engine.makeConnection(this.group, this.outKey, MixtrackPlatinum.pflToggle.bind(this)); }, }); diff --git a/res/controllers/Numark-N4-scripts.js b/res/controllers/Numark-N4-scripts.js index 618f588fef3..f3387b3fd61 100644 --- a/res/controllers/Numark-N4-scripts.js +++ b/res/controllers/Numark-N4-scripts.js @@ -95,7 +95,7 @@ NumarkN4.init = function (id) { } // create xFader callbacks and trigger them to fill NumarkN4.storedCrossfaderParams _.forEach(NumarkN4.scratchXFader, function (value,control) { - var connectionObject = engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback); + var connectionObject = engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback.bind(this)); connectionObject.trigger(); NumarkN4.crossfaderCallbackConnections.push(connectionObject); }); @@ -231,7 +231,7 @@ NumarkN4.topContainer = function (channel) { this.timer = engine.beginTimer(1000, function () { theContainer.reconnectComponents(); this.timer = 0; - }, true); + }.bind(this), true); }, shift: function () { this.group=theContainer.group; @@ -325,14 +325,14 @@ NumarkN4.MixerTemplate = function () { _.forEach(NumarkN4.scratchXFader, function (value, control){ engine.setValue("[Mixer Profile]", control, value); NumarkN4.crossfaderCallbackConnections.push( - engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback) + engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback.bind(this)) ); }); } else { _.forEach(NumarkN4.storedCrossfaderParams, function (value, control) { engine.setValue("[Mixer Profile]", control, value); NumarkN4.crossfaderCallbackConnections.push( - engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback) + engine.makeConnection("[Mixer Profile]", control, NumarkN4.CrossfaderChangeCallback.bind(this)) ); }); } @@ -495,7 +495,7 @@ NumarkN4.Deck = function (channel) { } engine.beginTimer(100,function () { this.flickerSafetyTimeout=true; - },true); + }.bind(this),true); } }, }); @@ -587,10 +587,10 @@ NumarkN4.Deck = function (channel) { // spawned which conflicted with the old (still running) timers. if (!this.previouslyLoaded) { //timer is more efficent is this case than a callback because it would be called too often. - theDeck.blinkTimer=engine.beginTimer(NumarkN4.blinkInterval,theDeck.manageChannelIndicator); + theDeck.blinkTimer=engine.beginTimer(NumarkN4.blinkInterval,theDeck.manageChannelIndicator.bind(theDeck)); } this.previouslyLoaded=value; - }); + }.bind(this)); this.pitchBendMinus = new components.Button({ midi: [0x90+channel,0x18,0xB0+channel,0x3D], key: "rate_temp_down", diff --git a/res/controllers/Pioneer-DDJ-SB2-scripts.js b/res/controllers/Pioneer-DDJ-SB2-scripts.js index 4ef3a410d04..0af28cb8d49 100644 --- a/res/controllers/Pioneer-DDJ-SB2-scripts.js +++ b/res/controllers/Pioneer-DDJ-SB2-scripts.js @@ -1189,5 +1189,5 @@ PioneerDDJSB2.EffectUnit = function (unitNumber) { var effectGroup = '[EffectRack1_EffectUnit' + unitNumber + '_Effect' + value + ']'; engine.softTakeoverIgnoreNextValue(effectGroup, 'meta'); } - }); + }.bind(this)); };