Mercurial > hg > ugly-duckling
comparison src/app/notebook-feed/notebook-feed.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 | 524f5cd75737 |
children | ccce2c09502e |
comparison
equal
deleted
inserted
replaced
455:d27f1ca7ba6a | 456:7bb0bac6f8dc |
---|---|
2 * Created by lucast on 21/03/2017. | 2 * Created by lucast on 21/03/2017. |
3 */ | 3 */ |
4 import { | 4 import { |
5 ChangeDetectionStrategy, | 5 ChangeDetectionStrategy, |
6 ChangeDetectorRef, | 6 ChangeDetectorRef, |
7 Component, | 7 Component, EventEmitter, |
8 Inject, | 8 Inject, |
9 Input, | 9 Input, |
10 OnDestroy | 10 OnDestroy, Output |
11 } from '@angular/core'; | 11 } from '@angular/core'; |
12 import Waves from 'waves-ui-piper'; | 12 import Waves from 'waves-ui-piper'; |
13 import { | 13 import { |
14 getRootUri, | 14 getRootUri, |
15 isRootAudioItem, | 15 isRootAudioItem, |
30 @Input() analyses: Item[]; | 30 @Input() analyses: Item[]; |
31 @Input() set rootAudioUri(uri: string) { | 31 @Input() set rootAudioUri(uri: string) { |
32 this._rootAudioUri = uri; | 32 this._rootAudioUri = uri; |
33 } | 33 } |
34 @Input() onSeek: OnSeekHandler; | 34 @Input() onSeek: OnSeekHandler; |
35 @Output() removeItem: EventEmitter<Item>; | |
35 | 36 |
36 get rootAudioUri(): string { | 37 get rootAudioUri(): string { |
37 return this._rootAudioUri; | 38 return this._rootAudioUri; |
38 } | 39 } |
39 private _rootAudioUri: string; | 40 private _rootAudioUri: string; |
44 | 45 |
45 constructor( | 46 constructor( |
46 private ref: ChangeDetectorRef, | 47 private ref: ChangeDetectorRef, |
47 @Inject('DimensionObservable') private onResize: Observable<Dimension> | 48 @Inject('DimensionObservable') private onResize: Observable<Dimension> |
48 ) { | 49 ) { |
50 this.removeItem = new EventEmitter<Item>(); | |
49 this.timelines = new Map(); | 51 this.timelines = new Map(); |
50 this.onResize.subscribe(dim => { | 52 this.onResize.subscribe(dim => { |
51 this.lastWidth = this.width; | 53 this.lastWidth = this.width; |
52 this.width = dim.width; | 54 this.width = dim.width; |
53 }); | 55 }); |