diff src/app/waveform/waveform.component.ts @ 120:7170e6ca2206

Provide step duration for matrix entity for proper image alignment
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 14 Mar 2017 16:10:27 +0000
parents 5a4cd7add25a
children 3e19908d4c8b
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.ts	Tue Mar 14 15:11:30 2017 +0000
+++ b/src/app/waveform/waveform.component.ts	Tue Mar 14 16:10:27 2017 +0000
@@ -529,6 +529,7 @@
       }
       case 'matrix': {
         const stepDuration = (features as FixedSpacedFeatures).stepDuration;
+        //!!! + start time
         const matrixData = (features.data as Float32Array[]);
         if (matrixData.length === 0) return;
         console.log("matrix data length = " + matrixData.length);
@@ -536,7 +537,10 @@
         const targetValue = this.estimatePercentile(matrixData, 95);
         const gain = (targetValue > 0.0 ? (1.0 / targetValue) : 1.0);
         console.log("setting gain to " + gain);
-        const matrixEntity = new wavesUI.utils.PrefilledMatrixEntity(matrixData);
+        const matrixEntity =
+          new wavesUI.utils.PrefilledMatrixEntity(matrixData,
+                                                  0, // startTime
+                                                  stepDuration);
         let matrixLayer = new wavesUI.helpers.MatrixLayer(matrixEntity, {
           gain,
           height: height * 0.9,