Mercurial > hg > match-vamp
comparison MatchVampPlugin.cpp @ 6:80fae79c9472
* implement reset()!
author | cannam |
---|---|
date | Mon, 23 Mar 2009 19:47:01 +0000 |
parents | de792b8c2801 |
children | 6ea008aa8817 |
comparison
equal
deleted
inserted
replaced
5:a02321c31884 | 6:80fae79c9472 |
---|---|
40 bool | 40 bool |
41 MatchVampPlugin::m_serialisingMutexInitialised = false; | 41 MatchVampPlugin::m_serialisingMutexInitialised = false; |
42 | 42 |
43 MatchVampPlugin::MatchVampPlugin(float inputSampleRate) : | 43 MatchVampPlugin::MatchVampPlugin(float inputSampleRate) : |
44 Plugin(inputSampleRate), | 44 Plugin(inputSampleRate), |
45 m_stepSize(0), | |
45 m_serialise(false), | 46 m_serialise(false), |
46 m_begin(true), | 47 m_begin(true), |
47 m_locked(false) | 48 m_locked(false) |
48 { | 49 { |
49 if (!m_serialisingMutexInitialised) { | 50 if (!m_serialisingMutexInitialised) { |
181 if (!pm1) createMatchers(); | 182 if (!pm1) createMatchers(); |
182 if (channels < getMinChannelCount() || | 183 if (channels < getMinChannelCount() || |
183 channels > getMaxChannelCount()) return false; | 184 channels > getMaxChannelCount()) return false; |
184 if (stepSize > blockSize/2 || | 185 if (stepSize > blockSize/2 || |
185 blockSize != getPreferredBlockSize()) return false; | 186 blockSize != getPreferredBlockSize()) return false; |
187 m_stepSize = stepSize; | |
186 pm1->setHopSize(stepSize); | 188 pm1->setHopSize(stepSize); |
187 pm2->setHopSize(stepSize); | 189 pm2->setHopSize(stepSize); |
188 m_begin = true; | 190 m_begin = true; |
189 m_locked = false; | 191 m_locked = false; |
190 return true; | 192 return true; |
191 } | 193 } |
192 | 194 |
193 void | 195 void |
194 MatchVampPlugin::reset() | 196 MatchVampPlugin::reset() |
195 { | 197 { |
196 //!!!??? | 198 delete feeder; |
199 delete pm1; | |
200 delete pm2; | |
201 feeder = 0; | |
202 pm1 = 0; | |
203 pm2 = 0; | |
204 | |
205 createMatchers(); | |
206 pm1->setHopSize(m_stepSize); | |
207 pm2->setHopSize(m_stepSize); | |
208 m_begin = true; | |
209 m_locked = false; | |
197 } | 210 } |
198 | 211 |
199 MatchVampPlugin::OutputList | 212 MatchVampPlugin::OutputList |
200 MatchVampPlugin::getOutputDescriptors() const | 213 MatchVampPlugin::getOutputDescriptors() const |
201 { | 214 { |