37#ifndef _VAMP_SDK_PLUGIN_H_
38#define _VAMP_SDK_PLUGIN_H_
143 size_t blockSize) = 0;
323 hasFixedBinCount(false),
325 hasKnownExtents(false),
330 sampleType(OneSamplePerStep),
332 hasDuration(false) { }
390 hasTimestamp(false), hasDuration(false) { }
438 virtual std::string
getType()
const {
return "Feature Extraction Plugin"; }
447 m_inputSampleRate(inputSampleRate) { }
A base class for plugins with optional configurable parameters, programs, etc.
Vamp::Plugin is a base class for plugin instance classes that provide feature extraction from audio o...
std::vector< Feature > FeatureList
virtual size_t getMaxChannelCount() const
Get the maximum supported number of input channels.
Plugin(float inputSampleRate)
std::vector< OutputDescriptor > OutputList
virtual size_t getPreferredStepSize() const
Get the preferred step size (window increment – the distance in sample frames between the start frame...
std::map< int, FeatureList > FeatureSet
virtual std::string getType() const
Used to distinguish between Vamp::Plugin and other potential sibling subclasses of PluginBase.
float getInputSampleRate() const
Retrieve the input sample rate set on construction.
virtual void reset()=0
Reset the plugin after use, to prepare it for another clean run.
virtual size_t getMinChannelCount() const
Get the minimum supported number of input channels.
virtual OutputList getOutputDescriptors() const =0
Get the outputs of this plugin.
virtual InputDomain getInputDomain() const =0
Get the plugin's required input domain.
virtual size_t getPreferredBlockSize() const
Get the preferred block size (window size – the number of sample frames passed in each block to the p...
virtual FeatureSet process(const float *const *inputBuffers, RealTime timestamp)=0
Process a single block of input data.
virtual FeatureSet getRemainingFeatures()=0
After all blocks have been processed, calculate and return any remaining features derived from the co...
virtual bool initialise(size_t inputChannels, size_t stepSize, size_t blockSize)=0
Initialise a plugin to prepare it for use with the given number of input channels,...
#define _VAMP_SDK_PLUGSPACE_BEGIN(h)
#define _VAMP_SDK_PLUGSPACE_END(h)
bool hasDuration
True if an output feature has a specified duration.
std::vector< float > values
Results for a single sample of this feature.
std::string label
Label for the sample of this feature.
bool hasTimestamp
True if an output feature has its own timestamp.
RealTime timestamp
Timestamp of the output feature.
RealTime duration
Duration of the output feature.
SampleType sampleType
Positioning in time of the output results.
bool isQuantized
True if the output values are quantized to a particular resolution.
std::vector< std::string > binNames
The (human-readable) names of each of the bins, if appropriate.
float quantizeStep
Quantization resolution of the output values (e.g.
float maxValue
Maximum value of the results in the output.
std::string unit
The unit of the output, in human-readable form.
bool hasDuration
True if the returned results for this output are known to have a duration field.
std::string name
The human-readable name of the output.
@ OneSamplePerStep
Results from each process() align with that call's block start.
@ FixedSampleRate
Results are evenly spaced in time (sampleRate specified below)
float minValue
Minimum value of the results in the output.
float sampleRate
Sample rate of the output results, as samples per second.
std::string identifier
The name of the output, in computer-usable form.
bool hasKnownExtents
True if the results in each output bin fall within a fixed numeric range (minimum and maximum values)...
bool hasFixedBinCount
True if the output has the same number of values per sample for every output sample.
std::string description
A human-readable short text describing the output.
size_t binCount
The number of values per result of the output.
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...