Logo Search packages:      
Sourcecode: ardour version File versions  Download package

Vamp::Plugin Class Reference

#include <vamp-sdk/Plugin.h>

Inheritance diagram for Vamp::Plugin:

Vamp::PluginBase AmplitudeFollower PercussionOnsetDetector SpectralCentroid Vamp::HostExt::PluginWrapper Vamp::PluginHostAdapter ZeroCrossing Vamp::HostExt::PluginBufferingAdapter Vamp::HostExt::PluginChannelAdapter Vamp::HostExt::PluginInputDomainAdapter Vamp::HostExt::PluginSummarisingAdapter

List of all members.


Detailed Description

Vamp::Plugin is a base class for plugin instance classes that provide feature extraction from audio or related data.

In most cases, the input will be audio and the output will be a stream of derived data at a lower sampling resolution than the input.

Note that this class inherits several abstract methods from PluginBase. These must be implemented by the subclass.

PLUGIN LIFECYCLE

Feature extraction plugins are managed differently from real-time plugins (such as VST effects). The main difference is that the parameters for a feature extraction plugin are configured before the plugin is used, and do not change during use.

1. Host constructs the plugin, passing it the input sample rate. The plugin may do basic initialisation, but should not do anything computationally expensive at this point. You must make sure your plugin is cheap to construct, otherwise you'll seriously affect the startup performance of almost all hosts. If you have serious initialisation to do, the proper place is in initialise() (step 5).

2. Host may query the plugin's available outputs.

3. Host queries programs and parameter descriptors, and may set some or all of them. Parameters that are not explicitly set should take their default values as specified in the parameter descriptor. When a program is set, the parameter values may change and the host will re-query them to check.

4. Host queries the preferred step size, block size and number of channels. These may all vary depending on the parameter values. (Note however that you cannot make the number of distinct outputs dependent on parameter values.)

5. Plugin is properly initialised with a call to initialise. This fixes the step size, block size, and number of channels, as well as all of the parameter and program settings. If the values passed in to initialise do not match the plugin's advertised preferred values from step 4, the plugin may refuse to initialise and return false (although if possible it should accept the new values). Any computationally expensive setup code should take place here.

6. Host finally checks the number of values, resolution, extents etc per output (which may vary depending on the number of channels, step size and block size as well as the parameter values).

7. Host will repeatedly call the process method to pass in blocks of input data. This method may return features extracted from that data (if the plugin is causal).

8. Host will call getRemainingFeatures exactly once, after all the input data has been processed. This may return any non-causal or leftover features.

9. At any point after initialise was called, the host may optionally call the reset method and restart processing. (This does not mean it can change the parameters, which are fixed from initialise until destruction.)

A plugin does not need to handle the case where setParameter or selectProgram is called after initialise has been called. It's the host's responsibility not to do that. Similarly, the plugin may safely assume that initialise is called no more than once.

Definition at line 124 of file Plugin.h.


Public Types

typedef std::vector< Feature > FeatureList
typedef std::map< int,
FeatureList > 
FeatureSet
enum  InputDomain { TimeDomain, FrequencyDomain }
typedef std::vector
< OutputDescriptor > 
OutputList
typedef std::vector
< ParameterDescriptor > 
ParameterList
typedef std::vector< std::string > ProgramList

Public Member Functions

virtual std::string getCopyright () const =0
virtual std::string getCurrentProgram () const
virtual std::string getDescription () const =0
virtual std::string getIdentifier () const =0
virtual InputDomain getInputDomain () const =0
virtual std::string getMaker () const =0
virtual size_t getMaxChannelCount () const
virtual size_t getMinChannelCount () const
virtual std::string getName () const =0
virtual OutputList getOutputDescriptors () const =0
virtual float getParameter (std::string) const
virtual ParameterList getParameterDescriptors () const
virtual int getPluginVersion () const =0
virtual size_t getPreferredBlockSize () const
virtual size_t getPreferredStepSize () const
virtual ProgramList getPrograms () const
virtual FeatureSet getRemainingFeatures ()=0
virtual std::string getType () const
virtual unsigned int getVampApiVersion () const
virtual bool initialise (size_t inputChannels, size_t stepSize, size_t blockSize)=0
virtual FeatureSet process (const float *const *inputBuffers, RealTime timestamp)=0
virtual void reset ()=0
virtual void selectProgram (std::string)
virtual void setParameter (std::string, float)

Protected Member Functions

 Plugin (float inputSampleRate)

Protected Attributes

float m_inputSampleRate

Classes

struct  Feature
struct  OutputDescriptor

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index