Mercurial > hg > ugly-duckling
diff src/app/waveform/waveform.component.ts @ 17:ff964b28a272
Clear waveform before redrawing, otherwise the waveform is not drawn. also remove some debug outputs.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Thu, 27 Oct 2016 17:47:20 +0100 |
parents | 7e3ab6f8792f |
children | dcfcba8fde0a |
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts Thu Oct 27 17:08:57 2016 +0100 +++ b/src/app/waveform/waveform.component.ts Thu Oct 27 17:47:20 2016 +0100 @@ -17,7 +17,6 @@ @Input() set audioBuffer(buffer: AudioBuffer) { - console.log("setter"); this._audioBuffer = buffer || undefined; } @@ -55,7 +54,6 @@ } ngOnChanges(changes: SimpleChanges): void { - console.log("ng changes"); if (changes.hasOwnProperty("audioBuffer")) { // why wouldn't it? if (changes["audioBuffer"].currentValue) this.renderWaveform(changes["audioBuffer"].currentValue); @@ -64,8 +62,8 @@ renderWaveform(buffer: AudioBuffer) { // TODO reduce dupe from original timeline state, anyway to actually not instantiate new timeline? - console.log("render wave"); const track: HTMLElement = this.trackDiv.nativeElement; + track.innerHTML = ""; const duration: number = buffer.duration; const height: number = track.getBoundingClientRect().height; const width: number = track.getBoundingClientRect().width;