|
@@ -615,8 +615,7 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
|
|
|
|
const currentMeasureBPM: number = this.currentMeasure.TempoInBPM;
|
|
|
if (currentMeasureBPM !== this.currentBPM && currentMeasureBPM > 0) {
|
|
|
- // only accept valid bpm (> 0)
|
|
|
- // TODO one sample has bpm 0 for measure 5: love again - dua lipa
|
|
|
+ // TODO the default value for measure.TempoInBPM is 0, probably not a good default setup. But we also catch it in bpmChanged().
|
|
|
this.bpmChanged(currentMeasureBPM); // update playback speed/bpm
|
|
|
}
|
|
|
|
|
@@ -1227,6 +1226,12 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
|
}
|
|
|
|
|
|
public bpmChanged(newBpm: number): void {
|
|
|
+ if (!(newBpm > 0)) {
|
|
|
+ // only accept valid bpm (> 0)
|
|
|
+ // TODO one sample has bpm 0 for measure 5: love again - dua lipa
|
|
|
+ log.info("invalid bpm set: " + newBpm + ". Ignoring.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.currentBPM = newBpm;
|
|
|
this.timingSource.setBpm(newBpm);
|
|
|
}
|