# HG changeset patch # User cannam # Date 1212607979 0 # Node ID de792b8c2801bb6962cb0cbd11b164f76772f9a3 # Parent 640f92242cc1b1e5649e6062de67e3b3f5a1399c * update from other repo diff -r 640f92242cc1 -r de792b8c2801 MatchVampPlugin.cpp --- a/MatchVampPlugin.cpp Wed Oct 24 12:13:43 2007 +0000 +++ b/MatchVampPlugin.cpp Wed Jun 04 19:32:59 2008 +0000 @@ -181,8 +181,10 @@ if (!pm1) createMatchers(); if (channels < getMinChannelCount() || channels > getMaxChannelCount()) return false; - if (stepSize != getPreferredStepSize() || + if (stepSize > blockSize/2 || blockSize != getPreferredBlockSize()) return false; + pm1->setHopSize(stepSize); + pm2->setHopSize(stepSize); m_begin = true; m_locked = false; return true; diff -r 640f92242cc1 -r de792b8c2801 Matcher.cpp --- a/Matcher.cpp Wed Oct 24 12:13:43 2007 +0000 +++ b/Matcher.cpp Wed Jun 04 19:32:59 2008 +0000 @@ -61,6 +61,19 @@ } // default constructor +void +Matcher::setHopSize(int sz) +{ + if (initialised) { + std::cerr << "Matcher::setHopSize: Can't set after use" << std::endl; + return; + } + + hopSize = sz; + hopTime = float(hopSize) / sampleRate; + blockTime = blockSize * hopTime; +} + Matcher::~Matcher() { std::cerr << "Matcher(" << this << ")::~Matcher()" << std::endl; diff -r 640f92242cc1 -r de792b8c2801 Matcher.h --- a/Matcher.h Wed Oct 24 12:13:43 2007 +0000 +++ b/Matcher.h Wed Jun 04 19:32:59 2008 +0000 @@ -249,6 +249,8 @@ return frameCount; } + void setHopSize(int); + protected: template void initVector(vector &vec, int sz, T dflt = 0) {