PluginSummarisingAdapter.h
Go to the documentation of this file.
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Vamp
An API for audio analysis and feature extraction plugins.
Centre for Digital Music, Queen Mary, University of London.
Copyright 2006-2009 Chris Cannam and QMUL.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the names of the Centre for
Digital Music; Queen Mary, University of London; and Chris Cannam
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization.
*/
#ifndef _VAMP_PLUGIN_SUMMARISING_ADAPTER_H_
#define _VAMP_PLUGIN_SUMMARISING_ADAPTER_H_
#include "hostguard.h"
#include "PluginWrapper.h"
#include <set>
_VAMP_SDK_HOSTSPACE_BEGIN(PluginSummarisingAdapter.h)
namespace Vamp {
namespace HostExt {
class PluginSummarisingAdapter : public PluginWrapper
{
public:
PluginSummarisingAdapter(Plugin *plugin);
virtual ~PluginSummarisingAdapter();
bool initialise(size_t channels, size_t stepSize, size_t blockSize);
void reset();
FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
FeatureSet getRemainingFeatures();
typedef std::set<RealTime> SegmentBoundaries;
void setSummarySegmentBoundaries(const SegmentBoundaries &);
enum SummaryType {
Minimum = 0,
Maximum = 1,
Mean = 2,
Median = 3,
Mode = 4,
Sum = 5,
Variance = 6,
StandardDeviation = 7,
Count = 8,
UnknownSummaryType = 999
};
enum AveragingMethod {
SampleAverage = 0,
ContinuousTimeAverage = 1
};
FeatureList getSummaryForOutput(int output,
SummaryType type,
AveragingMethod method = SampleAverage);
FeatureSet getSummaryForAllOutputs(SummaryType type,
AveragingMethod method = SampleAverage);
protected:
class Impl;
Impl *m_impl;
};
}
}
_VAMP_SDK_HOSTSPACE_END(PluginSummarisingAdapter.h)
#endif
PluginWrapper.h
Vamp::HostExt::PluginSummarisingAdapter::setSummarySegmentBoundaries
void setSummarySegmentBoundaries(const SegmentBoundaries &)
Specify a series of segment boundaries, such that one summary will be returned for each of the contig...
Vamp::HostExt::PluginSummarisingAdapter::initialise
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Initialise a plugin to prepare it for use with the given number of input channels,...
Vamp::HostExt::PluginSummarisingAdapter::AveragingMethod
AveragingMethod
AveragingMethod indicates how the adapter should handle average-based summaries of features whose res...
Definition PluginSummarisingAdapter.h:158
Vamp::HostExt::PluginSummarisingAdapter::ContinuousTimeAverage
@ ContinuousTimeAverage
Definition PluginSummarisingAdapter.h:160
Vamp::HostExt::PluginSummarisingAdapter::SampleAverage
@ SampleAverage
Definition PluginSummarisingAdapter.h:159
Vamp::HostExt::PluginSummarisingAdapter::PluginSummarisingAdapter
PluginSummarisingAdapter(Plugin *plugin)
Construct a PluginSummarisingAdapter wrapping the given plugin.
Vamp::HostExt::PluginSummarisingAdapter::process
FeatureSet process(const float *const *inputBuffers, RealTime timestamp)
Process a single block of input data.
Vamp::HostExt::PluginSummarisingAdapter::reset
void reset()
Reset the plugin after use, to prepare it for another clean run.
Vamp::HostExt::PluginSummarisingAdapter::~PluginSummarisingAdapter
virtual ~PluginSummarisingAdapter()
Vamp::HostExt::PluginSummarisingAdapter::SegmentBoundaries
std::set< RealTime > SegmentBoundaries
Definition PluginSummarisingAdapter.h:105
Vamp::HostExt::PluginSummarisingAdapter::getSummaryForOutput
FeatureList getSummaryForOutput(int output, SummaryType type, AveragingMethod method=SampleAverage)
Return summaries of the features that were returned on the given output, using the given SummaryType ...
Vamp::HostExt::PluginSummarisingAdapter::getSummaryForAllOutputs
FeatureSet getSummaryForAllOutputs(SummaryType type, AveragingMethod method=SampleAverage)
Return summaries of the features that were returned on all of the plugin's outputs,...
Vamp::HostExt::PluginSummarisingAdapter::getRemainingFeatures
FeatureSet getRemainingFeatures()
After all blocks have been processed, calculate and return any remaining features derived from the co...
Vamp::HostExt::PluginSummarisingAdapter::m_impl
Impl * m_impl
Definition PluginSummarisingAdapter.h:189
Vamp::HostExt::PluginSummarisingAdapter::SummaryType
SummaryType
Definition PluginSummarisingAdapter.h:122
Vamp::HostExt::PluginSummarisingAdapter::Mode
@ Mode
Definition PluginSummarisingAdapter.h:127
Vamp::HostExt::PluginSummarisingAdapter::Count
@ Count
Definition PluginSummarisingAdapter.h:131
Vamp::HostExt::PluginSummarisingAdapter::Minimum
@ Minimum
Definition PluginSummarisingAdapter.h:123
Vamp::HostExt::PluginSummarisingAdapter::StandardDeviation
@ StandardDeviation
Definition PluginSummarisingAdapter.h:130
Vamp::HostExt::PluginSummarisingAdapter::Sum
@ Sum
Definition PluginSummarisingAdapter.h:128
Vamp::HostExt::PluginSummarisingAdapter::Median
@ Median
Definition PluginSummarisingAdapter.h:126
Vamp::HostExt::PluginSummarisingAdapter::Maximum
@ Maximum
Definition PluginSummarisingAdapter.h:124
Vamp::HostExt::PluginSummarisingAdapter::Mean
@ Mean
Definition PluginSummarisingAdapter.h:125
Vamp::HostExt::PluginSummarisingAdapter::Variance
@ Variance
Definition PluginSummarisingAdapter.h:129
Vamp::HostExt::PluginSummarisingAdapter::UnknownSummaryType
@ UnknownSummaryType
Definition PluginSummarisingAdapter.h:133
Vamp::HostExt::PluginWrapper::PluginWrapper
PluginWrapper(Plugin *plugin)
Vamp::Plugin::FeatureList
std::vector< Feature > FeatureList
Definition vamp-sdk/Plugin.h:393
Vamp::Plugin::Plugin
Plugin(float inputSampleRate)
Definition vamp-sdk/Plugin.h:446
Vamp::Plugin::FeatureSet
std::map< int, FeatureList > FeatureSet
Definition vamp-sdk/Plugin.h:395
hostguard.h
_VAMP_SDK_HOSTSPACE_END
#define _VAMP_SDK_HOSTSPACE_END(h)
Definition hostguard.h:59
_VAMP_SDK_HOSTSPACE_BEGIN
#define _VAMP_SDK_HOSTSPACE_BEGIN(h)
Definition hostguard.h:56
Vamp
Definition FFT.h:43
Vamp::RealTime
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...
Definition vamp-sdk/RealTime.h:67