Mercurial > hg > ugly-duckling
view src/app/visualisations/curve/curve.component.ts @ 456:7bb0bac6f8dc
Add export button for recordings and option to remove audio item (also removes all related analyses atm). Revokes associated object url for audio on removal. Will be problematic if the history is used for undo / redo.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Thu, 29 Jun 2017 20:11:14 +0100 |
parents | 89674c064cda |
children | 64ed45a0bad3 |
line wrap: on
line source
/** * Created by lucas on 30/05/2017. */ import { ChangeDetectionStrategy, Component, Input, ViewChild } from '@angular/core'; import {OnSeekHandler} from '../../playhead/PlayHeadHelpers'; import {VectorFeature} from 'piper/HigherLevelUtilities'; import { VerticallyBounded, VerticalScaleRenderer, VerticalValueInspectorRenderer, WavesComponent } from '../waves-base.component'; import {TracksComponent} from '../tracks/tracks.components'; @Component({ selector: 'ugly-curve', template: ` <ugly-tracks [timeline]="timeline" [width]="width" [onSeek]="onSeek" [colour]="colour" [tracks]="[curve]" [duration]="duration" ></ugly-tracks>`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [ {provide: VerticallyBounded, useExisting: CurveComponent }, {provide: VerticalScaleRenderer, useExisting: CurveComponent}, {provide: VerticalValueInspectorRenderer, useExisting: CurveComponent}, {provide: WavesComponent, useExisting: CurveComponent} ] }) export class CurveComponent implements VerticalValueInspectorRenderer { @Input() timeline: Timeline; // TODO refactor WaveComponents to have own Timeline, sharing a TimeContext @Input() onSeek: OnSeekHandler; @Input() width: number; @Input() curve: VectorFeature; @Input() colour: string; @Input() duration: number; @ViewChild(TracksComponent) tracksComponent: TracksComponent; renderInspector(range: [number, number], unit?: string): void { this.tracksComponent.renderInspector(range, unit); } get updatePosition(): OnSeekHandler { return this.tracksComponent.updatePosition; } renderScale(range: [number, number]): void { this.tracksComponent.renderScale(range); } get range(): [number, number] { return this.tracksComponent.range; } }