Add XML variable for new build behaviour

- Editor next
master
William Toohey 10 years ago
parent 07e6e26d7f
commit e4f31e546e
  1. 8
      src/js/HuesCore.js
  2. 1
      src/js/ResourcePack.js
  3. 9
      src/js/SoundManager.js

@ -415,8 +415,10 @@ HuesCore.prototype.fillBuildup = function() {
// update loop length for flash style filling
this.updateBeatLength();
if(this.currentSong.buildup) {
// TODO CHECK IF OLD OR NEW BEHAVIOUR
if(true) {
if(this.currentSong.independentBuild) {
console.log("New behaviour - separate build/loop lengths");
// Do nothing
} else {
console.log("Flash behaviour - filling buildup");
var buildBeats = Math.floor(this.soundManager.buildLength / this.loopLength);
if(buildBeats < 1) {
@ -425,8 +427,6 @@ HuesCore.prototype.fillBuildup = function() {
while (this.currentSong.buildupRhythm.length < buildBeats) {
this.currentSong.buildupRhythm = this.currentSong.buildupRhythm + ".";
}
} else {
console.log("New behaviour - separate build/loop lengths");
}
console.log("Buildup length:", buildBeats);
}

@ -436,6 +436,7 @@ Respack.prototype.parseSongFile = function(text) {
}
song.buildupRhythm = el.getTag("buildupRhythm");
song.independentBuild = el.getTag("independentBuild");
song.source = el.getTag("source");
song.charsPerBeat = parseFloat(el.getTag("charsPerBeat"));

@ -169,9 +169,9 @@ SoundManager.prototype.playSong = function(song, playBuild, forcePlay) {
return this.context.suspend()
}).then(() => {
if(playBuild) {
this.seek(-this.buildLength);
this.seek(-this.buildLength, true);
} else {
this.seek(0);
this.seek(0, true);
}
return this.context.resume();
@ -213,7 +213,7 @@ SoundManager.prototype.setRate = function(rate) {
this.seek(time);
}
SoundManager.prototype.seek = function(time) {
SoundManager.prototype.seek = function(time, noPlayingUpdate) {
if(!this.song) {
return;
}
@ -243,6 +243,9 @@ SoundManager.prototype.seek = function(time) {
}
this.startTime = this.context.currentTime - (time / this.playbackRate);
if(!noPlayingUpdate) {
this.playing = true;
}
this.core.recalcBeatIndex();
}

Loading…
Cancel
Save