ASPiK SDK
|
The PluginBase object is the base class for the Plugin Core object. More...
#include <pluginbase.h>
Public Member Functions | |
PluginBase () | |
PluginBase constructor. | |
virtual | ~PluginBase () |
PluginBase destructor. | |
virtual bool | processAudioFrame (ProcessFrameInfo &processFrameInfo)=0 |
virtual bool | updatePluginParameter (int32_t controlID, double controlValue, ParameterUpdateInfo ¶mInfo)=0 |
virtual bool | updatePluginParameterNormalized (int32_t controlID, double normalizedValue, ParameterUpdateInfo ¶mInfo)=0 |
virtual bool | postUpdatePluginParameter (int32_t controlID, double controlValue, ParameterUpdateInfo ¶mInfo)=0 |
virtual bool | preProcessAudioBuffers (ProcessBufferInfo &processInfo)=0 |
virtual bool | postProcessAudioBuffers (ProcessBufferInfo &processInfo)=0 |
virtual bool | reset (ResetInfo &resetInfo) |
initialize object for a new run of audio; called just before audio streams | |
virtual bool | initialize (PluginInfo &_pluginInfo) |
one-time initialize function called after object creation and before the first reset( ) call | |
void | syncInBoundVariables () |
initialize object for a new run of audio; called just before audio streams | |
virtual bool | processAudioBuffers (ProcessBufferInfo &processInfo) |
THE buffer processing function. | |
virtual bool | preProcessAudioBlock (IMidiEventQueue *midiEventQueue=nullptr) |
virtual bool | processAudioBlock (ProcessBlockInfo &processBlockInfo) |
bool | updateOutBoundVariables () |
copy newly updated metering variables into GUI parameters for display | |
virtual bool | guiParameterChanged (int32_t controlID, double actualValue) |
virtual bool | processMessage (MessageInfo &messageInfo) |
virtual bool | processMIDIEvent (midiEvent &event) |
bool | doVST3SAAUpdates () |
ONLY for VST3 plugins with sample accurate automation enabled. | |
bool | doParameterSmoothing () |
combines parameter smoothing and VST3 sample accurate updates | |
virtual bool | setVectorJoystickParameters (const VectorJoystickData &vectorJoysickData) |
int32_t | addPluginParameter (PluginParameter *piParam, double sampleRate=44100) |
adds a new plugin parameter to the parameter map | |
void | setParamAuxAttribute (uint32_t controlID, const AuxParameterAttribute &auxAttribute) |
adds an auxilliary attribute to the plugin parameter; you can have as many auxilliary attributes as you like for each parameter. | |
size_t | getPluginParameterCount () |
PluginParameter * | getPluginParameterByIndex (int32_t index) |
get a parameter by index location in vector or array | |
PluginParameter * | getPluginParameterByControlID (int32_t controlID) |
get a parameter by control ID - uses map (slowest) | |
PluginParameter * | getNextParameterOfType (int32_t &startIndex, controlVariableType controlType) |
get a parameter by type | |
double | getPIParamValueDouble (int32_t controlID) |
value-as-double | |
float | getPIParamValueFloat (int32_t controlID) |
value-as-float | |
int | getPIParamValueInt (int32_t controlID) |
value-as-int | |
uint32_t | getPIParamValueUInt (int32_t controlID) |
value-as-uint | |
bool | hasProToolsGRMeters () |
checks for at least one meter parameter that has the pro tools GR meter flag set | |
double | getProToolsGRValue () |
pro tools GR meter is only ever observed to be single meter; this merges all meter values for meters designated as Pro Tools meter | |
uint32_t | addSupportedIOCombination (ChannelIOConfig ioConfig) |
add a new I/O configuration pair | |
uint32_t | addSupportedAuxIOCombination (ChannelIOConfig ioConfig) |
add a new I/O configuration pair | |
uint32_t | getNumSupportedIOCombinations () |
get I/O channel pair count | |
bool | hasSupportedInputChannelFormat (uint32_t channelFormat) |
check to see if plugin support a given input channel format | |
bool | hasSupportedOutputChannelFormat (uint32_t channelFormat) |
check to see if plugin support a given output channel format | |
int32_t | getChannelInputFormat (uint32_t ioConfigIndex) |
get input cj | |
int32_t | getChannelOutputFormat (uint32_t ioConfigIndex) |
get I/O channel pair count | |
uint32_t | getInputChannelCount (uint32_t ioConfigIndex) |
get the number of input channels for a configuration at a given index | |
uint32_t | getOutputChannelCount (uint32_t ioConfigIndex) |
get the number of output channels for a configuration at a given index | |
uint32_t | getDefaultChannelIOConfigForChannelCount (uint32_t channelCount) |
get the configuration (e.g. kCFStereo) for a given channel count; mainly for AU that does not discriminate between formats with same channel counts (e.g. Sony 7.1 vs DTS 7.1 which have same channel count) | |
void | setPIParamValue (uint32_t _controlID, double _controlValue) |
set a parameter's value with the actual value (as double) | |
double | setPIParamValueNormalized (uint32_t _controlID, double _normalizedValue, bool applyTaper=true) |
set a parameter's value with the normalied value (as double) | |
bool | updatePIParamBoundValue (uint32_t _controlID) |
update a bound-variable with a parameter's control value; this is the essence of the variable binding operation | |
void | clearUpdateGUIParameters (std::vector< GUIParameter * > &guiParameters) |
delete GUI update structures in a list | |
std::vector< PluginParameter * > * | makePluginParameterVectorCopy (bool disableSmoothing=true) |
copies parameters into a new list; used to initialize the GUI - note that this makes true, disconnected copies | |
bool | initPresetParameters (std::vector< PresetParameter > &presetParameters, bool disableSmoothing=true) |
creates the preset parameter ID/Value pair PresetParameter objects and adds them to supplied list | |
bool | setPresetParameter (std::vector< PresetParameter > &presetParameters, uint32_t _controlID, double _controlValue) |
set a new value for a preset | |
void | setPluginHostConnector (IPluginHostConnector *_pluginHostConnector) |
store the plugin host interface pointer: this pointer will never go out of scope or be invalid once stored! | |
size_t | getPresetCount () |
get number of stored presets | |
const char * | getPresetName (uint32_t index) |
gets name as a const char* for connecting with all APIs at some level | |
size_t | addPreset (PresetInfo *preset) |
add a new preset | |
void | removePreset (uint32_t index) |
remove a preset - NOTE: does not delete object | |
void | removeAllPresets () |
remove all presets - NOTE: does not delete objects | |
PresetInfo * | getPreset (uint32_t index) |
get a preset | |
void | initPluginParameterArray () |
called at the end of the initialization phase, this function creates the various non map-versions of the parameter lists and initializes the parameters; this is the final step of construction | |
bool | compareSelectedString (int32_t controlID, const char *compareString) |
helper function to compare a PluginParameter's value with a string version of it | |
bool | hasSidechain () |
Description query: sidechain. | |
bool | wantsMIDI () |
Description query: MIDI. | |
bool | hasCustomGUI () |
Description query: has GUI. | |
double | getLatencyInSamples () |
Description query: latency. | |
double | getTailTimeInMSec () |
Description query: tail time. | |
bool | wantsInfiniteTailVST3 () |
Description query: infinite tail (VST3 only) | |
const char * | getPluginName () |
Description query: name. | |
const char * | getShortPluginName () |
Description query: short name (AAX) | |
const char * | getVendorName () |
Description query:vendor name. | |
uint32_t | getPluginType () |
Description query: plugin type. | |
double | getSampleRate () |
Description query: sample rate. | |
int | getFourCharCode () |
Description query: 4-char code. | |
const uint32_t | getAAXManufacturerID () |
Description query: AAX Man ID. | |
const uint32_t | getAAXProductID () |
Description query: AAX Prod ID. | |
const char * | getAAXBundleID () |
Description query: AAX Bundle ID. | |
const char * | getAAXEffectID () |
Description query: AAX Effect ID. | |
uint32_t | getAAXPluginCategory () |
Description query: AAX Category. | |
const char * | getVST3_FUID () |
Description query: VST3 FUID. | |
bool | wantsVST3SampleAccurateAutomation () |
Description query: VST Sample Accurate Automation. | |
uint32_t | getVST3SampleAccuracyGranularity () |
Description query: VST Sample Accurate Automation granularity. | |
const char * | getVST3BundleID () |
Description query: VST3 Bundle ID. | |
const char * | getAUBundleID () |
Description query: AU Bundle ID. | |
const char * | getAUBundleName () |
Description query: AU Bundle Name. | |
Protected Types | |
typedef std::map< uint32_t, PluginParameter * > | pluginParameterControlIDMap |
map version of parameter list | |
Protected Attributes | |
PluginDescriptor | pluginDescriptor |
description strings | |
APISpecificInfo | apiSpecificInfo |
description strings, API specific | |
AudioProcDescriptor | audioProcDescriptor |
current audio processing description | |
PluginInfo | pluginInfo |
info about the DLL (component) itself, includes path to DLL | |
float | inputFrame [MAX_CHANNEL_COUNT] |
input array for frame processing | |
float | outputFrame [MAX_CHANNEL_COUNT] |
output array for frame processing | |
float | auxInputFrame [MAX_CHANNEL_COUNT] |
aux input array for frame processing | |
float | auxOutputFrame [MAX_CHANNEL_COUNT] |
aux output array for frame processing | |
ProcessBlockInfo | processBlockInfo |
PluginParameter ** | pluginParameterArray = nullptr |
old-fashioned C-arrays of pointers for ultra-fast access for real-time audio processing | |
uint32_t | numPluginParameters = 0 |
total number of parameters | |
PluginParameter ** | VSTSAAPluginParameters = nullptr |
old-fashioned C-arrays of pointers for smoothable parameters | |
uint32_t | numVSTSAAPluginParameters = 0 |
number of smoothable parameters only | |
PluginParameter ** | smoothingPluginParameters = nullptr |
old-fashioned C-arrays of pointers for smoothable parameters | |
uint32_t | numSmoothingPluginParameters = 0 |
number of smoothable parameters only | |
PluginParameter ** | outboundPluginParameters = nullptr |
old-fashioned C-arrays of pointers for outbound (meter) parameters | |
uint32_t | numOutboundPluginParameters = 0 |
total number of outbound (meter) parameters | |
std::vector< PluginParameter * > | pluginParameters |
vector version of parameter list | |
pluginParameterControlIDMap | pluginParameterMap |
member map of parameter list | |
IPluginHostConnector * | pluginHostConnector = nullptr |
created and destroyed on host | |
std::vector< PresetInfo * > | presets |
preset list | |
The PluginBase object is the base class for the Plugin Core object.
PluginBase Operations:
PluginBase::PluginBase | ( | ) |
PluginBase constructor.
Operation:
|
virtual |
PluginBase destructor.
Operation:
int32_t PluginBase::addPluginParameter | ( | PluginParameter * | piParam, |
double | sampleRate = 44100 |
||
) |
adds a new plugin parameter to the parameter map
helper function to add a new plugin parameter to the variety of lists
NOTE:
piParam | pointer to a newly created plugin parameter |
sampleRate | the sample rate, needed to initialize the smoother |
size_t PluginBase::addPreset | ( | PresetInfo * | preset | ) |
add a new preset
add preset
preset | a PresetInfo strucutre that describes the preset |
uint32_t PluginBase::addSupportedAuxIOCombination | ( | ChannelIOConfig | ioConfig | ) |
add a new I/O configuration pair
helper to easily add new Aux (sidechain) I/O combination
ioConfig | structure containing one aux input/output channel pair |
uint32_t PluginBase::addSupportedIOCombination | ( | ChannelIOConfig | ioConfig | ) |
add a new I/O configuration pair
helper to easily add new I/O combination
ioConfig | structure containing one input/output channel pair |
void PluginBase::clearUpdateGUIParameters | ( | std::vector< GUIParameter * > & | guiParameters | ) |
delete GUI update structures in a list
clears the current cache of GUI parameters for updating (this is part of the GUI update messaging and NOT part of variable binding)
guiParameters | the list to clear |
bool PluginBase::compareSelectedString | ( | int32_t | controlID, |
const char * | compareString | ||
) |
helper function to compare a PluginParameter's value with a string version of it
compare param value as string
controlID | the control ID of the parameter to test |
compareString | the string to test against the parameter's value (as string) |
bool PluginBase::doParameterSmoothing | ( | ) |
combines parameter smoothing and VST3 sample accurate updates
perform parameter smoothing (if no VST3 SAA updates were done)
NOTE:
true = this is called from smoothing operation, false = NOT VST sample accurate update
bool PluginBase::doVST3SAAUpdates | ( | ) |
ONLY for VST3 plugins with sample accurate automation enabled.
perform\VST3 sample accurate upates
false = this is NOT called from smoothing operation, true: this is a VST sample accurate update
|
inline |
Description query: AAX Bundle ID.
|
inline |
Description query: AAX Effect ID.
|
inline |
Description query: AAX Man ID.
|
inline |
Description query: AAX Category.
|
inline |
Description query: AAX Prod ID.
|
inline |
Description query: AU Bundle ID.
|
inline |
Description query: AU Bundle Name.
|
inline |
get input cj
|
inline |
get I/O channel pair count
|
inline |
get the configuration (e.g. kCFStereo) for a given channel count; mainly for AU that does not discriminate between formats with same channel counts (e.g. Sony 7.1 vs DTS 7.1 which have same channel count)
channelCount | number of channels (e.g. 2) |
|
inline |
Description query: 4-char code.
uint32_t PluginBase::getInputChannelCount | ( | uint32_t | ioConfigIndex | ) |
get the number of input channels for a configuration at a given index
query input channels
ioConfigIndex | of the configuration in our list |
|
inline |
Description query: latency.
PluginParameter * PluginBase::getNextParameterOfType | ( | int32_t & | startIndex, |
controlVariableType | controlType | ||
) |
get a parameter by type
get a parameter by type - used to find all meter variables for writing to GUI
startIndex | current start index in array (vector or old-fashioned C-array) |
controlType | type of linked variable (float, double, meter,...) |
|
inline |
get I/O channel pair count
uint32_t PluginBase::getOutputChannelCount | ( | uint32_t | ioConfigIndex | ) |
get the number of output channels for a configuration at a given index
query output channels
ioConfigIndex | of the configuration in our list |
double PluginBase::getPIParamValueDouble | ( | int32_t | controlID | ) |
value-as-double
get a parameter's variable as double
controlID | control ID of parameter |
float PluginBase::getPIParamValueFloat | ( | int32_t | controlID | ) |
value-as-float
get a parameter's variable as float
controlID | control ID of parameter |
int PluginBase::getPIParamValueInt | ( | int32_t | controlID | ) |
value-as-int
get a parameter's variable as int
controlID | control ID of parameter |
uint32_t PluginBase::getPIParamValueUInt | ( | int32_t | controlID | ) |
value-as-uint
get a parameter's variable as UINT
controlID | control ID of parameter |
|
inline |
Description query: name.
|
inline |
get a parameter by control ID - uses map (slowest)
controlID | the control ID of the parameter |
|
inline |
get a parameter by index location in vector or array
index | the index in the array |
|
inline |
returns number of parameters in our list
|
inline |
Description query: plugin type.
PresetInfo * PluginBase::getPreset | ( | uint32_t | index | ) |
get a preset
get a preset pointner
|
inline |
get number of stored presets
const char * PluginBase::getPresetName | ( | uint32_t | index | ) |
gets name as a const char* for connecting with all APIs at some level
get preset name
index | index of preset |
double PluginBase::getProToolsGRValue | ( | ) |
pro tools GR meter is only ever observed to be single meter; this merges all meter values for meters designated as Pro Tools meter
query for Pro Tools meter value
|
inline |
Description query: sample rate.
|
inline |
Description query: short name (AAX)
|
inline |
Description query: tail time.
|
inline |
Description query:vendor name.
|
inline |
Description query: VST3 FUID.
|
inline |
Description query: VST3 Bundle ID.
|
inline |
Description query: VST Sample Accurate Automation granularity.
|
inlinevirtual |
notification that a GUI parameter changed. NOT for updating internal states or variables; unused at base class level
Reimplemented in PluginCore.
|
inline |
Description query: has GUI.
bool PluginBase::hasProToolsGRMeters | ( | ) |
checks for at least one meter parameter that has the pro tools GR meter flag set
query for Pro Tools meter
|
inline |
Description query: sidechain.
bool PluginBase::hasSupportedInputChannelFormat | ( | uint32_t | channelFormat | ) |
check to see if plugin support a given input channel format
query input format
channelFormat | the format to test (e.g. kCFStereo) |
bool PluginBase::hasSupportedOutputChannelFormat | ( | uint32_t | channelFormat | ) |
check to see if plugin support a given output channel format
query output format
channelFormat | the format to test (e.g. kCFStereo) |
|
virtual |
one-time initialize function called after object creation and before the first reset( ) call
one-time post creation init function; pluginInfo contains path to this plugin
Operation:
Reimplemented in PluginCore.
void PluginBase::initPluginParameterArray | ( | ) |
called at the end of the initialization phase, this function creates the various non map-versions of the parameter lists
and initializes the parameters; this is the final step of construction
prepare all parameter lists
bool PluginBase::initPresetParameters | ( | std::vector< PresetParameter > & | presetParameters, |
bool | disableSmoothing = true |
||
) |
creates the preset parameter ID/Value pair PresetParameter objects and adds them to supplied list
setup the preset list
presetParameters | list to add presets to |
disableSmoothing | turn off smoothing (reserved for future use) |
std::vector< PluginParameter * > * PluginBase::makePluginParameterVectorCopy | ( | bool | disableSmoothing = true | ) |
copies parameters into a new list; used to initialize the GUI - note that this makes true, disconnected copies
copies the current plugin list into another list
disableSmoothing | turn off smoothing in copied parameters |
|
pure virtual |
pure virtual function: do any extra work that requires the buffer to be completely processed first
Implemented in PluginCore.
|
pure virtual |
pure virtual function: do any post-update processing (cooking) of data
Implemented in PluginCore.
|
inlinevirtual |
MIDI
Reimplemented in PluginCore.
|
pure virtual |
pure virtual function: do any last preparation for arrival of fresh audio buffers
Implemented in PluginCore.
|
inlinevirtual |
process sub-blocks of data (OPTIONAL MODE) PluginCore MUST override and implement this function
Reimplemented in PluginCore.
|
virtual |
THE buffer processing function.
Buffer Proc Cycle: II PluginCore overrides this method to process frames
Operation:
processBufferInfo | - a structure of information about the current buffer to process; includes information from host (BPM, etc...) |
processed
processed
|
pure virtual |
pure virtual function: process one frame of audio
Implemented in PluginCore.
|
inlinevirtual |
ASPiK messaging system: base class implementation is empty
Reimplemented in PluginCore.
|
inlinevirtual |
ASPiK midi event system: base class implementation is empty
Reimplemented in PluginCore.
void PluginBase::removeAllPresets | ( | ) |
remove all presets - NOTE: does not delete objects
remove all presets
void PluginBase::removePreset | ( | uint32_t | index | ) |
remove a preset - NOTE: does not delete object
remove preset
index | index of preset to remove |
|
virtual |
initialize object for a new run of audio; called just before audio streams
rest the object to it's preferred initial state
Operation:
Reimplemented in PluginCore.
void PluginBase::setParamAuxAttribute | ( | uint32_t | controlID, |
const AuxParameterAttribute & | auxAttribute | ||
) |
adds an auxilliary attribute to the plugin parameter; you can have as many auxilliary attributes as you like for each parameter.
helper function to add auxilliary data to a PluginParameter (SUPER useful way to stash all kinds of data on the parameter object!)
controlID | control ID value of the parameter |
auxAttribute | a structure of information to store |
void PluginBase::setPIParamValue | ( | uint32_t | _controlID, |
double | _controlValue | ||
) |
set a parameter's value with the actual value (as double)
set value
_controlID | control ID of the parameter |
_controlValue | the new value to set on the parameter |
not handled
double PluginBase::setPIParamValueNormalized | ( | uint32_t | _controlID, |
double | _normalizedValue, | ||
bool | applyTaper = true |
||
) |
set a parameter's value with the normalied value (as double)
sest normalized
_controlID | control ID of the parameter |
_normalizedValue | the new normalized value to set on the parameter |
applyTaper | add the tapering during application (not used in all situations) |
not handled
|
inline |
store the plugin host interface pointer: this pointer will never go out of scope or be invalid once stored!
_pluginHostConnector | the interface pointer |
bool PluginBase::setPresetParameter | ( | std::vector< PresetParameter > & | presetParameters, |
uint32_t | _controlID, | ||
double | _controlValue | ||
) |
set a new value for a preset
set an individual preset
presetParameters | list of presets |
_controlID | control ID of parameter to set |
_controlValue | the new preset control value |
|
inlinevirtual |
only for a vector joystick control from DAW that implements it (reserved for future use): base class implementation is empty
Reimplemented in PluginCore.
void PluginBase::syncInBoundVariables | ( | ) |
initialize object for a new run of audio; called just before audio streams
Buffer Proc Cycle: I connects GUI control changes to bound variables (part of ASPiK input variable binding option)
Operation:
bool PluginBase::updateOutBoundVariables | ( | ) |
copy newly updated metering variables into GUI parameters for display
Buffer Proc Cycle: III connects meter variables to outbound GUI control changes (part of ASPiK output variable binding option)
Operation:
bool PluginBase::updatePIParamBoundValue | ( | uint32_t | _controlID | ) |
update a bound-variable with a parameter's control value; this is the essence of the variable binding operation
perform variable binding at parameter level
_controlID | control ID of the parameter |
not handled
|
pure virtual |
pure virtual function: update the plugin parameter using GUI control value (thread-safe)
Implemented in PluginCore.
|
pure virtual |
pure virtual function: update the plugin parameter using normalized GUI control value (thread-safe)
Implemented in PluginCore.
|
inline |
Description query: infinite tail (VST3 only)
|
inline |
Description query: MIDI.
|
inline |
Description query: VST Sample Accurate Automation.