rt-vamp-plugin-sdk  0.3.1
Real-time Vamp plugin SDK for C++20
Public Member Functions | List of all members
rtvamp::pluginsdk::PluginExt< Self, NOutputs > Class Template Reference

Extended plugin base class with automatic parameter / program handling. More...

#include <rtvamp/pluginsdk/PluginExt.hpp>

Inheritance diagram for rtvamp::pluginsdk::PluginExt< Self, NOutputs >:
[legend]

Public Member Functions

 PluginExt (float inputSampleRate)
 
std::optional< float > getParameter (std::string_view id) const override final
 
bool setParameter (std::string_view id, float value) override final
 
std::string_view getCurrentProgram () const override final
 
bool selectProgram (std::string_view name) override final
 
virtual void onParameterChange (std::string_view id, float newValue)
 
virtual void onProgramChange (std::string_view newProgram)
 
- Public Member Functions inherited from rtvamp::pluginsdk::Plugin< NOutputs >
constexpr Plugin (float inputSampleRate)
 
virtual uint32_t getPreferredStepSize () const
 
virtual uint32_t getPreferredBlockSize () const
 
virtual OutputList getOutputDescriptors () const =0
 
virtual bool initialise (uint32_t stepSize, uint32_t blockSize)=0
 
virtual void reset ()=0
 
virtual const FeatureSetprocess (InputBuffer buffer, uint64_t nsec)=0
 
- Public Member Functions inherited from rtvamp::pluginsdk::PluginBase
virtual ~PluginBase ()=default
 

Additional Inherited Members

- Public Types inherited from rtvamp::pluginsdk::Plugin< NOutputs >
using OutputList = std::array< OutputDescriptor, NOutputs >
 List of output descriptors. More...
 
using FeatureSet = std::array< Feature, NOutputs >
 Computed features for each output. More...
 
- Public Types inherited from rtvamp::pluginsdk::PluginBase
enum  InputDomain { InputDomain::Time, InputDomain::Frequency }
 Input domain of the plugin. More...
 
using TimeDomainBuffer = std::span< const float >
 Time domain buffer. More...
 
using FrequencyDomainBuffer = std::span< const std::complex< float > >
 Frequency domain buffer (FFT) More...
 
using InputBuffer = std::variant< TimeDomainBuffer, FrequencyDomainBuffer >
 Input domain variant. More...
 
using Feature = std::vector< float >
 Feature with one or more values (defined by OutputDescriptor::binCount) More...
 
- Static Public Attributes inherited from rtvamp::pluginsdk::Plugin< NOutputs >
static constexpr uint32_t outputCount = NOutputs
 Number of outputs (defined by template parameter) More...
 
static constexpr Meta meta {}
 Required static plugin descriptor. More...
 
static constexpr std::array< ParameterDescriptor, 0 > parameters {}
 Optional parameter descriptors (default: none) More...
 
static constexpr std::array< const char *, 0 > programs {}
 Optional program list (default: none) More...
 
- Protected Member Functions inherited from rtvamp::pluginsdk::Plugin< NOutputs >
float getInputSampleRate () const noexcept
 
FeatureSetgetFeatureSet () noexcept
 
void initialiseFeatureSet ()
 

Detailed Description

template<typename Self, uint32_t NOutputs>
class rtvamp::pluginsdk::PluginExt< Self, NOutputs >

Extended plugin base class with automatic parameter / program handling.

Two template arguments must be provided:

  1. the implementation type itself to access static data (parameter descriptors / programs) (this pattern is known as the curiously recurring template pattern (CRTP))
  2. number of outputs

Assumptions:

Constructor & Destructor Documentation

◆ PluginExt()

template<typename Self , uint32_t NOutputs>
rtvamp::pluginsdk::PluginExt< Self, NOutputs >::PluginExt ( float  inputSampleRate)
inlineexplicit

Member Function Documentation

◆ getCurrentProgram()

template<typename Self , uint32_t NOutputs>
std::string_view rtvamp::pluginsdk::PluginExt< Self, NOutputs >::getCurrentProgram
finaloverridevirtual

◆ getParameter()

template<typename Self , uint32_t NOutputs>
std::optional< float > rtvamp::pluginsdk::PluginExt< Self, NOutputs >::getParameter ( std::string_view  id) const
finaloverridevirtual

◆ onParameterChange()

template<typename Self , uint32_t NOutputs>
virtual void rtvamp::pluginsdk::PluginExt< Self, NOutputs >::onParameterChange ( std::string_view  id,
float  newValue 
)
inlinevirtual

◆ onProgramChange()

template<typename Self , uint32_t NOutputs>
virtual void rtvamp::pluginsdk::PluginExt< Self, NOutputs >::onProgramChange ( std::string_view  newProgram)
inlinevirtual

◆ selectProgram()

template<typename Self , uint32_t NOutputs>
bool rtvamp::pluginsdk::PluginExt< Self, NOutputs >::selectProgram ( std::string_view  name)
finaloverridevirtual

◆ setParameter()

template<typename Self , uint32_t NOutputs>
bool rtvamp::pluginsdk::PluginExt< Self, NOutputs >::setParameter ( std::string_view  id,
float  value 
)
finaloverridevirtual

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