ASPiK SDK
|
The PluginParameter object stores all of the data needed for any type of plugin parameter. It is a large object, but it is not complex as it really just stores LOTS of information about plugin parameters. More...
#include <pluginparameter.h>
Public Member Functions | |
PluginParameter (int _controlID, const char *_controlName, const char *_controlUnits, controlVariableType _controlType, double _minValue, double _maxValue, double _defaultValue, taper _controlTaper=taper::kLinearTaper, uint32_t _displayPrecision=2) | |
constructor for most knobs and sliders More... | |
PluginParameter (int _controlID, const char *_controlName, std::vector< std::string > _stringList, std::string _defaultString) | |
one method of constructing a string-list parameter More... | |
PluginParameter (int _controlID, const char *_controlName, const char *_commaSeparatedList, std::string _defaultString) | |
second method of constructing a string-list parameter More... | |
PluginParameter (int _controlID, const char *_controlName, double _meterAttack_ms, double _meterRelease_ms, uint32_t _detectorMode, meterCal _meterCal=meterCal::kLinearMeter) | |
method of constructing a meter parameter More... | |
PluginParameter (int _controlID, const char *_controlName="", controlVariableType _controlType=controlVariableType::kNonVariableBoundControl) | |
method of constructing a non-bound-variable parameter More... | |
PluginParameter () | |
simple constructor - you can always use this and then use the massive number of get/set functions to customize in any manner More... | |
PluginParameter (const PluginParameter &initGuiControl) | |
copy constructor More... | |
virtual | ~PluginParameter () |
only need to clean out the aux parameters - everything else is self deleting More... | |
uint32_t | getControlID () |
get ID value | |
void | setControlID (uint32_t cid) |
set ID value | |
const char * | getControlName () |
get name as const char* | |
void | setControlName (const char *name) |
set name as const char* | |
const char * | getControlUnits () |
get units as const char* | |
void | setControlUnits (const char *units) |
set units as const char* | |
controlVariableType | getControlVariableType () |
get variable type associated with parameter | |
void | setControlVariableType (controlVariableType ctrlVarType) |
set variable type associated with parameter | |
double | getMinValue () |
get minimum value | |
void | setMinValue (double value) |
set minimum value | |
double | getMaxValue () |
get maximum value | |
void | setMaxValue (double value) |
set maximum value | |
double | getDefaultValue () |
get default value | |
void | setDefaultValue (double value) |
set default value | |
bool | getIsDiscreteSwitch () |
set is switch (not used) | |
void | setIsDiscreteSwitch (bool _isDiscreteSwitch) |
get is switch (not used) | |
taper | getControlTaper () |
get taper | |
void | setControlTaper (taper ctrlTaper) |
set taper | |
bool | isLinearTaper () |
query: linear taper | |
bool | isLogTaper () |
query: log taper | |
bool | isAntiLogTaper () |
query: antilog taper | |
bool | isVoltOctaveTaper () |
query: volt/octave taper | |
bool | isMeterParam () |
query: meter param? | |
bool | isStringListParam () |
query: string list para,? | |
bool | isFloatParam () |
query: float param? | |
bool | isDoubleParam () |
query: double param? | |
bool | isIntParam () |
query: int param? | |
bool | isNonVariableBoundParam () |
query: non-bound param? | |
uint32_t | getDisplayPrecision () |
get sig digits | |
void | setDisplayPrecision (uint32_t precision) |
set sig digits | |
double | getMeterAttack_ms () |
get meter attack time (ballistics) | |
void | setMeterAttack_ms (double value) |
set meter attack time (ballistics) | |
double | getMeterRelease_ms () |
get meter release time (ballistics) | |
void | setMeterRelease_ms (double value) |
set meter release time (ballistics) | |
uint32_t | getDetectorMode () |
get meter detect mode | |
void | setMeterDetectorMode (uint32_t value) |
set meter detect mode | |
bool | getLogMeter () |
query log meter flag | |
void | setLogMeter (bool value) |
set log meter flag | |
bool | getInvertedMeter () |
query inverted meter flag | |
void | setInvertedMeter (bool value) |
set inverted meter flag | |
bool | isProtoolsGRMeter () |
query pro tools GR meter flag | |
void | setIsProtoolsGRMeter (bool value) |
set inverted meter flag | |
bool | getParameterSmoothing () |
query parameter smoothing flag | |
void | setParameterSmoothing (bool value) |
set inverted meter flag | |
double | getSmoothingTimeMsec () |
query smoothing time | |
void | setSmoothingTimeMsec (double value) |
set inverted meter flag | |
smoothingMethod | getSmoothingMethod () |
query smoothing method | |
void | setSmoothingMethod (smoothingMethod smoothingMethod) |
set smoothing method | |
bool | getIsWritable () |
query writable control (meter) | |
void | setIsWritable (bool value) |
set writable control (meter) | |
bool | getEnableVSTSampleAccurateAutomation () |
query VST3 sample accurate automation | |
void | setEnableVSTSampleAccurateAutomation (bool value) |
set VST3 sample accurate automation | |
AuxParameterAttribute * | getAuxAttribute (uint32_t attributeID) |
get aux data More... | |
uint32_t | setAuxAttribute (uint32_t attributeID, const AuxParameterAttribute &auxParameterAtribute) |
set aux data More... | |
double | getControlValue () |
the main function to access the underlying atomic double value More... | |
void | setControlValue (double actualParamValue, bool ignoreSmoothing=false) |
the main function to set the underlying atomic double value More... | |
double | setControlValueNormalized (double normalizedValue, bool applyTaper=true, bool ignoreParameterSmoothing=false) |
the main function to set the underlying atomic double value using a normalized value; this is the operation in VST3 and RAFX2 More... | |
std::string | getControlValueAsString () |
the main function to access the underlying atomic double value as a string More... | |
size_t | getStringCount () |
get the number of individual strings in a string-list control More... | |
const char * | getCommaSeparatedStringList () |
get the strings in a string-list control as a comma separated list More... | |
void | setCommaSeparatedStringList () |
convert the string-list into a comma-separated list (during construction) More... | |
void | setStringList (std::vector< std::string > _stringList) |
set the string-list using a vector of strings | |
std::string | getStringByIndex (uint32_t index) |
get string-list string by index More... | |
double | getDefaultValueNormalized () |
get default value as normalied value More... | |
double | getControlValueNormalized () |
get control value as normalied value More... | |
double | getControlValueWithNormalizedValue (double normalizedValue, bool applyTaper=true) |
get the new control value as if it were set with a normalized value More... | |
double | getNormalizedControlValueWithActualValue (double actualValue) |
get the new normalized control value as if it were set with an actual value More... | |
double | getGUIMin () |
double | getGUIMax () |
int | findStringIndex (std::string searchString) |
find a string in the list of a string-list parameter More... | |
double | normToLogNorm (double normalizedValue) |
double | logNormToNorm (double logNormalizedValue) |
double | normToAntiLogNorm (double normalizedValue) |
double | antiLogNormToNorm (double aLogNormalizedValue) |
void | initParamSmoother (double sampleRate) |
initialize or reset the parameter smoother object More... | |
void | updateSampleRate (double sampleRate) |
change any sample-rate dependent members More... | |
bool | smoothParameterValue () |
perform smoothing operation on data More... | |
void | setBoundVariable (void *boundVariable, boundVariableType dataType) |
save the variable for binding operation More... | |
boundVariableType | getBoundVariableType () |
get the datatype of the bound variable More... | |
bool | updateInBoundVariable () |
perform the variable binding update (change the value) More... | |
bool | updateOutBoundVariable () |
perform the variable binding update on meter data More... | |
void | setParameterUpdateQueue (IParameterUpdateQueue *_parameterUpdateQueue) |
stores the update queue for VST3 sample accuate automation; note this is only used during actual DAW runs with automation engaged More... | |
IParameterUpdateQueue * | getParameterUpdateQueue () |
retrieves the update queue for VST3 sample accuate automation; note this is only used during actual DAW runs with automation engaged More... | |
PluginParameter & | operator= (const PluginParameter &aPluginParameter) |
Protected Member Functions | |
float | getAtomicControlValueFloat () const |
set atomic variable with float | |
void | setAtomicControlValueFloat (float value) |
get atomic variable as float | |
double | getAtomicControlValueDouble () const |
set atomic variable with double | |
void | setAtomicControlValueDouble (double value) |
get atomic variable as double | |
void | setSmoothedTargetValue (double value) |
set atomic TARGET smoothing variable with double | |
double | getSmoothedTargetValue () const |
set atomic TARGET smoothing variable with double | |
double | getVoltOctaveControlValueFromNormValue (double normalizedValue) |
get volt/octave control value from a normalized value More... | |
double | getNormalizedLogControlValue () |
get get log control value in normalized form More... | |
double | getNormalizedAntiLogControlValue () |
get get anti-log control value in normalized form More... | |
double | getNormalizedVoltOctaveControlValue () |
get get volt/octave control value in normalized form More... | |
double | getNormalizedControlValueWithActual (double actualValue) |
convert actual control value into normalized value (helper) More... | |
double | getNormalizedControlValue () |
get control value as normalized value (helper) More... | |
double | getControlValueFromNormalizedValue (double normalizedValue) |
get control value with a normalized value (helper) More... | |
double | getNormalizedDefaultValue () |
get default value as a normalized value (helper) More... | |
double | getNormalizedLogDefaultValue () |
get log default value in normalized form More... | |
double | getNormalizedAntiLogDefaultValue () |
get anti-log default value in normalized form More... | |
double | getNormalizedVoltOctaveDefaultValue () |
get volt/octave default value in normalized form More... | |
Protected Attributes | |
int | controlID = -1 |
the ID value for the parameter | |
std::string | controlName = "ControlName" |
the name string for the parameter | |
std::string | controlUnits = "Units" |
the units string for the parameter | |
controlVariableType | controlType = controlVariableType::kDouble |
the control type | |
double | minValue = 0.0 |
the min for the parameter | |
double | maxValue = 1.0 |
the max for the parameter | |
double | defaultValue = 0.0 |
the default value for the parameter | |
std::atomic< float > | controlValueAtomic |
the underlying atomic variable | |
std::atomic< float > | smoothedTargetValueAtomic |
the underlying atomic variable TARGET for smoothing | |
taper | controlTaper = taper::kLinearTaper |
the taper | |
uint32_t | displayPrecision = 2 |
sig digits for display | |
std::vector< std::string > | stringList |
string list | |
std::string | commaSeparatedStringList |
string list a somma separated string | |
bool | appendUnits = true |
flag to append units in GUI controls (use with several built-in custom views) | |
bool | isWritable = false |
flag for meter variables | |
bool | isDiscreteSwitch = false |
flag for switches (not currently used in ASPiK) | |
double | meterAttack_ms = 10.0 |
meter attack time in milliseconds | |
double | meterRelease_ms = 500.0 |
meter release time in milliseconds | |
uint32_t | detectorMode = ENVELOPE_DETECT_MODE_RMS |
meter detector mode | |
bool | logMeter = false |
meter is log | |
bool | invertedMeter = false |
meter is inverted | |
bool | protoolsGRMeter = false |
meter is a Pro Tools gain reduction meter | |
bool | useParameterSmoothing = false |
enable param smoothing | |
smoothingMethod | smoothingType = smoothingMethod::kLPFSmoother |
param smoothing type | |
double | smoothingTimeMsec = 100.0 |
param smoothing time | |
ParamSmoother< double > | paramSmoother |
param smoothing object | |
boundVariableType | boundVariableDataType = boundVariableType::kFloat |
bound data type | |
IParameterUpdateQueue * | parameterUpdateQueue = nullptr |
interface for VST3 sample accurate updates | |
bool | enableVSTSampleAccurateAutomation = true |
VST3 sample accurate flag. | |
The PluginParameter object stores all of the data needed for any type of plugin parameter. It is a large object, but it is not complex as it really just stores LOTS of information about plugin parameters.
PluginParameter Operations:
PluginParameter::PluginParameter | ( | int | _controlID, |
const char * | _controlName, | ||
const char * | _controlUnits, | ||
controlVariableType | _controlType, | ||
double | _minValue, | ||
double | _maxValue, | ||
double | _defaultValue, | ||
taper | _controlTaper = taper::kLinearTaper , |
||
uint32_t | _displayPrecision = 2 |
||
) |
constructor for most knobs and sliders
constructor for continuous controls
_controlID | numerical control identifier – MUST BE UNIQUE among all parameter ID values |
_controlName | name string |
_controlUnits | units string |
_controlType | type |
_minValue | min limit |
_maxValue | max limit |
_defaultValue | default value at startup |
_controlTaper | type of gtaper |
_displayPrecision | sig digits of precision on GUI display |
PluginParameter::PluginParameter | ( | int | _controlID, |
const char * | _controlName, | ||
std::vector< std::string > | _stringList, | ||
std::string | _defaultString | ||
) |
one method of constructing a string-list parameter
constructor 1 for string-list controls
_controlID | numerical control identifier – MUST BE UNIQUE among all parameter ID values |
_controlName | name string |
_stringList | string list in std::vector format |
_defaultString | default string value as std::string |
PluginParameter::PluginParameter | ( | int | _controlID, |
const char * | _controlName, | ||
const char * | _commaSeparatedList, | ||
std::string | _defaultString | ||
) |
second method of constructing a string-list parameter
constructor 2 for string-list controls
_controlID | numerical control identifier – MUST BE UNIQUE among all parameter ID values |
_controlName | name string |
_commaSeparatedList | simple character string of comma-separated items |
_defaultString | default string value as std::string |
PluginParameter::PluginParameter | ( | int | _controlID, |
const char * | _controlName, | ||
double | _meterAttack_ms, | ||
double | _meterRelease_ms, | ||
uint32_t | _detectorMode, | ||
meterCal | _meterCal = meterCal::kLinearMeter |
||
) |
method of constructing a meter parameter
constructor for meter controls
_controlID | numerical control identifier – MUST BE UNIQUE among all parameter ID values |
_controlName | name string |
_meterAttack_ms | attack time for meter (ballistics) |
_meterRelease_ms | release time for meter (ballistics) |
_detectorMode | peak, ms, rms |
_meterCal | linear or log calibration |
PluginParameter::PluginParameter | ( | int | _controlID, |
const char * | _controlName = "" , |
||
controlVariableType | _controlType = controlVariableType::kNonVariableBoundControl |
||
) |
method of constructing a non-bound-variable parameter
constructor for NonVariableBoundControl
_controlID | numerical control identifier – MUST BE UNIQUE among all parameter ID values |
_controlName | name string |
_controlType | type of control |
PluginParameter::PluginParameter | ( | ) |
simple constructor - you can always use this and then use the massive number of get/set functions to customize in any manner
empty constructor
PluginParameter::PluginParameter | ( | const PluginParameter & | initGuiControl | ) |
copy constructor
copy constructor
|
virtual |
only need to clean out the aux parameters - everything else is self deleting
D-TOR
|
inline |
AntiLog-normalized to normalized version
|
inline |
find a string in the list of a string-list parameter
AuxParameterAttribute * PluginParameter::getAuxAttribute | ( | uint32_t | attributeID | ) |
get aux data
get an aux attribute
attributeID | unique identifier of attribute |
|
inline |
get the datatype of the bound variable
|
inline |
get the strings in a string-list control as a comma separated list
|
inline |
the main function to access the underlying atomic double value
std::string PluginParameter::getControlValueAsString | ( | ) |
the main function to access the underlying atomic double value as a string
get control value: string
|
inlineprotected |
get control value with a normalized value (helper)
normalizedValue | the normalized value |
|
inline |
get control value as normalied value
|
inline |
get the new control value as if it were set with a normalized value
|
inline |
get default value as normalied value
|
inline |
get the maximum GUI value for string-list params
|
inline |
get the minimum GUI value - this is ALWAYS 0.0 for VSTGUI4
|
inlineprotected |
get get anti-log control value in normalized form
|
inlineprotected |
get anti-log default value in normalized form
|
inlineprotected |
get control value as normalized value (helper)
|
inlineprotected |
convert actual control value into normalized value (helper)
actualValue | the actual value |
|
inline |
get the new normalized control value as if it were set with an actual value
|
inlineprotected |
get default value as a normalized value (helper)
|
inlineprotected |
get get log control value in normalized form
|
inlineprotected |
get log default value in normalized form
|
inlineprotected |
get get volt/octave control value in normalized form
|
inlineprotected |
get volt/octave default value in normalized form
|
inline |
retrieves the update queue for VST3 sample accuate automation; note this is only used during actual DAW runs with automation engaged
std::string PluginParameter::getStringByIndex | ( | uint32_t | index | ) |
get string-list string by index
get a string-list string using the index
index | of string in list |
|
inline |
get the number of individual strings in a string-list control
|
inlineprotected |
get volt/octave control value from a normalized value
normalizedValue | the normalized version |
|
inline |
initialize or reset the parameter smoother object
sampleRate | fs (needed for coefficient calc) |
|
inline |
Log-normalized to normalized version (reverse-convex transform)
|
inline |
normalized to AntiLog-normalized version
|
inline |
normalized to Log-normalized version (convex transform)
|
inline |
overloaded = operator (standard C++ fare)
uint32_t PluginParameter::setAuxAttribute | ( | uint32_t | attributeID, |
const AuxParameterAttribute & | auxParameterAtribute | ||
) |
set aux data
set an aux attribute
attributeID | unique identifier of attribute |
auxParameterAtribute | information about the aux attribute |
|
inline |
save the variable for binding operation
boundVariable | naked pointer to bound variable |
dataType | data type for casting |
void PluginParameter::setCommaSeparatedStringList | ( | ) |
convert the string-list into a comma-separated list (during construction)
set comma-separated version of string list (internally called)
|
inline |
the main function to set the underlying atomic double value
actualParamValue | parameter value as a regular double |
ignoreSmoothing | flag to ignore smoothing operation and write directly to atomic double |
|
inline |
the main function to set the underlying atomic double value using a normalized value; this is the operation in VST3 and RAFX2
normalizedValue | parameter value as a regular double |
applyTaper | add the control taper during the operation |
ignoreParameterSmoothing | flag to ignore smoothing operation and write directly to atomic double |
|
inline |
stores the update queue for VST3 sample accuate automation; note this is only used during actual DAW runs with automation engaged
_parameterUpdateQueue | the update queue to store |
|
inline |
perform smoothing operation on data
|
inline |
perform the variable binding update (change the value)
|
inline |
perform the variable binding update on meter data
|
inline |
change any sample-rate dependent members
sampleRate | fs (needed for coefficient calc) |