Mercurial > hg > svcore
diff data/fft/FFTDataServer.cpp @ 246:d7eeffbb8aaf
* Add fuzzy interpolation option as an alternative to zero padding in
spectrogram (looks terrible though)
* Make spectrogram appear more quickly by having the FFT server notify of
updates more often near the start of its run
author | Chris Cannam |
---|---|
date | Mon, 05 Mar 2007 15:32:55 +0000 |
parents | 85bf384db35f |
children | dc46851837d6 |
line wrap: on
line diff
--- a/data/fft/FFTDataServer.cpp Fri Mar 02 14:00:12 2007 +0000 +++ b/data/fft/FFTDataServer.cpp Mon Mar 05 15:32:55 2007 +0000 @@ -1135,8 +1135,9 @@ size_t remainingEnd = end; int counter = 0; - int updateAt = (end / m_server.m_windowIncrement) / 20; - if (updateAt < 100) updateAt = 100; + int updateAt = 1; + int maxUpdateAt = (end / m_server.m_windowIncrement) / 20; + if (maxUpdateAt < 100) maxUpdateAt = 100; if (m_fillFrom > start) { @@ -1166,6 +1167,10 @@ m_completion = size_t(100 * fabsf(float(f - m_fillFrom) / float(end - start))); counter = 0; + if (updateAt < maxUpdateAt) { + updateAt *= 2; + if (updateAt > maxUpdateAt) updateAt = maxUpdateAt; + } } } @@ -1200,6 +1205,10 @@ size_t(100 * fabsf(float(f - start) / float(end - start))); counter = 0; + if (updateAt < maxUpdateAt) { + updateAt *= 2; + if (updateAt > maxUpdateAt) updateAt = maxUpdateAt; + } } }