diff layer/SpectrogramLayer.cpp @ 491:c74e511a3c96

* Fix overall mag range management in normalise-visible-area mode
author Chris Cannam
date Mon, 09 Feb 2009 12:56:16 +0000
parents aa477ddcadb5
children fe134ec37a2a
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Fri Feb 06 15:06:23 2009 +0000
+++ b/layer/SpectrogramLayer.cpp	Mon Feb 09 12:56:16 2009 +0000
@@ -2302,14 +2302,16 @@
             }
         }
 
-        paintDrawBuffer(v, bufwid, h, binforx, binfory, usePeaksCache);
+        paintDrawBuffer(v, bufwid, h, binforx, binfory, usePeaksCache,
+                        overallMag, overallMagChanged);
 
     } else {
 
         paintDrawBufferPeakFrequencies(v, bufwid, h, binforx,
                                        minbin, maxbin,
                                        displayMinFreq, displayMaxFreq,
-                                       logarithmic);
+                                       logarithmic,
+                                       overallMag, overallMagChanged);
     }
 
 /*
@@ -2482,7 +2484,9 @@
                                                  int maxbin,
                                                  float displayMinFreq,
                                                  float displayMaxFreq,
-                                                 bool logarithmic) const
+                                                 bool logarithmic,
+                                                 MagnitudeRange &overallMag,
+                                                 bool &overallMagChanged) const
 {
     Profiler profiler("SpectrogramLayer::paintDrawBufferPeakFrequencies");
 
@@ -2577,6 +2581,7 @@
                               << std::endl;
                 } else {
                     m_columnMags[sx].sample(mag);
+                    if (overallMag.sample(mag)) overallMagChanged = true;
                 }
             }
         }
@@ -2591,7 +2596,9 @@
                                   int h,
                                   int *binforx,
                                   float *binfory,
-                                  bool usePeaksCache) const
+                                  bool usePeaksCache,
+                                  MagnitudeRange &overallMag,
+                                  bool &overallMagChanged) const
 {
     Profiler profiler("SpectrogramLayer::paintDrawBuffer");
 
@@ -2774,6 +2781,7 @@
                               << std::endl;
                 } else {
                     m_columnMags[sx].sample(mag);
+                    if (overallMag.sample(mag)) overallMagChanged = true;
                 }
             }
         }