Skip to content

Commit

Permalink
wip: fix Numark-Mixtrack-3 script beginTimer
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Nov 28, 2023
1 parent 5454b94 commit 7da28fa
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions res/controllers/Numark-Mixtrack-3-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,15 @@ LED.prototype.flashOn = function(num_ms_on, value, num_ms_off, flashCount, relig
// so we don't need this part if flashcount == 1

// permanent timer
this.flashTimer = engine.beginTimer(num_ms_on + num_ms_off, function() {
this.flashOnceOn(false);
});
this.flashTimer = engine.beginTimer(num_ms_on + num_ms_off, ()=>this.flashOnceOn(false));
}

if (flashCount > 1) {
// flashcount>0 , means temporary flash, first flash already done,
// so we don't need this part if flashcount=1
// temporary timer. The end of this timer stops the permanent flashing

this.flashTimer2 = engine.beginTimer(flashCount * (num_ms_on + num_ms_off) - num_ms_off, function() {
this.stopflash(relight);
}, true);
this.flashTimer2 = engine.beginTimer(flashCount * (num_ms_on + num_ms_off) - num_ms_off, ()=>this.stopflash(relight), true);
}
};

Expand Down Expand Up @@ -371,9 +367,7 @@ LED.prototype.flashOnceOn = function(relight) {
sendShortMsg(this.control, this.midino, this.valueon);
pauseScript(scriptpause);
this.flashOnceDuration = this.num_ms_on;
this.flashOnceTimer = engine.beginTimer(this.num_ms_on - scriptpause, function() {
this.flashOnceOff(relight);
}, true);
this.flashOnceTimer = engine.beginTimer(this.num_ms_on - scriptpause, ()=>this.flashOnceOff(relight), true);
};

// private :call back function (called in flashOnceOn() )
Expand Down

0 comments on commit 7da28fa

Please sign in to comment.