Minor cleaning and fix #29

master
William Toohey 8 years ago
parent 7a116b9101
commit 52e8d31869
  1. 12
      src/js/HuesCanvas.js
  2. 8
      src/js/HuesCore.js

@ -489,7 +489,6 @@ class HuesCanvas {
}
}
// for song changes
clearBlackout() {
this.blackout = false;
this.blackoutTimeout = 0;
@ -500,10 +499,15 @@ class HuesCanvas {
}
doShortBlackout(beatTime) {
this.doBlackout();
this.blackoutTimeout = this.audio.currentTime + beatTime / 1.7;
// looks better if we go right to black
this.blackoutStart = 0;
this.doInstantBlackout();
this.blackoutTimeout = this.audio.currentTime + beatTime / 1.7;
}
doInstantBlackout() {
this.doBlackout();
// sufficiently negative
this.blackoutStart = -Math.pow(2, 32);
}
doColourFade(length) {

@ -97,10 +97,10 @@ class HuesCore {
*/
frame : [],
/* callback songstarted()
/* callback songstarted(song)
*
* Called when the song actually begins to play, not just when the
* new song processing begins
* new song processing begins. Song object passed.
*/
songstarted : [],
@ -524,12 +524,12 @@ class HuesCore {
}
}
this.setInvert(false);
this.renderer.doBlackout();
this.renderer.doInstantBlackout();
return this.soundManager.playSong(this.currentSong, this.doBuildup)
.then(() => {
this.resetAudio();
this.fillBuildup();
this.callEventListeners("songstarted");
this.callEventListeners("songstarted", this.currentSong);
});
}

Loading…
Cancel
Save