Mercurial > hg > svgui
changeset 162:f32212631b9c
* 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)
author | Chris Cannam |
---|---|
date | Tue, 10 Oct 2006 19:04:57 +0000 |
parents | dc2fe023a14f |
children | dd6dd983e8ef |
files | layer/SpectrogramLayer.cpp |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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