# HG changeset patch # User cannam # Date 1217950600 0 # Node ID adfb6348881c6a4f768254c48e39a908b85c26cf # Parent 4811fb599a97538e07505b7803d73348732c6812 * add getSummaryForAllOutputs diff -r 4811fb599a97 -r adfb6348881c vamp-sdk/hostext/PluginSummarisingAdapter.cpp --- 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) diff -r 4811fb599a97 -r adfb6348881c vamp-sdk/hostext/PluginSummarisingAdapter.h --- a/vamp-sdk/hostext/PluginSummarisingAdapter.h Tue Aug 05 15:15:37 2008 +0000 +++ b/vamp-sdk/hostext/PluginSummarisingAdapter.h Tue Aug 05 15:36:40 2008 +0000 @@ -51,6 +51,16 @@ PluginSummarisingAdapter(Plugin *plugin); // I take ownership of plugin virtual ~PluginSummarisingAdapter(); + //!!! perhaps it should return the summaries as if they were the + //!!! original features? if so, it will need to be told in + //!!! advance which summaries you want. and that won't work if + //!!! you want more than one. so, probably, no. + + //!!! however, it is useful to have results in the same FeatureSet + //!!! structure as the original results -- rather than a single + //!!! FeatureList. perhaps even useful to get a summary for all + //!!! outputs? + FeatureSet process(const float *const *inputBuffers, RealTime timestamp); FeatureSet getRemainingFeatures(); @@ -69,7 +79,8 @@ Count }; - FeatureList getSummary(int output, SummaryType type); + FeatureList getSummaryForOutput(int output, SummaryType type); + FeatureSet getSummaryForAllOutputs(SummaryType type); protected: class Impl;