Mercurial > hg > vamp-plugin-sdk
changeset 176:adfb6348881c
* add getSummaryForAllOutputs
author | cannam |
---|---|
date | Tue, 05 Aug 2008 15:36:40 +0000 |
parents | 4811fb599a97 |
children | 2258794251be |
files | vamp-sdk/hostext/PluginSummarisingAdapter.cpp vamp-sdk/hostext/PluginSummarisingAdapter.h |
diffstat | 2 files changed, 34 insertions(+), 5 deletions(-) [+] |
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)
--- 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;