Mercurial > hg > ugly-duckling
comparison src/app/analysis-item/analysis-item.component.ts @ 412:89674c064cda
Set duration on the LayerTimeContext to the length of the underlying audio file.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Mon, 05 Jun 2017 14:25:54 +0100 |
parents | 523858455430 |
children | 8113b6f5a75e |
comparison
equal
deleted
inserted
replaced
411:7e6b9b557179 | 412:89674c064cda |
---|---|
144 getFeatureShape(): HigherLevelFeatureShape | null { | 144 getFeatureShape(): HigherLevelFeatureShape | null { |
145 return !isPendingRootAudioItem(this.item) && | 145 return !isPendingRootAudioItem(this.item) && |
146 isAnalysisItem(this.item) ? this.item.shape : null; | 146 isAnalysisItem(this.item) ? this.item.shape : null; |
147 } | 147 } |
148 | 148 |
149 getDuration(): number | null { | |
150 if (isRootAudioItem(this.item)) { | |
151 return this.item.audioData.duration; | |
152 } | |
153 if (isAnalysisItem(this.item)) { | |
154 return this.item.parent.audioData.duration; | |
155 } | |
156 } | |
157 | |
149 getNextColour(): string { | 158 getNextColour(): string { |
150 return defaultColourGenerator.next().value; | 159 return defaultColourGenerator.next().value; |
151 } | 160 } |
152 | 161 |
153 ngOnDestroy(): void { | 162 ngOnDestroy(): void { |