diff vamp-sdk/hostext/PluginSummarisingAdapter.cpp @ 176:adfb6348881c

* add getSummaryForAllOutputs
author cannam
date Tue, 05 Aug 2008 15:36:40 +0000
parents 4811fb599a97
children 2258794251be
line wrap: on
line diff
--- a/vamp-sdk/hostext/PluginSummarisingAdapter.cpp	Tue Aug 05 15:15:37 2008 +0000
+++ b/vamp-sdk/hostext/PluginSummarisingAdapter.cpp	Tue Aug 05 15:36:40 2008 +0000
@@ -54,7 +54,8 @@
 
     void setSummarySegmentBoundaries(const SegmentBoundaries &);
 
-    FeatureList getSummary(int output, SummaryType type);
+    FeatureList getSummaryForOutput(int output, SummaryType type);
+    FeatureSet getSummaryForAllOutputs(SummaryType type);
 
 protected:
     Plugin *m_plugin;
@@ -119,9 +120,15 @@
 }
 
 Plugin::FeatureList
-PluginSummarisingAdapter::getSummary(int output, SummaryType type)
+PluginSummarisingAdapter::getSummaryForOutput(int output, SummaryType type)
 {
-    return m_impl->getSummary(output, type);
+    return m_impl->getSummaryForOutput(output, type);
+}
+
+Plugin::FeatureSet
+PluginSummarisingAdapter::getSummaryForAllOutputs(SummaryType type)
+{
+    return m_impl->getSummaryForAllOutputs(type);
 }
 
 PluginSummarisingAdapter::Impl::Impl(Plugin *plugin, float inputSampleRate) :
@@ -152,7 +159,7 @@
 }
 
 Plugin::FeatureList
-PluginSummarisingAdapter::Impl::getSummary(int output, SummaryType type)
+PluginSummarisingAdapter::Impl::getSummaryForOutput(int output, SummaryType type)
 {
     //!!! need to ensure that this is only called after processing is
     //!!! complete (at the moment processing is "completed" in the
@@ -225,6 +232,17 @@
     return fl;
 }
 
+Plugin::FeatureSet
+PluginSummarisingAdapter::Impl::getSummaryForAllOutputs(SummaryType type)
+{
+    FeatureSet fs;
+    for (OutputSummarySegmentMap::const_iterator i = m_summaries.begin();
+         i != m_summaries.end(); ++i) {
+        fs[i->first] = getSummaryForOutput(i->first, type);
+    }
+    return fs;
+}
+
 void
 PluginSummarisingAdapter::Impl::accumulate(const FeatureSet &fs,
                                            RealTime timestamp)