Mercurial > hg > ugly-duckling
diff src/app/waveform/waveform.component.ts @ 18:dcfcba8fde0a
Uncomment initial rendering code for waveform.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Thu, 27 Oct 2016 17:48:23 +0100 |
parents | ff964b28a272 |
children | aabfa7a693dc |
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts Thu Oct 27 17:47:20 2016 +0100 +++ b/src/app/waveform/waveform.component.ts Thu Oct 27 17:48:23 2016 +0100 @@ -34,23 +34,23 @@ ngOnInit() {} ngAfterViewInit(): void { - // const track: HTMLElement = this.trackDiv.nativeElement; - // const duration: number = 1.0; - // const height: number = track.getBoundingClientRect().height; - // const width: number = track.getBoundingClientRect().width; - // const pixelsPerSecond = width / duration; - // const timeline = new wavesUI.core.Timeline(pixelsPerSecond, width); - // timeline.createTrack(track, height, 'main'); - // - // // time axis - // const timeAxis = new wavesUI.helpers.TimeAxisLayer({ - // height: height, - // top: 10, - // color: 'gray' - // }); - // - // timeline.addLayer(timeAxis, 'main', 'default', true); - // timeline.state = new wavesUI.states.CenteredZoomState(timeline); + const track: HTMLElement = this.trackDiv.nativeElement; + const duration: number = 1.0; + const height: number = track.getBoundingClientRect().height; + const width: number = track.getBoundingClientRect().width; + const pixelsPerSecond = width / duration; + const timeline = new wavesUI.core.Timeline(pixelsPerSecond, width); + timeline.createTrack(track, height, 'main'); + + // time axis + const timeAxis = new wavesUI.helpers.TimeAxisLayer({ + height: height, + top: 10, + color: 'gray' + }); + + timeline.addLayer(timeAxis, 'main', 'default', true); + timeline.state = new wavesUI.states.CenteredZoomState(timeline); } ngOnChanges(changes: SimpleChanges): void {