comparison data/model/FFTModel.cpp @ 408:115f60df1e4d

* Speed up spectrogram painting by releasing mutex in FFTDataServer while calculating data prior to writing it, and by adding whole-column value query methods to FFT objects * Add paint cache to Thumbwheel -- repaints of this widget were slowing down the whole spectrogram repaint * More uses of MutexLocker (named and with debug) and more profile points * Make startup much quicker some of the time, with OSC server in place
author Chris Cannam
date Thu, 08 May 2008 14:46:22 +0000
parents 7e1b7fcb6c00
children 83eae5239db6
comparison
equal deleted inserted replaced
407:88ad01799040 408:115f60df1e4d
165 FFTModel::getColumn(size_t x, Column &result) const 165 FFTModel::getColumn(size_t x, Column &result) const
166 { 166 {
167 Profiler profiler("FFTModel::getColumn", false); 167 Profiler profiler("FFTModel::getColumn", false);
168 168
169 result.clear(); 169 result.clear();
170 size_t height(getHeight()); 170 size_t h = getHeight();
171 for (size_t y = 0; y < height; ++y) { 171
172 result.push_back(const_cast<FFTModel *>(this)->getMagnitudeAt(x, y)); 172 float magnitudes[h];
173 if (m_server->getMagnitudesAt(x << m_xshift, magnitudes)) {
174 for (size_t y = 0; y < h; ++y) {
175 result.push_back(magnitudes[h]);
176 }
177 } else {
178 for (size_t i = 0; i < h; ++i) result.push_back(0.f);
173 } 179 }
174 } 180 }
175 181
176 QString 182 QString
177 FFTModel::getBinName(size_t n) const 183 FFTModel::getBinName(size_t n) const