changeset 314:e4e216957803

Merge branch 'dev/tracks-shape' of github.com:cannam/ugly-duckling into dev/tracks-shape
author Lucas Thompson <dev@lucas.im>
date Fri, 12 May 2017 17:08:58 +0100
parents e09bb9b25741 (current diff) a37fe99e1d9d (diff)
children 78a38043b634
files
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts	Fri May 12 17:07:48 2017 +0100
+++ b/src/app/waveform/waveform.component.ts	Fri May 12 17:08:58 2017 +0100
@@ -610,6 +610,7 @@
   }
 
   private addLineLayers(features: VectorFeature[],
+                        unit: string,
                         colour: Colour) {
 
     // Winnow out empty features
@@ -678,6 +679,7 @@
     });
 
     // And a single scale layer at left
+    //!!! todo: unit in scale layer
     const scaleLayer = new wavesUI.helpers.ScaleLayer({
       tickColor: colour,
       textColor: colour,
@@ -697,7 +699,8 @@
       height: height,
       color: '#c33c54',
       labelOffset: 38,
-      yDomain: [ min, max ]
+      yDomain: [ min, max ],
+      unit
     });
     this.addLayer(
       this.highlightLayer,
@@ -726,18 +729,23 @@
     const height = this.trackDiv.nativeElement.getBoundingClientRect().height;
     const waveTrack = this.timeline.getTrackById(`wave-${this.trackIdPrefix}`);
 
+    let unit = "";
+    if (outputDescriptor.configured.hasOwnProperty('unit')) {
+      unit = outputDescriptor.configured.unit;
+    }
+
     // TODO refactor all of this
     switch (features.shape) {
 
       case 'vector': {
         const collected = features.collected as VectorFeature;
-        this.addLineLayers([collected], colour);
+        this.addLineLayers([collected], unit, colour);
         break;
       }
 
       case 'tracks': {
         const collected = features.collected as TracksFeature;
-        this.addLineLayers(collected, colour);
+        this.addLineLayers(collected, unit, colour);
         break;
       }