changeset 91:ed01c1261b55

* add a column bitmap to the matrix file object to record which columns are available (optimisation for refreshing during fft creation)
author Chris Cannam
date Mon, 08 May 2006 13:51:16 +0000
parents 7d06e7cf5d5a
children 23d1e37bbfb4
files layer/SpectrogramLayer.cpp
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Fri May 05 14:10:12 2006 +0000
+++ b/layer/SpectrogramLayer.cpp	Mon May 08 13:51:16 2006 +0000
@@ -33,7 +33,7 @@
 #include <cassert>
 #include <cmath>
 
-//#define DEBUG_SPECTROGRAM_REPAINT 1
+#define DEBUG_SPECTROGRAM_REPAINT 1
 
 static double mod(double x, double y)
 {
@@ -1654,6 +1654,8 @@
 		for (int s = s0i; s <= s1i; ++s) {
 		    if (s >= 0 && q >= 0 && s < cw && q < ch) {
 
+                        if (!m_cache->haveColumnAt(s)) continue;
+
 			float value;
 
 			value = m_cache->getPhaseAt(s, q);
@@ -1905,6 +1907,18 @@
 		s1i = s0i;
 	    }
 	}
+        
+        bool haveColumn = false;
+        for (size_t s = s0i; s <= s1i; ++s) {
+            if (m_cache->haveColumnAt(s)) {
+                haveColumn = true;
+                break;
+            }
+        }
+        if (!haveColumn) {
+            m_mutex.unlock();
+            continue;
+        }
 
 	for (size_t q = minbin; q < bins; ++q) {