diff 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
line wrap: on
line diff
--- a/src/app/analysis-item/analysis-item.component.ts	Mon Jun 05 10:56:15 2017 +0100
+++ b/src/app/analysis-item/analysis-item.component.ts	Mon Jun 05 14:25:54 2017 +0100
@@ -146,6 +146,15 @@
     isAnalysisItem(this.item) ? this.item.shape : null;
   }
 
+  getDuration(): number | null {
+    if (isRootAudioItem(this.item)) {
+      return this.item.audioData.duration;
+    }
+    if (isAnalysisItem(this.item)) {
+      return this.item.parent.audioData.duration;
+    }
+  }
+
   getNextColour(): string {
     return defaultColourGenerator.next().value;
   }