# HG changeset patch # User Chris Cannam # Date 1147096276 0 # Node ID ed01c1261b55b8998ca6d0976c2c14f752706e03 # Parent 7d06e7cf5d5af89ead8a705beb330d74b9b6083a * add a column bitmap to the matrix file object to record which columns are available (optimisation for refreshing during fft creation) diff -r 7d06e7cf5d5a -r ed01c1261b55 layer/SpectrogramLayer.cpp --- 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 #include -//#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) {