rt-vamp-plugin-sdk
0.3.1
Real-time Vamp plugin SDK for C++20
|
Base class to implement feature extraction plugins. More...
#include <rtvamp/pluginsdk/Plugin.hpp>
Classes | |
struct | Meta |
Static plugin descriptor. More... | |
Public Types | |
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... | |
Public Member Functions | |
constexpr | Plugin (float inputSampleRate) |
virtual std::optional< float > | getParameter (std::string_view id) const |
virtual bool | setParameter (std::string_view id, float value) |
virtual std::string_view | getCurrentProgram () const |
virtual bool | selectProgram (std::string_view name) |
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 FeatureSet & | process (InputBuffer buffer, uint64_t nsec)=0 |
Public Member Functions inherited from rtvamp::pluginsdk::PluginBase | |
virtual | ~PluginBase ()=default |
Static Public Attributes | |
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 | |
float | getInputSampleRate () const noexcept |
FeatureSet & | getFeatureSet () noexcept |
void | initialiseFeatureSet () |
Base class to implement feature extraction plugins.
The number of outputs is provided as a template parameter. This allows fixed-sized arrays for both the process results (FeatureSet) and output descriptors (OutputList) and therefore enforce the requirement of matching output size at compile time.
Static plugin descriptors are provided as static constexpr variables to generate the C API descriptor at compile time. Dynamic plugin descriptors and methods are defined as (pure) virtual functions.
using rtvamp::pluginsdk::Plugin< NOutputs >::FeatureSet = std::array<Feature, NOutputs> |
Computed features for each output.
using rtvamp::pluginsdk::Plugin< NOutputs >::OutputList = std::array<OutputDescriptor, NOutputs> |
List of output descriptors.
|
inlineexplicitconstexpr |
|
inlinevirtual |
Reimplemented in rtvamp::pluginsdk::PluginExt< Self, NOutputs >.
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
pure virtual |
|
inlinevirtual |
Reimplemented in rtvamp::pluginsdk::PluginExt< Self, NOutputs >.
|
inlinevirtual |
|
inlinevirtual |
|
pure virtual |
|
protected |
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Reimplemented in rtvamp::pluginsdk::PluginExt< Self, NOutputs >.
|
inlinevirtual |
Reimplemented in rtvamp::pluginsdk::PluginExt< Self, NOutputs >.
|
staticconstexpr |
Required static plugin descriptor.
|
staticconstexpr |
Number of outputs (defined by template parameter)
|
staticconstexpr |
Optional parameter descriptors (default: none)
|
staticconstexpr |
Optional program list (default: none)