| 501 | } |
| 502 | |
| 503 | start(ms = this.freq) { |
| 504 | //trace("start - ms: " + ms + "\n"); |
| 505 | this.running = 1; |
| 506 | this.fill(0); |
| 507 | |
| 508 | this.scheme.forEach( function(effect) { |
| 509 | effect.activate(effect); |
| 510 | trace(` activating: ${effect.name} [${effect.start}-${effect.end}]\n`); |
| 511 | } ); |
| 512 | this.timer = Timer.repeat(id => { |
| 513 | let t = Time.ticks; |
| 514 | this.scheme.forEach( function(effect) { effect.idle(effect, t); }); |
| 515 | this.update(this); |
| 516 | |
| 517 | //trace("effect cycle took" + (Time.ticks - t) + "ms\n"); |
| 518 | }, ms); |
| 519 | } |
| 520 | |
| 521 | stop() { |
| 522 | Timer.clear(this.timer); |