Mercurial > hg > qm-vamp-plugins
changeset 10:6ab46726a653
* Make plugin initialise fail if the right block size isn't provided.
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 16 May 2006 12:20:57 +0000 |
parents | 507f923a93e8 |
children | 9aa71464ebd9 |
files | plugins/BeatDetect.cpp |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/BeatDetect.cpp Mon May 15 19:56:21 2006 +0000 +++ b/plugins/BeatDetect.cpp Tue May 16 12:20:57 2006 +0000 @@ -140,7 +140,17 @@ } if (channels < getMinChannelCount() || - channels > getMaxChannelCount()) return false; + channels > getMaxChannelCount()) { + std::cerr << "BeatDetector::initialise: Unsupported channel count: " + << channels << std::endl; + return false; + } + + if (blockSize != getPreferredStepSize() * 2) { + std::cerr << "BeatDetector::initialise: Unsupported block size for this sample rate: " + << blockSize << std::endl; + return false; + } DFConfig dfConfig; dfConfig.DFType = m_dfType; @@ -162,7 +172,7 @@ BeatDetector::getPreferredStepSize() const { size_t step = size_t(m_inputSampleRate * m_stepSecs + 0.0001); - std::cerr << "BeatDetector::getPreferredStepSize: input sample rate is " << m_inputSampleRate << ", step size is " << step << std::endl; +// std::cerr << "BeatDetector::getPreferredStepSize: input sample rate is " << m_inputSampleRate << ", step size is " << step << std::endl; return step; }