changeset 1218:4f1f3e1a4f63

Debug toward tracking down strange peak-frequency spectrogram update problem
author Chris Cannam
date Fri, 13 Jan 2017 15:44:39 +0000
parents 51b6381fc413
children c06861dec245
files layer/Colour3DPlotRenderer.cpp
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp	Fri Jan 13 15:37:07 2017 +0000
+++ b/layer/Colour3DPlotRenderer.cpp	Fri Jan 13 15:44:39 2017 +0000
@@ -1047,6 +1047,11 @@
 
     bool logarithmic = (m_params.binScale == BinScale::Log);
 
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+    SVDEBUG << "start = " << start << ", finish = " << finish
+            << ", step = " << step << endl;
+#endif
+    
     for (int x = start; x != finish; x += step) {
         
         // x is the on-canvas pixel coord; sx (later) will be the
@@ -1092,6 +1097,11 @@
 
         if (!pixelPeakColumn.empty()) {
 
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+            SVDEBUG << "found " << peakfreqs.size() << " peak freqs at column "
+                    << sx0 << endl;
+#endif
+
             for (FFTModel::PeakSet::const_iterator pi = peakfreqs.begin();
                  pi != peakfreqs.end(); ++pi) {
 
@@ -1116,10 +1126,19 @@
             }
 
             m_magRanges.push_back(magRange);
+
+        } else {
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+            SVDEBUG << "pixel peak column for range " << sx0 << " to " << sx1
+                    << " is empty" << endl;
+#endif
         }
 
         double fractionComplete = double(columnCount) / double(w);
         if (timer.outOfTime(fractionComplete)) {
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+            SVDEBUG << "out of time" << endl;
+#endif
             return columnCount;
         }
     }