From 067f5d637c669e4d6951a84a1b4fe3c4e165b1cd Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 5 Dec 2023 02:01:44 +0100 Subject: [PATCH] controllers: fix engine.beginTimer() syntax --- res/controllers/Akai-LPD8-RK-scripts.js | 10 ++-- .../American-Audio-VMS2-scripts.js | 2 +- .../Behringer-BCD3000-Advanced-scripts.js | 2 +- res/controllers/DJ-Tech-CDJ-101-scripts.js | 4 +- .../DJ-Tech-Kontrol-One-scripts.js | 18 +++---- .../DJ-Tech-i-Mix-Reload-scripts.js | 2 +- res/controllers/Denon-DN-SC2000.midi.js | 20 +++---- res/controllers/Electrix-Tweaker-scripts.js | 10 ++-- res/controllers/Gemini-FirstMix-scripts.js | 2 +- .../Hercules DJ Control MP3 e2-scripts.js | 4 +- .../Hercules-DJ-Console-Mk1-hid-scripts.js | 2 +- .../Hercules-DJ-Console-Mk2-hid-scripts.js | 2 +- .../Hercules-DJ-Console-RMX-scripts.js | 14 ++--- .../Hercules-DJ-Control-MP3-scripts.js | 12 ++--- .../Hercules-DJ-Control-Steel-scripts.js | 22 ++++---- .../Hercules-DJControl-Compact-scripts.js | 2 +- .../Ion-Discover-DJ-Pro-scripts.js | 2 +- res/controllers/Ion-Discover-DJ-scripts.js | 2 +- res/controllers/Korg-nanoKONTROL-2-scripts.js | 14 ++--- res/controllers/Korg-nanoPAD2-scripts.js | 2 +- res/controllers/Numark-Mixtrack-2-scripts.js | 6 +-- .../Numark-Mixtrack-Pro-scripts.js | 8 +-- .../Numark-Omni-Control-scripts.js | 12 ++--- .../Numark-Total-Control-scripts.js | 12 ++--- res/controllers/Numark-V7-scripts.js | 54 +++++++++---------- res/controllers/Pioneer-DDJ-SB2-scripts.js | 4 +- res/controllers/Pioneer-DDJ-SX-scripts.js | 4 +- res/controllers/Reloop Terminal Mix 2-4.js | 4 +- res/controllers/Reloop-Beatmix-2-4-scripts.js | 6 +-- res/controllers/Reloop-Jockey-3-ME-scripts.js | 26 ++++----- res/controllers/Stanton-SCS1d-scripts.js | 8 +-- res/controllers/Stanton-SCS1m-scripts.js | 4 +- res/controllers/Stanton-SCS3d-scripts.js | 10 ++-- res/controllers/TrakProDJ-iPad-scripts.js | 4 +- .../Vestax-VCI-100-3DEX-scripts.js | 2 +- 35 files changed, 156 insertions(+), 156 deletions(-) diff --git a/res/controllers/Akai-LPD8-RK-scripts.js b/res/controllers/Akai-LPD8-RK-scripts.js index 30165dbc105..45b4d5954ef 100644 --- a/res/controllers/Akai-LPD8-RK-scripts.js +++ b/res/controllers/Akai-LPD8-RK-scripts.js @@ -253,7 +253,7 @@ LPD8RK.init = function (id, debug) { // called when the device is opened & set u engine.softTakeover("[Sampler2]","rate",true); //set LED timer - LPD8RK.ledTimer = engine.beginTimer(LPD8RK.LEDinterval, "LPD8RK.setLeds()"); + LPD8RK.ledTimer = engine.beginTimer(LPD8RK.LEDinterval, LPD8RK.setLeds); }; LPD8RK.shutdown = function () { @@ -263,7 +263,7 @@ LPD8RK.shutdown = function () { LPD8RK.resetLEDTimer = function () { engine.stopTimer(LPD8RK.ledTimer); LPD8RK.setLeds() - LPD8RK.ledTimer = engine.beginTimer(LPD8RK.LEDinterval, "LPD8RK.setLeds()"); + LPD8RK.ledTimer = engine.beginTimer(LPD8RK.LEDinterval, LPD8RK.setLeds); }; LPD8RK.setLeds = function () { @@ -376,7 +376,7 @@ LPD8RK.reloopButton = function (channel, control, value, status, group) { engine.stopTimer(LPD8RK.reloopTimer); LPD8RK.loopbuttonDown=true; LPD8RK.doreloop=true; - LPD8RK.reloopTimer = engine.beginTimer(500, "LPD8RK.disablereloop()", true); + LPD8RK.reloopTimer = engine.beginTimer(500, LPD8RK.disablereloop, true); } else {//button was released LPD8RK.loopbuttonDown=false; if (LPD8RK.doreloop===true) {engine.setValue(group, "reloop_exit", 1);}; @@ -437,11 +437,11 @@ LPD8RK.hotcueBankDial = function (channel, control, value, status, group) { LPD8RK.oldHotcueBank=LPD8RK.hotcueBank; //set timer to clear old bank number after 500 msec, so bank indicator light will light up engine.stopTimer(LPD8RK.oldbanktimer); - LPD8RK.oldbanktimer = engine.beginTimer(500, "LPD8RK.resetOldBank()", true); + LPD8RK.oldbanktimer = engine.beginTimer(500, LPD8RK.resetOldBank, true); //set timer to restart LED updates in 500 msec engine.stopTimer(LPD8RK.LEDPauseTimer); - LPD8RK.LEDPauseTimer = engine.beginTimer(LPD8RK.LEDinterval, "LPD8RK.resetLEDTimer()", true); + LPD8RK.LEDPauseTimer = engine.beginTimer(LPD8RK.LEDinterval, LPD8RK.resetLEDTimer, true); }; LPD8RK.looplenDial = function (channel, control, value, status, group) { diff --git a/res/controllers/American-Audio-VMS2-scripts.js b/res/controllers/American-Audio-VMS2-scripts.js index cbed294a067..e2f97bb61c1 100644 --- a/res/controllers/American-Audio-VMS2-scripts.js +++ b/res/controllers/American-Audio-VMS2-scripts.js @@ -323,7 +323,7 @@ VMS2.playlight = function(value, group, control) { deck.Buttons.Pause.setLed(LedState.on); // start a fancy blink timer deck.switchPlaylightOff = true; - deck.playTimer = engine.beginTimer(500,"VMS2.playlightflash(\""+group+"\")"); + deck.playTimer = engine.beginTimer(500, function() { VMS2.playlightflash(group); }); } }; diff --git a/res/controllers/Behringer-BCD3000-Advanced-scripts.js b/res/controllers/Behringer-BCD3000-Advanced-scripts.js index f86503f1e8b..5233f5991b0 100644 --- a/res/controllers/Behringer-BCD3000-Advanced-scripts.js +++ b/res/controllers/Behringer-BCD3000-Advanced-scripts.js @@ -75,7 +75,7 @@ BehringerBCD3000.jogWheel = function (channel, control, value, status, group) { scratchValue = (value - 0x40); engine.scratchEnable(deck + 1, 100, 33+1/3, 1.0/8, (1.0/8)/32); engine.scratchTick(deck + 1, scratchValue); - BehringerBCD3000.scratchTimer[deck] = engine.beginTimer(20, "BehringerBCD3000.stopScratch(" + deck + ")", true); + BehringerBCD3000.scratchTimer[deck] = engine.beginTimer(20, function() { BehringerBCD3000.stopScratch(deck); }, true); } else if (BehringerBCD3000.onKey) { if (value > 0x40){ diff --git a/res/controllers/DJ-Tech-CDJ-101-scripts.js b/res/controllers/DJ-Tech-CDJ-101-scripts.js index 9d09e7a5c06..f84d67e3473 100644 --- a/res/controllers/DJ-Tech-CDJ-101-scripts.js +++ b/res/controllers/DJ-Tech-CDJ-101-scripts.js @@ -188,7 +188,9 @@ DJTechCDJ101.jogtouch = function(channel, control, value, status, group) } else { DJTechCDJ101.outer2inner = true; - DJTechCDJ101.scratch_timer = engine.beginTimer(DJTechCDJ101.scratch_timeout, 'DJTechCDJ101.finishScratch(' + deck + ', true)'); + DJTechCDJ101.scratch_timer = engine.beginTimer( + DJTechCDJ101.scratch_timeout, + function() { DJTechCDJ101.finishScratch(deck, true); }); } } } diff --git a/res/controllers/DJ-Tech-Kontrol-One-scripts.js b/res/controllers/DJ-Tech-Kontrol-One-scripts.js index ee7d1cd1083..4f55c174195 100644 --- a/res/controllers/DJ-Tech-Kontrol-One-scripts.js +++ b/res/controllers/DJ-Tech-Kontrol-One-scripts.js @@ -68,7 +68,7 @@ KONTROL1.mod["s"]={state:"o",timer:false,doshift:true}; KONTROL1.init = function init(id, debug) { // called when the device is opened & set up if (KONTROL1.debug>2){print("##function: "+KONTROL1.getFunctionName())}; KONTROL1.updateLEDs(); - if(KONTROL1.disableFlash!==true)KONTROL1.ledTimer = engine.beginTimer(1000, "KONTROL1.doLEDs()");//set timer for LED indicator flashes + if(KONTROL1.disableFlash!==true)KONTROL1.ledTimer = engine.beginTimer(1000, KONTROL1.doLEDs);//set timer for LED indicator flashes engine.connectControl("[Channel1]", "volume", "KONTROL1.testconnect"); }; @@ -113,7 +113,7 @@ KONTROL1.knobPress = function knobPress(knobnum){ //{state:"o",timer:false,dobankswitch:true}; KONTROL1.modPress(knobnum);//turn mod on engine.stopTimer(KONTROL1.mod[knobnum]["timer"]);//kill any previous timer - KONTROL1.mod[knobnum]["timer"]=engine.beginTimer(KONTROL1.modTimeout, "KONTROL1.disableBankSwitch('"+knobnum+"')", true); + KONTROL1.mod[knobnum]["timer"]=engine.beginTimer(KONTROL1.modTimeout, function() { KONTROL1.disableBankSwitch(knobnum); }, true); } KONTROL1.knobRelease = function knobRelease(knobnum){ @@ -145,7 +145,7 @@ KONTROL1.shiftPress = function shiftPress(){ var knobnum="s"; KONTROL1.modPress(knobnum);//turn mod on engine.stopTimer(KONTROL1.mod[knobnum]["timer"]);//kill any previous timer - KONTROL1.mod[knobnum]["timer"]=engine.beginTimer(500, "KONTROL1.disableShiftSwitch('"+knobnum+"')", true); + KONTROL1.mod[knobnum]["timer"]=engine.beginTimer(500, function() { KONTROL1.disableShiftSwitch(knobnum); }, true); } KONTROL1.shiftRelease = function shiftRelease(){ @@ -198,7 +198,7 @@ KONTROL1.modRelease = function modRelease(knobnum){ KONTROL1.doLEDs = function doLEDs() { if (KONTROL1.debug>2){print("##function: "+KONTROL1.getFunctionName())}; engine.stopTimer(KONTROL1.flashTimer); - KONTROL1.flashTimer=engine.beginTimer(30, "KONTROL1.bankIndicators()"); + KONTROL1.flashTimer=engine.beginTimer(30, KONTROL1.bankIndicators); return; }; @@ -589,7 +589,7 @@ KONTROL1.cueClear = function cueClear(cue, control, deck){//clear hotcue - OR mo if(engine.getValue(group, "hotcue_"+cue+"_enabled")!=true){//hotcue not set - prepare to move next hotcue pressed to this button KONTROL1.cueMoveToNum=cue; engine.stopTimer(KONTROL1.cueMoveIndicator); - KONTROL1.cueMoveIndicator=engine.beginTimer(100, "KONTROL1.cueMoveIndicatorLEDs("+control+")");//start timer for LED indicator flasher showing the button we're moving to + KONTROL1.cueMoveIndicator=engine.beginTimer(100, function() { KONTROL1.cueMoveIndicatorLEDs(control); });//start timer for LED indicator flasher showing the button we're moving to return true; } @@ -817,7 +817,7 @@ KONTROL1.reloopButton = function reloopButton(value, deck) {//reloop/exit button engine.stopTimer(KONTROL1.reloopTimer); KONTROL1.loopbuttonDown=true; KONTROL1.doreloop=true; - KONTROL1.reloopTimer = engine.beginTimer(500, "KONTROL1.disablereloop()", true); + KONTROL1.reloopTimer = engine.beginTimer(500, KONTROL1.disablereloop, true); } else {//button was released KONTROL1.loopbuttonDown=false; if (KONTROL1.doreloop===true) { @@ -881,7 +881,7 @@ KONTROL1.loopIn = function loopIn(value, deck) { if (value>0){//button was pressed KONTROL1.loopinbuttonDown=true; KONTROL1.doloopin=true; - KONTROL1.loopinbuttonTimer = engine.beginTimer(500, "KONTROL1.disableloopin()", true); + KONTROL1.loopinbuttonTimer = engine.beginTimer(500, KONTROL1.disableloopin, true); } else {//button was released KONTROL1.loopinbuttonDown=false; if (KONTROL1.doloopin===true) {engine.setValue(group, "loop_in", 1);engine.setValue(group, "loop_in", 0);}; @@ -900,7 +900,7 @@ KONTROL1.loopOut = function loopOut(value, deck) { if (value>0){//button was pressed KONTROL1.loopoutbuttonDown=true; KONTROL1.doloopout=true; - KONTROL1.loopoutbuttonTimer = engine.beginTimer(500, "KONTROL1.disableloopout()", true); + KONTROL1.loopoutbuttonTimer = engine.beginTimer(500, KONTROL1.disableloopout, true); } else {//button was released KONTROL1.loopoutbuttonDown=false; if (KONTROL1.doloopout===true) {engine.setValue(group, "loop_out", 1);}; @@ -1307,7 +1307,7 @@ KONTROL1.test = function test(channel, control, value, status, group) { }; - //KONTROL1.ledTimer = engine.beginTimer(250, "KONTROL1.testflash()"); + //KONTROL1.ledTimer = engine.beginTimer(250, KONTROL1.testflash); //midi.sendShortMsg(status, ctrl, state); //engine.stopTimer(KONTROL1.ledTimer); diff --git a/res/controllers/DJ-Tech-i-Mix-Reload-scripts.js b/res/controllers/DJ-Tech-i-Mix-Reload-scripts.js index 4cf1dbf5f9f..841cb848956 100644 --- a/res/controllers/DJ-Tech-i-Mix-Reload-scripts.js +++ b/res/controllers/DJ-Tech-i-Mix-Reload-scripts.js @@ -84,7 +84,7 @@ DJTechiMixReload.init = function(ID) DJTechiMixReload.setbutton["[Channel2]"] = false; DJTechiMixReload.allleadson(); - engine.beginTimer(4000,"DJTechiMixReload.allleadsoff()",true); + engine.beginTimer(4000, DJTechiMixReload.allleadsoff, true); for(var deck = 1; deck <= 2; deck++){ engine.connectControl("[Channel" + deck + "]","play","DJTechiMixReload.deck" + deck + "play"); engine.connectControl("[Channel" + deck + "]","cue_default","DJTechiMixReload.deck" + deck + "cue"); diff --git a/res/controllers/Denon-DN-SC2000.midi.js b/res/controllers/Denon-DN-SC2000.midi.js index f2cef7139f1..b40ac264db2 100644 --- a/res/controllers/Denon-DN-SC2000.midi.js +++ b/res/controllers/Denon-DN-SC2000.midi.js @@ -60,7 +60,7 @@ DenonDNSC2000.newValue = function(currentVal,min,max,increment,ticksCount) { DenonDNSC2000.flanger = function (midino, control, value, status, group) { DenonDNSC2000.toggleBinaryValue(group,'flanger'); - engine.beginTimer(100, 'DenonDNSC2000.handleFlangerLed("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleFlangerLed(group); }, true); } DenonDNSC2000.changeDepth = function (midino, control, value, status, group) { @@ -100,7 +100,7 @@ DenonDNSC2000.loadSelectedTrack = function (midino, control, value, status, grou } else { engine.setValue(group, 'LoadSelectedTrack', 1); - engine.beginTimer(1500, 'DenonDNSC2000.handleLeds("'+group+'")', true); + engine.beginTimer(1500, function() { DenonDNSC2000.handleLeds(group); }, true); } } @@ -170,7 +170,7 @@ DenonDNSC2000.hotcue = function(cueIndex, group, value, shift) { else engine.setValue(group, 'hotcue_' + cueIndex + '_clear',1); } - engine.beginTimer(100, 'DenonDNSC2000.handleLoopAndHotcuesLeds("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleLoopAndHotcuesLeds(group); }, true); } DenonDNSC2000.loopIn = function(group, value, shift) { @@ -179,7 +179,7 @@ DenonDNSC2000.loopIn = function(group, value, shift) { } else engine.setValue(group, 'loop_in', 1); - engine.beginTimer(100, 'DenonDNSC2000.handleLoopAndHotcuesLeds("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleLoopAndHotcuesLeds(group); }, true); } DenonDNSC2000.loopOut = function(group, value, shift) { @@ -190,7 +190,7 @@ DenonDNSC2000.loopOut = function(group, value, shift) { } else engine.setValue(group, 'loop_out', 1); - engine.beginTimer(100, 'DenonDNSC2000.handleLoopAndHotcuesLeds("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleLoopAndHotcuesLeds(group); }, true); } DenonDNSC2000.reloop = function(group, value, shift) { @@ -221,7 +221,7 @@ DenonDNSC2000.reloop = function(group, value, shift) { engine.setValue(group, 'reloop_exit', 1); } } - engine.beginTimer(100, 'DenonDNSC2000.handleLoopAndHotcuesLeds("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleLoopAndHotcuesLeds(group); }, true); } DenonDNSC2000.resizeLoop = function(midino, control, value, status, group) { @@ -267,7 +267,7 @@ DenonDNSC2000.resizeLoop = function(midino, control, value, status, group) { newLoopOutPosition = Math.max(0,newLoopOutPosition - newLoopOutPosition % 2); engine.setValue(group, 'loop_end_position', newLoopOutPosition); } - engine.beginTimer(100, 'DenonDNSC2000.handleLoopAndHotcuesLeds("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleLoopAndHotcuesLeds(group); }, true); } DenonDNSC2000.moveLoopLeft = function(midino, control, value, status, group) { @@ -311,7 +311,7 @@ DenonDNSC2000.play = function (midino, control, value, status, group) { DenonDNSC2000.toggleBinaryValue(group,'play'); } } - engine.beginTimer(100, 'DenonDNSC2000.handlePlayLed("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handlePlayLed(group); }, true); } DenonDNSC2000.cue = function (midino, control, value, status, group) { @@ -330,14 +330,14 @@ DenonDNSC2000.cue = function (midino, control, value, status, group) { DenonDNSC2000.keyLock = function (midino, control, value, status, group) { if ((status & 0xF0) == 0x90) { DenonDNSC2000.toggleBinaryValue(group,'keylock'); - engine.beginTimer(100, 'DenonDNSC2000.handleKeyLockLed("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleKeyLockLed(group); }, true); } } DenonDNSC2000.beatSync = function (midino, control, value, status, group) { if ((status & 0xF0) == 0x90) { DenonDNSC2000.toggleBinaryValue(group,'beatsync'); - engine.beginTimer(100, 'DenonDNSC2000.handleBeatSyncLed("'+group+'")', true); + engine.beginTimer(100, function() { DenonDNSC2000.handleBeatSyncLed(group); }, true); } } diff --git a/res/controllers/Electrix-Tweaker-scripts.js b/res/controllers/Electrix-Tweaker-scripts.js index 985784a00fc..17679e6ce0a 100644 --- a/res/controllers/Electrix-Tweaker-scripts.js +++ b/res/controllers/Electrix-Tweaker-scripts.js @@ -514,8 +514,7 @@ ElectrixTweaker.arrowSide = function(channel, control, value, status, group) { group = ElectrixTweaker.deck[group]; if (value) { if (ElectrixTweaker.topShift) { - engine.setValue(group, "eject", 1); - engine.beginTimer(250, "engine.setValue(\""+group+"\", \"eject\", 0)", true); + script.triggerControl(group, "eject", 250); } else { engine.setValue(group, "LoadSelectedTrack", 1); } @@ -553,8 +552,7 @@ ElectrixTweaker.oneShot = function(channel, control, value, status, group) { engine.setValue(group, "sync_enabled", 0); engine.setValue(group, "repeat", 0); engine.setValue(group, "play", 0); - engine.setValue(group, "eject", 1); - engine.beginTimer(250, "engine.setValue(\""+group+"\", \"eject\", 0)", true); + script.triggerControl(group, "eject", 250); }, true); } else { if (ElectrixTweaker.samplerVelocityAsVolume) { engine.setValue(group, "volume", script.absoluteNonLin(value * ElectrixTweaker.samplerSensitivity, 0, .25, 1)); @@ -696,7 +694,7 @@ ElectrixTweaker.midEncoder = function(channel, control, value, status, group) { engine.setValue(group, "beatjump_32_forward", 1); midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[group].Mid.ring, 127); } - ElectrixTweaker.midEncoderLEDTimer[group] = engine.beginTimer(1000, "midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[\""+group+"\"][\"Mid\"][\"ring\"], 64)", true); + ElectrixTweaker.midEncoderLEDTimer[group] = engine.beginTimer(1000, function() { midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[group][\"Mid\"][\"ring\"], 64); }, true); } else { switch (ElectrixTweaker.mode[group]) { case "eq": @@ -712,7 +710,7 @@ ElectrixTweaker.midEncoder = function(channel, control, value, status, group) { engine.setValue(group, "loop_move_" + ElectrixTweaker.loopMoveSize[group] + "_forward", 1); midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[group].Mid.ring, 127); } - ElectrixTweaker.midEncoderLEDTimer[group] = engine.beginTimer(1000, "midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[\""+group+"\"][\"Mid\"][\"ring\"], 64)", true); + ElectrixTweaker.midEncoderLEDTimer[group] = engine.beginTimer(1000, function() { midi.sendShortMsg(0xB0, ElectrixTweaker.encoders[group][\"Mid\"][\"ring\"], 64); }, true); break; } } diff --git a/res/controllers/Gemini-FirstMix-scripts.js b/res/controllers/Gemini-FirstMix-scripts.js index a2570cedbb8..943c167800e 100644 --- a/res/controllers/Gemini-FirstMix-scripts.js +++ b/res/controllers/Gemini-FirstMix-scripts.js @@ -168,7 +168,7 @@ firstmix.preview = function (channel, control, value, status, group) { engine.setValue("[Sampler4]", "volume", 0); engine.setValue("[Sampler4]", "pfl", 1); engine.setValue("[Sampler4]", "LoadSelectedTrack", 1); - engine.beginTimer(250,"engine.setValue(\"[Sampler4]\", \"play\", 1)",true); // I had to add a delay because this wouldn't work otherwise + engine.beginTimer(250, function() { engine.setValue("[Sampler4]", "play", 1); }, true); // I had to add a delay because this wouldn't work otherwise firstmix.setLED(firstmix.leds[0]["preview"], 0x7f); firstmix.previewButton = true; } diff --git a/res/controllers/Hercules DJ Control MP3 e2-scripts.js b/res/controllers/Hercules DJ Control MP3 e2-scripts.js index 40c4052b30d..cb5edaf53dc 100644 --- a/res/controllers/Hercules DJ Control MP3 e2-scripts.js +++ b/res/controllers/Hercules DJ Control MP3 e2-scripts.js @@ -352,7 +352,7 @@ HerculesMP3e2.holdButton = function (group, value, first, second) { if (value) { engine.setValue(group, first, 1); // Set "On" the first function - holdTimerID = engine.beginTimer(2000, "HerculesMP3e2.holdTimer(\""+group+"\", \""+first+"\", \""+second+"\")", true); + holdTimerID = engine.beginTimer(2000, function() { HerculesMP3e2.holdTimer(group, first, second); }, true); } else { if (holdButtonFlag) { @@ -606,7 +606,7 @@ HerculesMP3e2.scratch = function(midino, control, value, status, group) { if (scratchMode === 0) { // Enable the scratch mode on the corresponding deck and start the timer scratchMode = 1; - scratchTimer = engine.beginTimer(scratchResetTime, "HerculesMP3e2.wheelOnOff()"); + scratchTimer = engine.beginTimer(scratchResetTime, HerculesMP3e2.wheelOnOff); midi.sendShortMsg(0x90, 45, 0x7F); // Switch-on the Scratch led engine.setValue("[Channel1]", "keylock", 0); engine.setValue("[Channel2]", "keylock", 0); diff --git a/res/controllers/Hercules-DJ-Console-Mk1-hid-scripts.js b/res/controllers/Hercules-DJ-Console-Mk1-hid-scripts.js index 6ac1d587f77..9739a1295fe 100644 --- a/res/controllers/Hercules-DJ-Console-Mk1-hid-scripts.js +++ b/res/controllers/Hercules-DJ-Console-Mk1-hid-scripts.js @@ -318,7 +318,7 @@ HerculesMk1Hid.scroll_tracks = function(g, e, v) { if (v > 0) { engine.setValue("[Playlist]", e == "track_next_a" ? "SelectNextTrack" : "SelectPrevTrack", 1); if (!HerculesMk1Hid.scroll_timer) { - HerculesMk1Hid.scroll_timer = engine.beginTimer(150, 'HerculesMk1Hid.scroll_tracks("[Playlist]","' + e + '",' + v + ')'); + HerculesMk1Hid.scroll_timer = engine.beginTimer(150, function() { HerculesMk1Hid.scroll_tracks("[Playlist]","' + e + '",' + v + '); }); } } else { diff --git a/res/controllers/Hercules-DJ-Console-Mk2-hid-scripts.js b/res/controllers/Hercules-DJ-Console-Mk2-hid-scripts.js index ed71a388c81..00755710a59 100644 --- a/res/controllers/Hercules-DJ-Console-Mk2-hid-scripts.js +++ b/res/controllers/Hercules-DJ-Console-Mk2-hid-scripts.js @@ -301,7 +301,7 @@ HerculesMk2Hid.scroll_tracks = function(g, e, v) { if (v > 0) { engine.setValue("[Playlist]", e == "track_next_a" ? "SelectNextTrack" : "SelectPrevTrack", 1); if (!HerculesMk2Hid.scroll_timer) { - HerculesMk2Hid.scroll_timer = engine.beginTimer(150, 'HerculesMk2Hid.scroll_tracks("[Playlist]","' + e + '",' + v + ')'); + HerculesMk2Hid.scroll_timer = engine.beginTimer(150, function() { HerculesMk2Hid.scroll_tracks("[Playlist]","' + e + '",' + v + '); }); } } else { diff --git a/res/controllers/Hercules-DJ-Console-RMX-scripts.js b/res/controllers/Hercules-DJ-Console-RMX-scripts.js index 13d5ccbd970..8a1d663bd18 100644 --- a/res/controllers/Hercules-DJ-Console-RMX-scripts.js +++ b/res/controllers/Hercules-DJ-Console-RMX-scripts.js @@ -40,9 +40,9 @@ HerculesRMX.Button.prototype.setLed = function(ledState, blink) { midi.sendShortMsg(0xB0,this.controlId,LedState.off); } if(blink) { - engine.beginTimer(20, "midi.sendShortMsg(0xB0," + (this.controlId + 0x30) + ", " + LedState.on + ")", true); + engine.beginTimer(20, function() { midi.sendShortMsg(0xB0,(this.controlId + 0x30), LedState.on); }, true); } else { - engine.beginTimer(20, "midi.sendShortMsg(0xB0," + (this.controlId + 0x30) + ", " + LedState.off + ")", true); + engine.beginTimer(20, function() { midi.sendShortMsg(0xB0,(this.controlId + 0x30), LedState.off); }, true); } }; @@ -158,7 +158,7 @@ HerculesRMX.Deck.prototype.jogMove = function(jogValue) { engine.stopTimer(this.scratchTimer); } engine.scratchTick(this.deckNumber, jogValue); - this.scratchTimer = engine.beginTimer(20, "HerculesRMX.GetDeck('" + this.group + "').stopScratching()", true); + this.scratchTimer = engine.beginTimer(20, function() { HerculesRMX.GetDeck(this.group).stopScratching(); }, true); } else { engine.setValue(this.group,"jog", jogValue); } @@ -859,11 +859,11 @@ HerculesRMX.killLeds = function() { var button; var time = 20; for (var key in HerculesRMX.Decks.Left.Buttons) { - engine.beginTimer(time, "HerculesRMX.Decks.Left.Buttons['" + key + "'].setLed(LedState.off)", true); + engine.beginTimer(time, function() { HerculesRMX.Decks.Left.Buttons[key].setLed(LedState.off); }, true); time = time + 5; } for (var key in HerculesRMX.Decks.Right.Buttons) { - engine.beginTimer(time, "HerculesRMX.Decks.Right.Buttons['" + key + "'].setLed(LedState.off)", true); + engine.beginTimer(time, function() { HerculesRMX.Decks.Right.Buttons[key].setLed(LedState.off); }, true); time = time + 5; } } @@ -875,11 +875,11 @@ HerculesRMX.rateChange = function (value, group) { HerculesRMX.Decks.Left.Buttons.Sync.setLed(LedState.off); } if (HerculesRMX.Decks.Right.Buttons.Sync.state != ButtonState.pressed) { - engine.beginTimer(25, "HerculesRMX.Decks.Right.Buttons.Sync.setLed(LedState.off)", true); + engine.beginTimer(25, function() { HerculesRMX.Decks.Right.Buttons.Sync.setLed(LedState.off); }, true); } if (value != 0.0) { var deck = HerculesRMX.GetDeck(group); - engine.beginTimer(30, "HerculesRMX.GetDeck('" + group + "').Buttons.PitchReset.setLed(LedState.off)", true); + engine.beginTimer(30, function() { HerculesRMX.GetDeck(group).Buttons.PitchReset.setLed(LedState.off); }, true); } }; diff --git a/res/controllers/Hercules-DJ-Control-MP3-scripts.js b/res/controllers/Hercules-DJ-Control-MP3-scripts.js index c03c319a614..7493b415fb9 100644 --- a/res/controllers/Hercules-DJ-Control-MP3-scripts.js +++ b/res/controllers/Hercules-DJ-Control-MP3-scripts.js @@ -123,13 +123,13 @@ HerculesMp3.init = function (id) { // called when the device is opened & set up // a timer and a buffer will rectify this. // Setting it to 20ms instead of 11ms as this first is the lowest value accepted for a timer. - engine.beginTimer(20, "HerculesMp3.ledhelper()"); + engine.beginTimer(20, HerculesMp3.ledhelper); // Be the leds! HerculesMp3.leds(true); - engine.beginTimer(500, "HerculesMp3.leds(false)",true); + engine.beginTimer(500, function() { HerculesMp3.leds(false); },true); // Connect leds here and not in xml. This is to avoid an annoying bug (maybe) in controller drivers. @@ -193,7 +193,7 @@ HerculesMp3.leds = function (onoff) { HerculesMp3.ledblink = function (control,onoff){ if(onoff) { actual_status = HerculesMp3.controls.outputs[control].status; - blinktimer[control] = engine.beginTimer(300,"HerculesMp3.ledblinkhelper("+control+")"); + blinktimer[control] = engine.beginTimer(300, function() { HerculesMp3.ledblinkhelper(control); }); HerculesMp3.controls.outputs[control].isblinking = true; } else @@ -287,7 +287,7 @@ HerculesMp3.loophold = function (deck) { HerculesMp3.loop = function (deck, control, value) { if(value) { is_hold_loop[deck] = false; - timerloopID[deck] = engine.beginTimer(700,"HerculesMp3.loophold("+deck+")",true); + timerloopID[deck] = engine.beginTimer(700, function() { HerculesMp3.loophold(deck); }, true); } else { engine.stopTimer(timerloopID[deck]); @@ -329,7 +329,7 @@ HerculesMp3.hotcue = function (deck, control, value) { hotcue_string = HerculesMp3.fxbutton(HerculesMp3.controls.inputs[control].name); if(value){ is_hold_hotcue[control] = false; - timerhotcueID[control] = engine.beginTimer(500,"HerculesMp3.hchold("+deck+","+control+","+"\""+hotcue_string+"\")",true); + timerhotcueID[control] = engine.beginTimer(500, function() { HerculesMp3.hchold(deck, control, hotcue_string); }, true); } else { engine.stopTimer(timerhotcueID[control]); @@ -556,7 +556,7 @@ HerculesMp3.jog_wheel = function (group, control, value, status) { if(engine.getValue(Deck[n],"scratch2_enable")) { //when not moved for 200 msecs, probably we are not touching the wheel anymore - scratch_timer[n] = engine.beginTimer(200,"HerculesMp3.jog_wheelhelper("+n+")",true); + scratch_timer[n] = engine.beginTimer(200, function() { HerculesMp3.jog_wheelhelper(n); }, true); scratch_timer_on[n] = true; } } diff --git a/res/controllers/Hercules-DJ-Control-Steel-scripts.js b/res/controllers/Hercules-DJ-Control-Steel-scripts.js index e9691f32073..6c7c0a721c4 100644 --- a/res/controllers/Hercules-DJ-Control-Steel-scripts.js +++ b/res/controllers/Hercules-DJ-Control-Steel-scripts.js @@ -64,16 +64,16 @@ HerculesSteel.Button = function (controlId, blinkId) { HerculesSteel.Button.prototype.setLed = function(lightState) { if(lightState == HerculesSteel.LedState.on) { - engine.beginTimer(20, "midi.sendShortMsg(0xB0," + (this.controlId) + ", " + HerculesSteel.LedState.on + ")", true); + engine.beginTimer(20, function() { midi.sendShortMsg(0xB0,(this.controlId), HerculesSteel.LedState.on); }, true); } else if(lightState == HerculesSteel.LedState.blink) { - engine.beginTimer(20, "midi.sendShortMsg(0xB0," + (this.controlId + 0x30) + ", " + HerculesSteel.LedState.on + ")", true); + engine.beginTimer(20, function() { midi.sendShortMsg(0xB0,(this.controlId + 0x30), HerculesSteel.LedState.on); }, true); } else { - engine.beginTimer(20, "midi.sendShortMsg(0xB0," + (this.controlId) + ", " + HerculesSteel.LedState.off + ")", true); - engine.beginTimer(40, "midi.sendShortMsg(0xB0," + (this.controlId + 0x30) + ", " + HerculesSteel.LedState.off + ")", true); + engine.beginTimer(20, function() { midi.sendShortMsg(0xB0,(this.controlId), HerculesSteel.LedState.off); }, true); + engine.beginTimer(40, function() { midi.sendShortMsg(0xB0,(this.controlId + 0x30), HerculesSteel.LedState.off); }, true); } }; @@ -235,7 +235,7 @@ HerculesSteel.Deck.prototype.jogMove = function(jogValue) { engine.stopTimer(this.scratchTimer); } engine.scratchTick(this.deckNumber, jogValue); - this.scratchTimer = engine.beginTimer(20, "HerculesSteel.GetDeck('" + this.group + "').stopScratching()", true); + this.scratchTimer = engine.beginTimer(20, function() { HerculesSteel.GetDeck(this.group).stopScratching(); }, true); } else { engine.setValue(this.group,"jog", jogValue); } @@ -973,7 +973,7 @@ HerculesSteel.LedsON = function() { { //TODO: remove timers when alsa midi work properly. //midi.sendShortMsg(0xB0, i, 0x7F); - engine.beginTimer(time, "midi.sendShortMsg(0xB0, '" + i + "', 0x7F);", true); + engine.beginTimer(time, function() { midi.sendShortMsg(0xB0, i, 0x7F); }, true); time = time + 5; } @@ -985,7 +985,7 @@ HerculesSteel.LedsON = function() { { //TODO: remove timers when alsa midi work properly. //midi.sendShortMsg(0xB0, i, 0x7F); - engine.beginTimer(time, "midi.sendShortMsg(0xB0, '" + i + "', 0x7F);", true); + engine.beginTimer(time, function() { midi.sendShortMsg(0xB0, i, 0x7F); }, true); time = time + 5; } // Some buttons stays OFF : rewind A/B, forward A/B, Load Deck A, Load Deck B, Up, Down, Apply Ctrl. on @@ -998,12 +998,12 @@ HerculesSteel.LedsOFF = function() { var time = 20; print("switch off Left deck LEDs"); for (var key in HerculesSteel.Decks.Left.Buttons) { - engine.beginTimer(time, "HerculesSteel.Decks.Left.Buttons['" + key + "'].setLed(HerculesSteel.LedState.off)", true); + engine.beginTimer(time, function() { HerculesSteel.Decks.Left.Buttons[key].setLed(HerculesSteel.LedState.off); }, true); time = time + 5; } print("switch off Right deck LEDs"); for (var key in HerculesSteel.Decks.Right.Buttons) { - engine.beginTimer(time, "HerculesSteel.Decks.Right.Buttons['" + key + "'].setLed(HerculesSteel.LedState.off)", true); + engine.beginTimer(time, function() { HerculesSteel.Decks.Right.Buttons[key].setLed(HerculesSteel.LedState.off); }, true); time = time + 5; } } @@ -1015,10 +1015,10 @@ HerculesSteel.rateChange = function (value, group) { HerculesSteel.Decks.Left.Buttons.Sync.setLed(HerculesSteel.LedState.off); } if (HerculesSteel.Decks.Right.Buttons.Sync.state != HerculesSteel.ButtonState.pressed) { - engine.beginTimer(25, "HerculesSteel.Decks.Right.Buttons.Sync.setLed(HerculesSteel.LedState.off)", true); + engine.beginTimer(25, function() { HerculesSteel.Decks.Right.Buttons.Sync.setLed(HerculesSteel.LedState.off); }, true); } if (value != 0.0) { var deck = HerculesSteel.GetDeck(group); - engine.beginTimer(30, "HerculesSteel.GetDeck('" + group + "').Buttons.PitchReset.setLed(HerculesSteel.LedState.off)", true); + engine.beginTimer(30, function() { HerculesSteel.GetDeck(group).Buttons.PitchReset.setLed(HerculesSteel.LedState.off); }, true); } }; diff --git a/res/controllers/Hercules-DJControl-Compact-scripts.js b/res/controllers/Hercules-DJControl-Compact-scripts.js index e5e57090120..bc4553edfb7 100644 --- a/res/controllers/Hercules-DJControl-Compact-scripts.js +++ b/res/controllers/Hercules-DJControl-Compact-scripts.js @@ -67,7 +67,7 @@ HercDJCompact.jog_wheel = function (group, control, value, status) { if(engine.getValue(input.group, "scratch2_enable")) { //when not moved for 200 msecs, probably we are not touching the wheel anymore scratch_timer[input.channel] = - engine.beginTimer(200, "HercDJCompact.jog_wheelhelper("+input.channel+")", true); + engine.beginTimer(200, function() { HercDJCompact.jog_wheelhelper(input.channel); }, true); scratch_timer_on[input.channel] = true; } } else { diff --git a/res/controllers/Ion-Discover-DJ-Pro-scripts.js b/res/controllers/Ion-Discover-DJ-Pro-scripts.js index 211d6848a5f..691845aa8d6 100644 --- a/res/controllers/Ion-Discover-DJ-Pro-scripts.js +++ b/res/controllers/Ion-Discover-DJ-Pro-scripts.js @@ -181,7 +181,7 @@ IonDiscoverDjPro.jogWheel = function(channel, control, value, status, group) { engine.stopTimer(IonDiscoverDjPro.scratchTimer[deck]); } engine.scratchTick(deck, adjustedJog); - IonDiscoverDjPro.scratchTimer[deck] = engine.beginTimer(20, "IonDiscoverDjPro.jogWheelStopScratch(" + deck + ")", true); + IonDiscoverDjPro.scratchTimer[deck] = engine.beginTimer(20, function() { IonDiscoverDjPro.jogWheelStopScratch(deck); }, true); } else { var gammaInputRange = 23; // Max jog speed var maxOutFraction = 0.5; // Where on the curve it should peak; 0.5 is half-way diff --git a/res/controllers/Ion-Discover-DJ-scripts.js b/res/controllers/Ion-Discover-DJ-scripts.js index f1cb4eef136..d42bfeb4b9f 100644 --- a/res/controllers/Ion-Discover-DJ-scripts.js +++ b/res/controllers/Ion-Discover-DJ-scripts.js @@ -52,7 +52,7 @@ IonDiscoverDJ.sendMidi = function(status, control, value, timeToWait) { if(timeToWait == 0) { midi.sendShortMsg(status, control, value); } else { - engine.beginTimer(timeToWait, "midi.sendShortMsg(" + status + ", " + control + ", " + value + ")", true); + engine.beginTimer(timeToWait, function() { midi.sendShortMsg(status, control, value); }, true); } }; diff --git a/res/controllers/Korg-nanoKONTROL-2-scripts.js b/res/controllers/Korg-nanoKONTROL-2-scripts.js index 192e6b4502e..9494886c3d3 100644 --- a/res/controllers/Korg-nanoKONTROL-2-scripts.js +++ b/res/controllers/Korg-nanoKONTROL-2-scripts.js @@ -92,7 +92,7 @@ NK2.bankSelect = function bankSelect(deck, bank) { }else if (NK2.curNSMR=="R"){ NK2.LEDBankIndicator=NK2.Rbutton[NK2.curDeck]; } - if (NK2.LEDflasheson===true){engine.stopTimer(NK2.LEDtimer);NK2.LEDtimer=engine.beginTimer(750, "NK2.indicatorLEDs()");}//start timer for LED indicator flasher + if (NK2.LEDflasheson===true){engine.stopTimer(NK2.LEDtimer);NK2.LEDtimer=engine.beginTimer(750, NK2.indicatorLEDs);}//start timer for LED indicator flasher NK2.updateLEDs(); }; @@ -288,7 +288,7 @@ NK2.indicatorLEDs = function indicatorLEDs(value,group,control){ NK2.flashon=0; NK2.flashcount=0; - NK2.flashTimer=engine.beginTimer(100, "NK2.flashIndicators()"); + NK2.flashTimer=engine.beginTimer(100, NK2.flashIndicators); return true; }; @@ -596,7 +596,7 @@ NK2.cueClear = function cueClear(cue, control){//clear hotcue - OR move hotcue t if(engine.getValue(NK2.Deck[NK2.curDeck], "hotcue_"+cue+"_enabled")!=true){//hotcue not set - prepare to move next hotcue pressed to this button NK2.cueMoveToNum=cue; engine.stopTimer(NK2.cueMoveIndicator); - NK2.cueMoveIndicator=engine.beginTimer(100, "NK2.cueMoveIndicatorLEDs("+control+")");//start timer for LED indicator flasher showing the button we're moving to + NK2.cueMoveIndicator=engine.beginTimer(100, function() { NK2.cueMoveIndicatorLEDs(control); });//start timer for LED indicator flasher showing the button we're moving to return true; } @@ -705,7 +705,7 @@ NK2.reloopButton = function reloopButton(value) { engine.stopTimer(NK2.reloopTimer); NK2.loopbuttonDown=true; NK2.doreloop=true; - NK2.reloopTimer = engine.beginTimer(500, "NK2.disablereloop()", true); + NK2.reloopTimer = engine.beginTimer(500, NK2.disablereloop, true); } else {//button was released NK2.loopbuttonDown=false; if (NK2.doreloop===true) {engine.setValue(NK2.Deck[NK2.curDeck], "reloop_exit", 1);engine.setValue(NK2.Deck[NK2.curDeck], "reloop_exit", 0);}; @@ -723,7 +723,7 @@ NK2.loopin = function loopin(value) { engine.stopTimer(NK2.loopinTimer); NK2.loopinbuttonDown=true; NK2.doloopin=true; - NK2.loopinTimer = engine.beginTimer(500, "NK2.disableloopin()", true); + NK2.loopinTimer = engine.beginTimer(500, NK2.disableloopin, true); } else {//button was released NK2.loopinbuttonDown=false; if (NK2.doloopin===true) {engine.setValue(NK2.Deck[NK2.curDeck], "loop_in", 1);engine.setValue(NK2.Deck[NK2.curDeck], "loop_in", 0);}; @@ -741,7 +741,7 @@ NK2.loopout = function loopout(value) { engine.stopTimer(NK2.loopoutTimer); NK2.loopoutbuttonDown=true; NK2.doloopout=true; - NK2.loopoutTimer = engine.beginTimer(500, "NK2.disableloopout()", true); + NK2.loopoutTimer = engine.beginTimer(500, NK2.disableloopout, true); } else {//button was released NK2.loopoutbuttonDown=false; if (NK2.doloopout===true) {engine.setValue(NK2.Deck[NK2.curDeck], "loop_out", 1);engine.setValue(NK2.Deck[NK2.curDeck], "loop_out", 0);}; @@ -874,7 +874,7 @@ NK2.testleds=function testleds(){//sends LED on messages to all if (NK2.testLED>=127){return false; } NK2.testLED++ midi.sendShortMsg(0xB0, NK2.testLED, 0x7F); - NK2.LEDtimer=engine.beginTimer(100, "NK2.testleds()", true); + NK2.LEDtimer=engine.beginTimer(100, NK2.testleds, true); } //############################################################################ diff --git a/res/controllers/Korg-nanoPAD2-scripts.js b/res/controllers/Korg-nanoPAD2-scripts.js index 1032728321a..61c6757698f 100644 --- a/res/controllers/Korg-nanoPAD2-scripts.js +++ b/res/controllers/Korg-nanoPAD2-scripts.js @@ -130,7 +130,7 @@ NANOPAD2RK.reloopButton = function (channel, control, value, status, group) { NANOPAD2RK.loopbuttonDown=true; NANOPAD2RK.doreloop=true; - NANOPAD2RK.reloopTimer = engine.beginTimer(500, "NANOPAD2RK.disablereloop()", true); + NANOPAD2RK.reloopTimer = engine.beginTimer(500, NANOPAD2RK.disablereloop, true); }; NANOPAD2RK.reloopButtonRelease = function (channel, control, value, status, group) {//button was released diff --git a/res/controllers/Numark-Mixtrack-2-scripts.js b/res/controllers/Numark-Mixtrack-2-scripts.js index df15f6044c7..74bdc3b5c6f 100644 --- a/res/controllers/Numark-Mixtrack-2-scripts.js +++ b/res/controllers/Numark-Mixtrack-2-scripts.js @@ -179,14 +179,14 @@ NumarkMixTrackII.jogWheel = function(channel, control, value, status, group) { if (NumarkMixTrackII.scratch_timer[deck - 1] != -1) { engine.stopTimer(NumarkMixTrackII.scratch_timer[deck - 1]); } - NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, "NumarkMixTrackII.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, function() { NumarkMixTrackII.jogWheelStopScratch(deck); }, true); } } else { if (!NumarkMixTrackII.touch[deck - 1]) { if (NumarkMixTrackII.scratch_timer[deck - 1] != -1) { engine.stopTimer(NumarkMixTrackII.scratch_timer[deck - 1]); } - NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, "NumarkMixTrackII.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, function() { NumarkMixTrackII.jogWheelStopScratch(deck); }, true); } } @@ -221,7 +221,7 @@ NumarkMixTrackII.wheelTouch = function(channel, control, value, status, group){ engine.stopTimer(NumarkMixTrackII.scratch_timer[deck - 1]); } - NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, "NumarkMixTrackII.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackII.scratch_timer[deck - 1] = engine.beginTimer(20, function() { NumarkMixTrackII.jogWheelStopScratch(deck); }, true); } else { if (!NumarkMixTrackII.scratch_mode[deck - 1] && engine.getValue(group, "play")) { return; diff --git a/res/controllers/Numark-Mixtrack-Pro-scripts.js b/res/controllers/Numark-Mixtrack-Pro-scripts.js index d1d7df6307c..01be020dfe3 100644 --- a/res/controllers/Numark-Mixtrack-Pro-scripts.js +++ b/res/controllers/Numark-Mixtrack-Pro-scripts.js @@ -441,7 +441,7 @@ NumarkMixTrackPro.repositionHack = function(group, oldPosition){ // see if the value has been updated if (engine.getValue(group, "loop_start_position")==oldPosition){ if (NumarkMixTrackPro.hackCount[group]++ < 9){ - engine.beginTimer(20, "NumarkMixTrackPro.repositionHack('" + group + "', " + oldPosition + ")", true); + engine.beginTimer(20, function() { NumarkMixTrackPro.repositionHack(group, oldPosition); }, true); } else { var deck = NumarkMixTrackPro.groupToDeck(group); NumarkMixTrackPro.flashLED(NumarkMixTrackPro.leds[deck]["loop_start_position"], 4); @@ -589,7 +589,7 @@ NumarkMixTrackPro.jogWheel = function(channel, control, value, status, group) { if (NumarkMixTrackPro.scratchMode[deck-1] && posNeg == -1 && !NumarkMixTrackPro.touch[deck-1]) { if (NumarkMixTrackPro.scratchTimer[deck-1] != -1) engine.stopTimer(NumarkMixTrackPro.scratchTimer[deck-1]); - NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, "NumarkMixTrackPro.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, function() { NumarkMixTrackPro.jogWheelStopScratch(deck); }, true); } } else { // stop scratching @@ -597,7 +597,7 @@ NumarkMixTrackPro.jogWheel = function(channel, control, value, status, group) { if (!NumarkMixTrackPro.touch[deck-1]){ if (NumarkMixTrackPro.scratchTimer[deck-1] != -1) engine.stopTimer(NumarkMixTrackPro.scratchTimer[deck-1]); - NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, "NumarkMixTrackPro.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, function() { NumarkMixTrackPro.jogWheelStopScratch(deck); }, true); } } @@ -635,7 +635,7 @@ NumarkMixTrackPro.wheelTouch = function(channel, control, value, status, group){ if (NumarkMixTrackPro.scratchTimer[deck-1] != -1) engine.stopTimer(NumarkMixTrackPro.scratchTimer[deck-1]); - NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, "NumarkMixTrackPro.jogWheelStopScratch(" + deck + ")", true); + NumarkMixTrackPro.scratchTimer[deck-1] = engine.beginTimer(20, function() { NumarkMixTrackPro.jogWheelStopScratch(deck); }, true); } else { diff --git a/res/controllers/Numark-Omni-Control-scripts.js b/res/controllers/Numark-Omni-Control-scripts.js index 556069a4bf1..281e58629eb 100644 --- a/res/controllers/Numark-Omni-Control-scripts.js +++ b/res/controllers/Numark-Omni-Control-scripts.js @@ -127,7 +127,7 @@ NumarkTotalControl.loopOut = function(channel, control, value, status, group) { // Get current position by temporary setting loop start NumarkTotalControl.oldLoopStart[deck-1] = start; engine.setValue(group, "loop_in", 1); - engine.beginTimer(20, "NumarkTotalControl.loopExtendedAdjustment('" + group + "')", true); + engine.beginTimer(20, function() { NumarkTotalControl.loopExtendedAdjustment(group); }, true); } } else { engine.setValue(group, "loop_out", 1); @@ -144,7 +144,7 @@ NumarkTotalControl.loopExtendedAdjustment = function(group) { var start = engine.getValue(group, "loop_start_position"); if (start == NumarkTotalControl.oldLoopStart[deck-1]) { // Still old loop start -> retry later - engine.beginTimer(20, "NumarkTotalControl.loopExtendedAdjustment('" + group + "')", true); + engine.beginTimer(20, function() { NumarkTotalControl.loopExtendedAdjustment(group); }, true); return; } @@ -208,7 +208,7 @@ NumarkTotalControl.loopExtendedChange = function(group, timerCall) { NumarkTotalControl.extendedLoopingLEDState[deck-1] = engine.getValue(group, "loop_enabled"); // Start LED blink timer NumarkTotalControl.loopLEDBlink(deck); - NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(333, "NumarkTotalControl.loopLEDBlink(" + deck + ")"); + NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(333, function() { NumarkTotalControl.loopLEDBlink(deck); }); } } @@ -260,7 +260,7 @@ NumarkTotalControl.extendedFunctionButton = function(normalFunction, extendedLoo NumarkTotalControl.extendedLoopingChanged[deck-1] = false; NumarkTotalControl.extendedLoopingJogCarryOver[deck-1] = 0; // Start alternative function timer -> activated after button was 500msec pressed or jog wheel movement (see jogWheel function) - NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(500, "NumarkTotalControl.loopExtendedChange('" + group + "', true)", true); + NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(500, function() { NumarkTotalControl.loopExtendedChange(group, true); }, true); } } else { // Check if alternative function wasn't used @@ -307,7 +307,7 @@ NumarkTotalControl.quantizeLED = function(value, group, key) { NumarkTotalControl.setLED(NumarkTotalControl.leds[0]["quantize"], deck1); } else if (NumarkTotalControl.quantizeLEDTimer == -1) { NumarkTotalControl.quantizeLEDBlink(); - NumarkTotalControl.quantizeLEDTimer = engine.beginTimer(333, "NumarkTotalControl.quantizeLEDBlink()"); + NumarkTotalControl.quantizeLEDTimer = engine.beginTimer(333, NumarkTotalControl.quantizeLEDBlink); } } @@ -408,7 +408,7 @@ NumarkTotalControl.jogWheel = function(channel, control, value, status, group) { engine.stopTimer(NumarkTotalControl.scratchTimer[deck-1]); } engine.scratchTick(deck, adjustedJog); - NumarkTotalControl.scratchTimer[deck-1] = engine.beginTimer(20, "NumarkTotalControl.jogWheelStopScratch(" + deck + ")", true); + NumarkTotalControl.scratchTimer[deck-1] = engine.beginTimer(20, function() { NumarkTotalControl.jogWheelStopScratch(deck); }, true); } else { var gammaInputRange = 64; // Max jog speed var maxOutFraction = 0.5; // Where on the curve it should peak; 0.5 is half-way diff --git a/res/controllers/Numark-Total-Control-scripts.js b/res/controllers/Numark-Total-Control-scripts.js index 556069a4bf1..4cbbe48e1b7 100644 --- a/res/controllers/Numark-Total-Control-scripts.js +++ b/res/controllers/Numark-Total-Control-scripts.js @@ -127,7 +127,7 @@ NumarkTotalControl.loopOut = function(channel, control, value, status, group) { // Get current position by temporary setting loop start NumarkTotalControl.oldLoopStart[deck-1] = start; engine.setValue(group, "loop_in", 1); - engine.beginTimer(20, "NumarkTotalControl.loopExtendedAdjustment('" + group + "')", true); + engine.beginTimer(20, function() { NumarkTotalControl.loopExtendedAdjustment(group); }, true); } } else { engine.setValue(group, "loop_out", 1); @@ -144,7 +144,7 @@ NumarkTotalControl.loopExtendedAdjustment = function(group) { var start = engine.getValue(group, "loop_start_position"); if (start == NumarkTotalControl.oldLoopStart[deck-1]) { // Still old loop start -> retry later - engine.beginTimer(20, "NumarkTotalControl.loopExtendedAdjustment('" + group + "')", true); + engine.beginTimer(20, function() { NumarkTotalControl.loopExtendedAdjustment(group); }, true); return; } @@ -208,7 +208,7 @@ NumarkTotalControl.loopExtendedChange = function(group, timerCall) { NumarkTotalControl.extendedLoopingLEDState[deck-1] = engine.getValue(group, "loop_enabled"); // Start LED blink timer NumarkTotalControl.loopLEDBlink(deck); - NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(333, "NumarkTotalControl.loopLEDBlink(" + deck + ")"); + NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(333, function() { NumarkTotalControl.loopLEDBlink(deck); }); } } @@ -260,7 +260,7 @@ NumarkTotalControl.extendedFunctionButton = function(normalFunction, extendedLoo NumarkTotalControl.extendedLoopingChanged[deck-1] = false; NumarkTotalControl.extendedLoopingJogCarryOver[deck-1] = 0; // Start alternative function timer -> activated after button was 500msec pressed or jog wheel movement (see jogWheel function) - NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(500, "NumarkTotalControl.loopExtendedChange('" + group + "', true)", true); + NumarkTotalControl.extendedLoopingLEDTimer[deck-1] = engine.beginTimer(500, function() { NumarkTotalControl.loopExtendedChange('" + group + "', true); }, true); } } else { // Check if alternative function wasn't used @@ -307,7 +307,7 @@ NumarkTotalControl.quantizeLED = function(value, group, key) { NumarkTotalControl.setLED(NumarkTotalControl.leds[0]["quantize"], deck1); } else if (NumarkTotalControl.quantizeLEDTimer == -1) { NumarkTotalControl.quantizeLEDBlink(); - NumarkTotalControl.quantizeLEDTimer = engine.beginTimer(333, "NumarkTotalControl.quantizeLEDBlink()"); + NumarkTotalControl.quantizeLEDTimer = engine.beginTimer(333, NumarkTotalControl.quantizeLEDBlink); } } @@ -408,7 +408,7 @@ NumarkTotalControl.jogWheel = function(channel, control, value, status, group) { engine.stopTimer(NumarkTotalControl.scratchTimer[deck-1]); } engine.scratchTick(deck, adjustedJog); - NumarkTotalControl.scratchTimer[deck-1] = engine.beginTimer(20, "NumarkTotalControl.jogWheelStopScratch(" + deck + ")", true); + NumarkTotalControl.scratchTimer[deck-1] = engine.beginTimer(20, function() { NumarkTotalControl.jogWheelStopScratch(deck); }, true); } else { var gammaInputRange = 64; // Max jog speed var maxOutFraction = 0.5; // Where on the curve it should peak; 0.5 is half-way diff --git a/res/controllers/Numark-V7-scripts.js b/res/controllers/Numark-V7-scripts.js index aaab51bf482..22e27349ba7 100644 --- a/res/controllers/Numark-V7-scripts.js +++ b/res/controllers/Numark-V7-scripts.js @@ -64,7 +64,7 @@ NumarkV7.RPM = 33+1/3; //Motor-Scratch rpm NumarkV7.init = function () { //flash LED's NumarkV7.FlashAllLED(1000); - engine.beginTimer(3500, "NumarkV7.init2()", true); + engine.beginTimer(3500, NumarkV7.init2, true); } NumarkV7.init2 = function () { //Tap Light @@ -176,36 +176,36 @@ NumarkV7.shutdown = function () { NumarkV7.FlashAllLED = function (sustain) { midi.sendShortMsg(0xB0,0x39,0x01); - engine.beginTimer(sustain, "NumarkV7.OffAllLED()", true); - engine.beginTimer(sustain, "NumarkV7.RunLED()", true); + engine.beginTimer(sustain, NumarkV7.OffAllLED, true); + engine.beginTimer(sustain, NumarkV7.RunLED, true); } NumarkV7.OffAllLED = function () { midi.sendShortMsg(0xB0,0x39,0x00); } NumarkV7.RunLED = function () { NumarkV7.RunLED1() - engine.beginTimer(100, "NumarkV7.RunLED2()", true); - engine.beginTimer(200, "NumarkV7.RunLED3()", true); - engine.beginTimer(300, "NumarkV7.RunLED4()", true); - engine.beginTimer(400, "NumarkV7.RunLED5()", true); - engine.beginTimer(500, "NumarkV7.RunLED6()", true); - engine.beginTimer(600, "NumarkV7.RunLED7()", true); - engine.beginTimer(700, "NumarkV7.RunLED8()", true); - engine.beginTimer(800, "NumarkV7.RunLED9()", true); - engine.beginTimer(900, "NumarkV7.RunLED10()", true); - engine.beginTimer(1000, "NumarkV7.RunLED11()", true); - engine.beginTimer(1100, "NumarkV7.RunLED12()", true); - engine.beginTimer(1200, "NumarkV7.RunLED11()", true); - engine.beginTimer(1300, "NumarkV7.RunLED10()", true); - engine.beginTimer(1400, "NumarkV7.RunLED9()", true); - engine.beginTimer(1500, "NumarkV7.RunLED8()", true); - engine.beginTimer(1600, "NumarkV7.RunLED7()", true); - engine.beginTimer(1700, "NumarkV7.RunLED6()", true); - engine.beginTimer(1800, "NumarkV7.RunLED5()", true); - engine.beginTimer(1900, "NumarkV7.RunLED4()", true); - engine.beginTimer(2000, "NumarkV7.RunLED3()", true); - engine.beginTimer(2100, "NumarkV7.RunLED2()", true); - engine.beginTimer(2200, "NumarkV7.RunLED13()", true); + engine.beginTimer(100, NumarkV7.RunLED2, true); + engine.beginTimer(200, NumarkV7.RunLED3, true); + engine.beginTimer(300, NumarkV7.RunLED4, true); + engine.beginTimer(400, NumarkV7.RunLED5, true); + engine.beginTimer(500, NumarkV7.RunLED6, true); + engine.beginTimer(600, NumarkV7.RunLED7, true); + engine.beginTimer(700, NumarkV7.RunLED8, true); + engine.beginTimer(800, NumarkV7.RunLED9, true); + engine.beginTimer(900, NumarkV7.RunLED10, true); + engine.beginTimer(1000, NumarkV7.RunLED11, true); + engine.beginTimer(1100, NumarkV7.RunLED12, true); + engine.beginTimer(1200, NumarkV7.RunLED11, true); + engine.beginTimer(1300, NumarkV7.RunLED10, true); + engine.beginTimer(1400, NumarkV7.RunLED9, true); + engine.beginTimer(1500, NumarkV7.RunLED8, true); + engine.beginTimer(1600, NumarkV7.RunLED7, true); + engine.beginTimer(1700, NumarkV7.RunLED6, true); + engine.beginTimer(1800, NumarkV7.RunLED5, true); + engine.beginTimer(1900, NumarkV7.RunLED4, true); + engine.beginTimer(2000, NumarkV7.RunLED3, true); + engine.beginTimer(2100, NumarkV7.RunLED2, true); + engine.beginTimer(2200, NumarkV7.RunLED13, true); } NumarkV7.RunLED1 = function () { midi.sendShortMsg(0xB0,0x34,0x01); @@ -1030,7 +1030,7 @@ NumarkV7.PitchA = function () { engine.scratchDisable(1, false); NumarkV7.PitchAPause = 2; if (!NumarkV7.PitchAPauseOn) { - NumarkV7.timer1 = engine.beginTimer(100, "NumarkV7.PitchScratchEnableA"); + NumarkV7.timer1 = engine.beginTimer(100, NumarkV7.PitchScratchEnableA); } } engine.setValue("[Channel1]","rate", (currentvalue * 1)); @@ -1075,7 +1075,7 @@ NumarkV7.PitchB = function () { engine.scratchDisable(2, false); NumarkV7.PitchBPause = 2; if (!NumarkV7.PitchBPauseOn) { - NumarkV7.timer2 = engine.beginTimer(100, "NumarkV7.PitchScratchEnableB"); + NumarkV7.timer2 = engine.beginTimer(100, NumarkV7.PitchScratchEnableB); } } engine.setValue("[Channel2]","rate", (currentvalue * 1)); diff --git a/res/controllers/Pioneer-DDJ-SB2-scripts.js b/res/controllers/Pioneer-DDJ-SB2-scripts.js index 5aecfb954e0..e6b3387347c 100644 --- a/res/controllers/Pioneer-DDJ-SB2-scripts.js +++ b/res/controllers/Pioneer-DDJ-SB2-scripts.js @@ -180,7 +180,7 @@ PioneerDDJSB2.init = function(_id) { PioneerDDJSB2.initDeck("[Channel4]"); if (PioneerDDJSB2.twinkleVumeterAutodjOn) { - PioneerDDJSB2.vuMeterTimer = engine.beginTimer(100, "PioneerDDJSB2.vuMeterTwinkle()"); + PioneerDDJSB2.vuMeterTimer = engine.beginTimer(100, PioneerDDJSB2.vuMeterTwinkle); } // request the positions of the knobs and faders from the controller @@ -702,7 +702,7 @@ PioneerDDJSB2.shiftKeyLockButton = function(channel, control, value, status, gro var deck = status - 0x90; if (value) { engine.stopTimer(PioneerDDJSB2.speedRateToNormalTimer[deck]); - PioneerDDJSB2.speedRateToNormalTimer[deck] = engine.beginTimer(PioneerDDJSB2.speedRateToNormalTime, "PioneerDDJSB2.speedRateToNormal('" + group + "', " + deck + ")"); + PioneerDDJSB2.speedRateToNormalTimer[deck] = engine.beginTimer(PioneerDDJSB2.speedRateToNormalTime, function() { PioneerDDJSB2.speedRateToNormal(group, deck); }); } }; diff --git a/res/controllers/Pioneer-DDJ-SX-scripts.js b/res/controllers/Pioneer-DDJ-SX-scripts.js index 292ccd9be96..caefea27723 100644 --- a/res/controllers/Pioneer-DDJ-SX-scripts.js +++ b/res/controllers/Pioneer-DDJ-SX-scripts.js @@ -396,7 +396,7 @@ PioneerDDJSX.init = function(id) { // activate vu meter timer for Auto DJ: if (PioneerDDJSX.twinkleVumeterAutodjOn) { - PioneerDDJSX.vuMeterTimer = engine.beginTimer(200, "PioneerDDJSX.vuMeterTwinkle()"); + PioneerDDJSX.vuMeterTimer = engine.beginTimer(200, PioneerDDJSX.vuMeterTwinkle); } // initiate control status request: @@ -483,7 +483,7 @@ PioneerDDJSX.autoDJToggleSyncKey = function(channel, control, value, status, gro PioneerDDJSX.autoDJTimer = function(value, group, control) { if (value) { - PioneerDDJSX.autoDJTickTimer = engine.beginTimer(PioneerDDJSX.autoDJTickInterval, "PioneerDDJSX.autoDJControl()"); + PioneerDDJSX.autoDJTickTimer = engine.beginTimer(PioneerDDJSX.autoDJTickInterval, PioneerDDJSX.autoDJControl); } else if (PioneerDDJSX.autoDJTickTimer) { engine.stopTimer(PioneerDDJSX.autoDJTickTimer); PioneerDDJSX.autoDJTickTimer = 0; diff --git a/res/controllers/Reloop Terminal Mix 2-4.js b/res/controllers/Reloop Terminal Mix 2-4.js index cf745315ec8..efc4a122630 100644 --- a/res/controllers/Reloop Terminal Mix 2-4.js +++ b/res/controllers/Reloop Terminal Mix 2-4.js @@ -104,8 +104,8 @@ TerminalMix.init = function (id,debug) { engine.connectControl("[Channel2]","beat_active","TerminalMix.tapLEDR"); TerminalMix.timers["fstartflash"] = -1; -// TerminalMix.timers["qtrSec"] = engine.beginTimer(250,"TerminalMix.qtrSec"); - TerminalMix.timers["halfSec"] = engine.beginTimer(500,"TerminalMix.halfSec"); + // TerminalMix.timers["qtrSec"] = engine.beginTimer(250,TerminalMix.qtrSec); + TerminalMix.timers["halfSec"] = engine.beginTimer(500,TerminalMix.halfSec); if (TerminalMix.traxKnobMode == "tracks") { midi.sendShortMsg(0x90,0x37,0x7F); // light Back button diff --git a/res/controllers/Reloop-Beatmix-2-4-scripts.js b/res/controllers/Reloop-Beatmix-2-4-scripts.js index 92dd6782f1a..dd026790962 100644 --- a/res/controllers/Reloop-Beatmix-2-4-scripts.js +++ b/res/controllers/Reloop-Beatmix-2-4-scripts.js @@ -622,8 +622,8 @@ ReloopBeatmix24.FxModeLedFlash = function(step, mode) { midi.sendShortMsg(i, 0x26 - mode, ledValue); midi.sendShortMsg(i, 0x26 + SHIFT - mode, ledValue); } - engine.beginTimer(150, "ReloopBeatmix24.FxModeLedFlash(" + (step + 1) + - ", " + mode + ")", true); + engine.beginTimer(150, function() { + ReloopBeatmix24.FxModeLedFlash((step + 1), mode); }, true); } }; @@ -636,7 +636,7 @@ ReloopBeatmix24.FxModeCallback = function(group, mode) { midi.sendShortMsg(i, 0x26 - mode, OFF); midi.sendShortMsg(i, 0x26 + SHIFT - mode, OFF); } - engine.beginTimer(150, "ReloopBeatmix24.FxModeLedFlash(1, " + mode + ")", + engine.beginTimer(150, function() { ReloopBeatmix24.FxModeLedFlash(1, mode); }, true); }; diff --git a/res/controllers/Reloop-Jockey-3-ME-scripts.js b/res/controllers/Reloop-Jockey-3-ME-scripts.js index 529af30685f..a40f6362bad 100644 --- a/res/controllers/Reloop-Jockey-3-ME-scripts.js +++ b/res/controllers/Reloop-Jockey-3-ME-scripts.js @@ -67,12 +67,12 @@ Jockey3ME.LedMeterShow = function() { if (Jockey3ME.LedMeterShowValueTwo && Jockey3ME.LedMeterShowValue < 0) { engine.stopTimer(Jockey3ME.LedMeterShowTimer); Jockey3ME.LedMeterShowTimer = 0; - Jockey3ME.EffectLedMeter = engine.beginTimer(20,"Jockey3ME.EffectLedMeterShow()"); + Jockey3ME.EffectLedMeter = engine.beginTimer(20, Jockey3ME.EffectLedMeterShow); }; } Jockey3ME.LedShowBegin = function () { - Jockey3ME.LedMeterShowTimer = engine.beginTimer(40,"Jockey3ME.LedMeterShow()"); + Jockey3ME.LedMeterShowTimer = engine.beginTimer(40, Jockey3ME.LedMeterShow); } // Init Script at Program start @@ -89,7 +89,7 @@ Jockey3ME.init = function () { midi.sendShortMsg(0x92,j,0x00); midi.sendShortMsg(0x93,j,0x00); }; - Jockey3ME.LedShowBeginTimer = engine.beginTimer(2000,"Jockey3ME.LedShowBegin()",1); // LedShow Script Starts Here after 500ms + Jockey3ME.LedShowBeginTimer = engine.beginTimer(2000, Jockey3ME.LedShowBegin, 1); // LedShow Script Starts Here after 500ms for (var i = 1; i <= 4; i++) { for (var j = 1; j <= 3; j++) { engine.connectControl("[EffectRack1_EffectUnit" + i + "_Effect1]","parameter" + j,"Jockey3ME.FX_Param_Led"); @@ -239,7 +239,7 @@ Jockey3ME.effectSelect = function (channel, control, value, status, group) { if (fxChainSelectKnob) { engine.setValue("[EffectRack1_EffectUnit" + currentDeck + "]", "chain_selector", (value-64)); // Set Leds - // Jockey3ME.effectSelectTimer = engine.beginTimer(100, "Jockey3ME.effectSelectLedSet(" + status + "," + currentDeck + ")",1); + // Jockey3ME.effectSelectTimer = engine.beginTimer(100, function() { Jockey3ME.effectSelectLedSet(status, currentDeck); },1); var num_parameters = engine.getValue("[EffectRack1_EffectUnit" + currentDeck + "_Effect1]", "num_parameters"); if (num_parameters > 3) { num_parameters = 3; @@ -332,8 +332,8 @@ Jockey3ME.effectSelectPush = function (channel, control, value, status, group) { continue; } if (Jockey3ME.fxSelectKnobPushIterator[r]) { - engine.beginTimer(400,"midi.sendShortMsg(" + status + "," + control + ",0x7F)",1); - engine.beginTimer(600,"midi.sendShortMsg(" + status + "," + control + ",0x00)",1); + engine.beginTimer(400, function() { midi.sendShortMsg(status, control, 0x7F); },1); + engine.beginTimer(600, function() { midi.sendShortMsg(status, control, 0x00); },1); break fxSelectKnobPushBreak; } } @@ -355,21 +355,21 @@ Jockey3ME.effectSelectPush = function (channel, control, value, status, group) { if (engine.getValue("[EffectRack1_EffectUnit" + currentDeck + "_Effect" + Jockey3ME.fxSelectKnobPush[currentDeck-1] + "]","parameter" + Jockey3ME.fxSelectKnobParamChose + "_loaded")) { engine.setValue("[EffectRack1_EffectUnit" + currentDeck + "_Effect" + Jockey3ME.fxSelectKnobPush[currentDeck-1] + "]","parameter" + Jockey3ME.fxSelectKnobParamChose + "_link_type",Jockey3ME.fxSelectKnobParamLinkChose); engine.setValue("[EffectRack1_EffectUnit" + currentDeck + "_Effect" + Jockey3ME.fxSelectKnobPush[currentDeck-1] + "]","parameter" + Jockey3ME.fxSelectKnobParamChose + "_link_inverse",Jockey3ME.fxSelectKnobParamLinkInverseChose); - engine.beginTimer(400,"midi.sendShortMsg(" + status + "," + control + ",0x7F)",1); - engine.beginTimer(600,"midi.sendShortMsg(" + status + "," + control + ",0x00)",1); - engine.beginTimer(800,"midi.sendShortMsg(" + status + "," + control + ",0x7F)",1); - engine.beginTimer(1000,"midi.sendShortMsg(" + status + "," + control + ",0x00)",1); + engine.beginTimer(400, function() { midi.sendShortMsg(status, control, 0x7F); },1); + engine.beginTimer(600, function() { midi.sendShortMsg(status, control, 0x00); },1); + engine.beginTimer(800, function() { midi.sendShortMsg(status, control, 0x7F); },1); + engine.beginTimer(1000, function() { midi.sendShortMsg(status, control, 0x00); },1); } } } Jockey3ME.fxSelectKnobPush[currentDeck-1] = 0; } else { Jockey3ME.fxSelectKnobPush[currentDeck-1] = 0; - engine.beginTimer(400,"midi.sendShortMsg(" + status + "," + control + ",0x7F)",1); - engine.beginTimer(600,"midi.sendShortMsg(" + status + "," + control + ",0x00)",1); + engine.beginTimer(400, function() { midi.sendShortMsg(status, control, 0x7F); },1); + engine.beginTimer(600, function() { midi.sendShortMsg(status, control, 0x00); },1); } midi.sendShortMsg(status,control,0x7F); - engine.beginTimer(200,"midi.sendShortMsg(" + status + "," + control + ",0x00)",1); + engine.beginTimer(200, function() { midi.sendShortMsg(status, control, 0x00); },1); } } diff --git a/res/controllers/Stanton-SCS1d-scripts.js b/res/controllers/Stanton-SCS1d-scripts.js index cf8ac3fcfd2..a2c0ad048dd 100644 --- a/res/controllers/Stanton-SCS1d-scripts.js +++ b/res/controllers/Stanton-SCS1d-scripts.js @@ -832,7 +832,7 @@ StantonSCS1d.DeckChange = function (channel, control, value, status) { if (!StantonSCS1d.fastDeckChange) { if (StantonSCS1d.timer["deckChange"] != -1) engine.stopTimer(StantonSCS1d.timer["deckChange"]); StantonSCS1d.state["flashes"] = 0; // initialize number of flashes - StantonSCS1d.timer["deckChange"] = engine.beginTimer(60,"StantonSCS1d.deckChangeFlash("+channel+","+value+")"); + StantonSCS1d.timer["deckChange"] = engine.beginTimer(60, function() { StantonSCS1d.deckChangeFlash(channel, value); }); return; } // No flashy lights @@ -1698,7 +1698,7 @@ StantonSCS1d.loopEnabled = function (value) { if (value>0 && StantonSCS1d.timer["loop"]==-1) { if (!StantonSCS1d.loopActive[StantonSCS1d.deck] || StantonSCS1d.loopActive[StantonSCS1d.deck]==-1) StantonSCS1d.activateLoop(1); - StantonSCS1d.timer["loop"] = engine.beginTimer(500,"StantonSCS1d.loopFlash()"); + StantonSCS1d.timer["loop"] = engine.beginTimer(500, StantonSCS1d.loopFlash); } if (value<=0 && StantonSCS1d.timer["loop"]!=-1) { @@ -2041,7 +2041,7 @@ StantonSCS1d.circleBars = function (value) { if (trackTimeRemaining<=30 && trackTimeRemaining>15) { // If <30s left, flash slowly if (StantonSCS1d.timer["30s-d"+deck] == -1) { // Start timer - StantonSCS1d.timer["30s-d"+deck] = engine.beginTimer(500,"StantonSCS1d.circleFlash("+deck+")"); + StantonSCS1d.timer["30s-d"+deck] = engine.beginTimer(500, function() { StantonSCS1d.circleFlash(deck); }); if (StantonSCS1d.timer["15s-d"+deck] != -1) { // Stop the 15s timer if it was running engine.stopTimer(StantonSCS1d.timer["15s-d"+deck]); @@ -2051,7 +2051,7 @@ StantonSCS1d.circleBars = function (value) { } else if (trackTimeRemaining<=15 && trackTimeRemaining>0) { // If <15s left, flash quickly if (StantonSCS1d.timer["15s-d"+deck] == -1) { // Start timer - StantonSCS1d.timer["15s-d"+deck] = engine.beginTimer(125,"StantonSCS1d.circleFlash("+deck+")"); + StantonSCS1d.timer["15s-d"+deck] = engine.beginTimer(125, function() { StantonSCS1d.circleFlash(deck); }); if (StantonSCS1d.timer["30s-d"+deck] != -1) { // Stop the 30s timer if it was running engine.stopTimer(StantonSCS1d.timer["30s-d"+deck]); diff --git a/res/controllers/Stanton-SCS1m-scripts.js b/res/controllers/Stanton-SCS1m-scripts.js index a8a11293b0a..2e7f894a2bd 100644 --- a/res/controllers/Stanton-SCS1m-scripts.js +++ b/res/controllers/Stanton-SCS1m-scripts.js @@ -745,7 +745,7 @@ StantonSCS1m.positionUpdates = function (value,deck) { if (trackTimeRemaining<=30 && trackTimeRemaining>15) { // If <30s left, flash slowly if (StantonSCS1m.timer["30s-d"+deck] == -1) { // Start timer - StantonSCS1m.timer["30s-d"+deck] = engine.beginTimer(500,"StantonSCS1m.displayFlash("+deck+")"); + StantonSCS1m.timer["30s-d"+deck] = engine.beginTimer(500, function() { StantonSCS1m.displayFlash(deck); }); if (StantonSCS1m.timer["15s-d"+deck] != -1) { // Stop the 15s timer if it was running engine.stopTimer(StantonSCS1m.timer["15s-d"+deck]); @@ -755,7 +755,7 @@ StantonSCS1m.positionUpdates = function (value,deck) { } else if (trackTimeRemaining<=15 && trackTimeRemaining>0) { // If <15s left, flash quickly if (StantonSCS1m.timer["15s-d"+deck] == -1) { // Start timer - StantonSCS1m.timer["15s-d"+deck] = engine.beginTimer(125,"StantonSCS1m.displayFlash("+deck+")"); + StantonSCS1m.timer["15s-d"+deck] = engine.beginTimer(125, function() { StantonSCS1m.displayFlash(deck); }); if (StantonSCS1m.timer["30s-d"+deck] != -1) { // Stop the 30s timer if it was running engine.stopTimer(StantonSCS1m.timer["30s-d"+deck]); diff --git a/res/controllers/Stanton-SCS3d-scripts.js b/res/controllers/Stanton-SCS3d-scripts.js index c8f92e7a65d..7c08911d379 100644 --- a/res/controllers/Stanton-SCS3d-scripts.js +++ b/res/controllers/Stanton-SCS3d-scripts.js @@ -1199,7 +1199,7 @@ StantonSCS3d.DeckChangeP1 = function (channel, control, value, status) { // If in the middle of flashing lights from a previous change, abort that one if (StantonSCS3d.timer[0] != -1) engine.stopTimer(StantonSCS3d.timer[0]); StantonSCS3d.state["flashes"] = 0; // initialize number of flashes - StantonSCS3d.timer[0] = engine.beginTimer(60,"StantonSCS3d.deckChangeFlash("+channel+","+value+",\"right\")"); + StantonSCS3d.timer[0] = engine.beginTimer(60, function() { StantonSCS3d.deckChangeFlash(channel, value, \"right\"); }); return; } } @@ -1209,7 +1209,7 @@ StantonSCS3d.DeckChangeP1 = function (channel, control, value, status) { if (!StantonSCS3d.fastDeckChange) { if (StantonSCS3d.timer[0] != -1) engine.stopTimer(StantonSCS3d.timer[0]); StantonSCS3d.state["flashes"] = 0; // initialize number of flashes - StantonSCS3d.timer[0] = engine.beginTimer(60,"StantonSCS3d.deckChangeFlash("+channel+","+value+",\"left\")"); + StantonSCS3d.timer[0] = engine.beginTimer(60, function() { StantonSCS3d.deckChangeFlash(channel, value, \"left\"); }); return; } } @@ -1938,7 +1938,7 @@ StantonSCS3d.ActiveLoop = function (value) { if (value>0) { if (StantonSCS3d.timer[timerName] == -1) { // Start timer - StantonSCS3d.timer[timerName] = engine.beginTimer(500,"StantonSCS3d.activeLoopLEDs("+StantonSCS3d.deck+",false)"); + StantonSCS3d.timer[timerName] = engine.beginTimer(500, function() { StantonSCS3d.activeLoopLEDs(StantonSCS3d.deck, false); }); } } else { @@ -2215,7 +2215,7 @@ StantonSCS3d.circleLEDs = function (value) { if (trackTimeRemaining<=30 && trackTimeRemaining>15) { // If <30s left, flash slowly if (StantonSCS3d.timer["30s-d"+deck] == -1) { // Start timer - StantonSCS3d.timer["30s-d"+deck] = engine.beginTimer(500,"StantonSCS3d.circleFlash("+deck+")"); + StantonSCS3d.timer["30s-d"+deck] = engine.beginTimer(500, function() { StantonSCS3d.circleFlash(deck); }); if (StantonSCS3d.timer["15s-d"+deck] != -1) { // Stop the 15s timer if it was running engine.stopTimer(StantonSCS3d.timer["15s-d"+deck]); @@ -2225,7 +2225,7 @@ StantonSCS3d.circleLEDs = function (value) { } else if (trackTimeRemaining<=15 && trackTimeRemaining>0) { // If <15s left, flash quickly if (StantonSCS3d.timer["15s-d"+deck] == -1) { // Start timer - StantonSCS3d.timer["15s-d"+deck] = engine.beginTimer(125,"StantonSCS3d.circleFlash("+deck+")"); + StantonSCS3d.timer["15s-d"+deck] = engine.beginTimer(125, function() { StantonSCS3d.circleFlash(deck); }); if (StantonSCS3d.timer["30s-d"+deck] != -1) { // Stop the 30s timer if it was running engine.stopTimer(StantonSCS3d.timer["30s-d"+deck]); diff --git a/res/controllers/TrakProDJ-iPad-scripts.js b/res/controllers/TrakProDJ-iPad-scripts.js index 0d0d6628f13..2c5645e71af 100644 --- a/res/controllers/TrakProDJ-iPad-scripts.js +++ b/res/controllers/TrakProDJ-iPad-scripts.js @@ -188,10 +188,10 @@ TrakProDJ.jog_enable = function(deck) { if (!ctrl.timer) { if (TrakProDJ.use_scratch) { print(group + ' enable scratch'); - ctrl.timer = engine.beginTimer(20,"TrakProDJ.jog_scratch_timer(deck)"); + ctrl.timer = engine.beginTimer(20, function() { TrakProDJ.jog_scratch_timer(deck); }); } else { print(group + ' enable rate bend'); - ctrl.timer = engine.beginTimer(20,"TrakProDJ.jog_rate_timer(deck)"); + ctrl.timer = engine.beginTimer(20, function() { TrakProDJ.jog_rate_timer(deck); }); } } if (TrakProDJ.use_scratch) { diff --git a/res/controllers/Vestax-VCI-100-3DEX-scripts.js b/res/controllers/Vestax-VCI-100-3DEX-scripts.js index 2e56c695fc1..43b4a106145 100644 --- a/res/controllers/Vestax-VCI-100-3DEX-scripts.js +++ b/res/controllers/Vestax-VCI-100-3DEX-scripts.js @@ -39,7 +39,7 @@ midi.sendShortMsg(0x80,0x64,0x7F);// reloop/exit button led off } -engine.beginTimer(150, "VestaxVCI1003DEX.loopLeds()",false) +engine.beginTimer(150, VestaxVCI1003DEX.loopLeds, false) //timer for loop leds end