view src/app/visualisations/vertical-scale.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 40ea40ebc2b3
children 64ed45a0bad3
line wrap: on
line source
/**
 * Created by lucas on 01/06/2017.
 */
import {VerticalScaleRenderer} from './waves-base.component';
import {
  ChangeDetectionStrategy,
  Component,
  ContentChildren,
  QueryList,
  AfterViewInit
} from '@angular/core';

@Component({
  selector: 'ugly-vertical-scale',
  template: '<ng-content></ng-content>',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class VerticalScaleComponent implements AfterViewInit {

  @ContentChildren(
    VerticalScaleRenderer
  ) bounded: QueryList<VerticalScaleRenderer>;
  protected cachedRange: [number, number];

  ngAfterViewInit(): void {
    this.bounded.forEach(component => {
      this.cachedRange = component.range;
      if (this.cachedRange) {
        component.renderScale(this.cachedRange);
      }
    });
  }
}