changeset 334:f986426870d0

Add scale and highlight to notes tracks
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 19 May 2017 16:37:08 +0100
parents 802fbba26afe
children 46435d5208e9
files src/app/waveform/waveform.component.ts
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts	Fri May 19 11:08:43 2017 +0100
+++ b/src/app/waveform/waveform.component.ts	Fri May 19 16:37:08 2017 +0100
@@ -687,6 +687,18 @@
       return lineLayer;
     });
 
+    this.addScaleAndHighlight(waveTrack, lineLayers, unit, colour, min, max);
+  }
+
+  private addScaleAndHighlight(waveTrack,
+                               lineLayers,
+                               unit: string,
+                               colour: Colour,
+                               min: number,
+                               max: number) {
+
+    const height = this.trackDiv.nativeElement.getBoundingClientRect().height;
+    
     // And a single scale layer at left
     // !!! todo: unit in scale layer
     const scaleLayer = new wavesUI.helpers.ScaleLayer({
@@ -819,6 +831,8 @@
                 waveTrack,
                 this.timeline.timeContext
               );
+              this.addScaleAndHighlight(waveTrack, [pianoRollLayer], "",
+                                        colour, min, max);
               break;
           }
         } catch (e) {