changeset 275:ecfb41a370aa

* implement reset() (duh)
author cannam
date Fri, 12 Dec 2008 16:59:47 +0000
parents 33feff966de3
children e03f9d0a8dc4
files src/vamp-hostsdk/PluginSummarisingAdapter.cpp vamp-hostsdk/PluginSummarisingAdapter.h
diffstat 2 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginSummarisingAdapter.cpp	Fri Dec 12 14:28:42 2008 +0000
+++ b/src/vamp-hostsdk/PluginSummarisingAdapter.cpp	Fri Dec 12 16:59:47 2008 +0000
@@ -58,6 +58,8 @@
 
     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
 
+    void reset();
+
     FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
     FeatureSet getRemainingFeatures();
 
@@ -167,6 +169,12 @@
         m_impl->initialise(channels, stepSize, blockSize);
 }
 
+void
+PluginSummarisingAdapter::reset()
+{
+    m_impl->reset();
+}
+
 Plugin::FeatureSet
 PluginSummarisingAdapter::process(const float *const *inputBuffers, RealTime timestamp)
 {
@@ -220,6 +228,19 @@
     return true;
 }
 
+void
+PluginSummarisingAdapter::Impl::reset()
+{
+    m_accumulators.clear();
+    m_segmentedAccumulators.clear();
+    m_prevTimestamps.clear();
+    m_prevDurations.clear();
+    m_summaries.clear();
+    m_reduced = false;
+    m_endTime = RealTime();
+    m_plugin->reset();
+}
+
 Plugin::FeatureSet
 PluginSummarisingAdapter::Impl::process(const float *const *inputBuffers,
                                         RealTime timestamp)
--- a/vamp-hostsdk/PluginSummarisingAdapter.h	Fri Dec 12 14:28:42 2008 +0000
+++ b/vamp-hostsdk/PluginSummarisingAdapter.h	Fri Dec 12 16:59:47 2008 +0000
@@ -96,6 +96,8 @@
 
     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
 
+    void reset();
+
     FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
     FeatureSet getRemainingFeatures();