comparison src/vamp-hostsdk/PluginSummarisingAdapter.cpp @ 275:ecfb41a370aa

* implement reset() (duh)
author cannam
date Fri, 12 Dec 2008 16:59:47 +0000
parents 33feff966de3
children c97e70ed5abc
comparison
equal deleted inserted replaced
274:33feff966de3 275:ecfb41a370aa
56 Impl(Plugin *plugin, float inputSampleRate); 56 Impl(Plugin *plugin, float inputSampleRate);
57 ~Impl(); 57 ~Impl();
58 58
59 bool initialise(size_t channels, size_t stepSize, size_t blockSize); 59 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
60 60
61 void reset();
62
61 FeatureSet process(const float *const *inputBuffers, RealTime timestamp); 63 FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
62 FeatureSet getRemainingFeatures(); 64 FeatureSet getRemainingFeatures();
63 65
64 void setSummarySegmentBoundaries(const SegmentBoundaries &); 66 void setSummarySegmentBoundaries(const SegmentBoundaries &);
65 67
165 return 167 return
166 PluginWrapper::initialise(channels, stepSize, blockSize) && 168 PluginWrapper::initialise(channels, stepSize, blockSize) &&
167 m_impl->initialise(channels, stepSize, blockSize); 169 m_impl->initialise(channels, stepSize, blockSize);
168 } 170 }
169 171
172 void
173 PluginSummarisingAdapter::reset()
174 {
175 m_impl->reset();
176 }
177
170 Plugin::FeatureSet 178 Plugin::FeatureSet
171 PluginSummarisingAdapter::process(const float *const *inputBuffers, RealTime timestamp) 179 PluginSummarisingAdapter::process(const float *const *inputBuffers, RealTime timestamp)
172 { 180 {
173 return m_impl->process(inputBuffers, timestamp); 181 return m_impl->process(inputBuffers, timestamp);
174 } 182 }
216 size_t stepSize, size_t blockSize) 224 size_t stepSize, size_t blockSize)
217 { 225 {
218 m_stepSize = stepSize; 226 m_stepSize = stepSize;
219 m_blockSize = blockSize; 227 m_blockSize = blockSize;
220 return true; 228 return true;
229 }
230
231 void
232 PluginSummarisingAdapter::Impl::reset()
233 {
234 m_accumulators.clear();
235 m_segmentedAccumulators.clear();
236 m_prevTimestamps.clear();
237 m_prevDurations.clear();
238 m_summaries.clear();
239 m_reduced = false;
240 m_endTime = RealTime();
241 m_plugin->reset();
221 } 242 }
222 243
223 Plugin::FeatureSet 244 Plugin::FeatureSet
224 PluginSummarisingAdapter::Impl::process(const float *const *inputBuffers, 245 PluginSummarisingAdapter::Impl::process(const float *const *inputBuffers,
225 RealTime timestamp) 246 RealTime timestamp)