# HG changeset patch # User cannam # Date 1237837621 0 # Node ID 80fae79c9472b0b8e2b483ea30e6c8ceae71f41f # Parent a02321c318843856f7ca6ef80c81a9744d49b574 * implement reset()! diff -r a02321c31884 -r 80fae79c9472 MatchVampPlugin.cpp --- a/MatchVampPlugin.cpp Tue Dec 02 13:13:25 2008 +0000 +++ b/MatchVampPlugin.cpp Mon Mar 23 19:47:01 2009 +0000 @@ -42,6 +42,7 @@ MatchVampPlugin::MatchVampPlugin(float inputSampleRate) : Plugin(inputSampleRate), + m_stepSize(0), m_serialise(false), m_begin(true), m_locked(false) @@ -183,6 +184,7 @@ channels > getMaxChannelCount()) return false; if (stepSize > blockSize/2 || blockSize != getPreferredBlockSize()) return false; + m_stepSize = stepSize; pm1->setHopSize(stepSize); pm2->setHopSize(stepSize); m_begin = true; @@ -193,7 +195,18 @@ void MatchVampPlugin::reset() { - //!!!??? + delete feeder; + delete pm1; + delete pm2; + feeder = 0; + pm1 = 0; + pm2 = 0; + + createMatchers(); + pm1->setHopSize(m_stepSize); + pm2->setHopSize(m_stepSize); + m_begin = true; + m_locked = false; } MatchVampPlugin::OutputList diff -r a02321c31884 -r 80fae79c9472 MatchVampPlugin.h --- a/MatchVampPlugin.h Tue Dec 02 13:13:25 2008 +0000 +++ b/MatchVampPlugin.h Mon Mar 23 19:47:01 2009 +0000 @@ -68,6 +68,7 @@ mutable Matcher *pm1; mutable Matcher *pm2; mutable MatchFeeder *feeder; + size_t m_stepSize; bool m_serialise; bool m_begin; bool m_locked;