Mercurial > hg > svcore
comparison data/fft/FFTDataServer.cpp @ 300:5877d68815c7
* Change WaveFileModel API from getValues(start,end) to getData(start,count).
It's much less error-prone to pass in frame counts instead of start/end
locations. Should have done this ages ago. This closes #1794563.
* Add option to apply a transform to only the selection region, instead of
the whole audio.
* (to make the above work properly) Add start frame offset to wave models
author | Chris Cannam |
---|---|
date | Mon, 01 Oct 2007 13:48:38 +0000 |
parents | a2dc34ce146a |
children | aa8dbac62024 |
comparison
equal
deleted
inserted
replaced
299:576be0d0d218 | 300:5877d68815c7 |
---|---|
1054 << off + pfx << " in buffer of size " << m_fftSize | 1054 << off + pfx << " in buffer of size " << m_fftSize |
1055 << " with window size " << m_windowSize | 1055 << " with window size " << m_windowSize |
1056 << " from channel " << m_channel << std::endl; | 1056 << " from channel " << m_channel << std::endl; |
1057 #endif | 1057 #endif |
1058 | 1058 |
1059 size_t got = m_model->getValues(m_channel, startFrame + pfx, | 1059 size_t count = 0; |
1060 endFrame, m_fftInput + off + pfx); | 1060 if (endFrame > startFrame + pfx) count = endFrame - (startFrame + pfx); |
1061 | |
1062 size_t got = m_model->getData(m_channel, startFrame + pfx, | |
1063 count, m_fftInput + off + pfx); | |
1061 | 1064 |
1062 while (got + pfx < m_windowSize) { | 1065 while (got + pfx < m_windowSize) { |
1063 m_fftInput[off + got + pfx] = 0.0; | 1066 m_fftInput[off + got + pfx] = 0.0; |
1064 ++got; | 1067 ++got; |
1065 } | 1068 } |