# HG changeset patch # User Chris Cannam # Date 1147782057 0 # Node ID 6ab46726a6533b925c5540d1250950cbbd49d062 # Parent 507f923a93e82fa8c6fc0a8a1454843f297f94d9 * Make plugin initialise fail if the right block size isn't provided. diff -r 507f923a93e8 -r 6ab46726a653 plugins/BeatDetect.cpp --- 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; }