# HG changeset patch # User Chris Cannam # Date 1160507097 0 # Node ID f32212631b9ca14e735a73d0f1e360e1469bf518 # Parent dc2fe023a14f0ad8a5e8d3e0ca3396c322bc8197 * Handle generator transforms (plugins whose channel count isn't dependent on number of audio inputs, as they have none) * Be less keen to suspend writing FFT data in spectrogram repaint -- only do it if we find we actually need to query the FFT data (i.e. we aren't repainting an area that hasn't been generated at all yet) diff -r dc2fe023a14f -r f32212631b9c layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Tue Oct 10 14:51:17 2006 +0000 +++ b/layer/SpectrogramLayer.cpp Tue Oct 10 19:04:57 2006 +0000 @@ -1957,7 +1957,7 @@ MagnitudeRange overallMag = m_viewMags[v]; bool overallMagChanged = false; - fft->suspendWrites(); + bool fftSuspended = false; #ifdef DEBUG_SPECTROGRAM_REPAINT std::cerr << (float(v->getFrameForX(1) - v->getFrameForX(0)) / increment) << " bins per pixel" << std::endl; @@ -1992,6 +1992,12 @@ for (int s = s0i; s <= s1i; ++s) { if (!fft->isColumnAvailable(s)) continue; + + if (!fftSuspended) { + fft->suspendWrites(); + fftSuspended = true; + } + MagnitudeRange mag; for (size_t q = minbin; q < bins; ++q) { @@ -2149,7 +2155,7 @@ std::cerr << "SpectrogramLayer::paint() returning" << std::endl; #endif - fft->resume(); + if (fftSuspended) fft->resume(); } void