20#ifndef __PONGASOFT_VST_RT_PARAMETER_H__
21#define __PONGASOFT_VST_RT_PARAMETER_H__
23#include <pluginterfaces/vst/ivstaudioprocessor.h>
25#include <pongasoft/logging/logging.h>
201 DCHECK_F(
fPtr !=
nullptr);
266template<
typename T,
size_t N>
281 DCHECK_F(
fPtr !=
nullptr);
288 ParamValue
const &
getValue()
const {
return fPtr->getNormalizedValue(); }
291 ParamValue
const &
value()
const {
return fPtr->getNormalizedValue(); }
298 bool update(ParamValue
const &iNewValue) {
return fPtr->updateNormalizedValue(iNewValue); }
304 bool update(ParamValue
const &iNewValue, ProcessData &oData)
332 ParamValue
const &
previous()
const {
return fPtr->getPreviousNormalizedValue(); }
Implements all the various equality and relational operators for the type T which is assumed to encap...
Definition Operators.h:56
bool hasChanged() const
Definition RTParameter.h:318
RTRawVstParam(RTRawVstParameter *iPtr)
Definition RTParameter.h:279
bool update(ParamValue const &iNewValue)
This method is typically called during the processing method when the plugin needs to update the valu...
Definition RTParameter.h:298
RTRawVstParameter * fPtr
Definition RTParameter.h:335
tresult addToOutput(ProcessData &oData)
Add the current normalized value as an output parameter changes which propagates the change to the vs...
Definition RTParameter.h:323
ParamValue const & getValue() const
Definition RTParameter.h:288
ParamID getParamID() const
Definition RTParameter.h:285
ParamValue operator*() const
allow writing *param to access the underlying value (or in other words, *param is the same param....
Definition RTParameter.h:326
ParamValue const & value() const
Definition RTParameter.h:291
ParamValue const & previous() const
Definition RTParameter.h:332
bool update(ParamValue const &iNewValue, ProcessData &oData)
This method is typically called during the processing method when the plugin needs to update the valu...
Definition RTParameter.h:304
RTRawVstParam & operator=(ParamValue const &iValue)
Allow to write param = 0.5.
Definition RTParameter.h:329
Base class which deals with the "raw"/untyped parameter and keep the normalized value (ParamValue in ...
Definition RTParameter.h:36
RTRawVstParameter(std::shared_ptr< RawVstParamDef > iParamDef)
Definition RTParameter.h:39
bool hasChanged() const
Definition RTParameter.h:76
tresult addToOutput(ProcessData &oData) const
Add the current normalized value as an output parameter changes.
Definition RTParameter.cpp:29
RawVstParamDef const * getParamDef() const
Definition RTParameter.h:52
ParamValue const & getPreviousNormalizedValue() const
Definition RTParameter.h:66
ParamValue const & getNormalizedValue() const
Definition RTParameter.h:63
std::shared_ptr< RawVstParamDef > fParamDef
Definition RTParameter.h:85
virtual bool resetPreviousValue()
Called at the end of the frame so that the previous value is set to the current value for the next fr...
Definition RTParameter.cpp:65
ParamID getParamID() const
Definition RTParameter.h:49
ParamValue fNormalizedValue
Definition RTParameter.h:86
ParamValue fPreviousNormalizedValue
Definition RTParameter.h:87
virtual bool updateNormalizedValue(ParamValue iNormalizedValue)
Update the parameter with a new normalized value.
Definition RTParameter.cpp:49
virtual ~RTRawVstParameter()=default
Destructor (needed for polymorphic base type).
ParamValue const & normalizedValue() const
Return the normalized value.
Definition RTParameter.h:220
ParamType denormalize(ParamValue iNormalizedValue) const
Definition RTParameter.h:211
bool hasChanged() const
Definition RTParameter.h:242
ParamValue normalize(ParamType const &iValue) const
Definition RTParameter.h:208
tresult addToOutput(ProcessData &oData)
Add the current normalized value as an output parameter changes which propagates the change to the vs...
Definition RTParameter.h:247
constexpr ParamType const * operator->() const
Definition RTParameter.h:253
RTVstParam & operator=(ParamType const &iValue)
Allow writing param = 3.0.
Definition RTParameter.h:256
ParamType const & previous() const
Definition RTParameter.h:259
void update(ParamType const &iNewValue, ProcessData &oData)
This method is typically called during the processing method when the plugin needs to update the valu...
Definition RTParameter.h:233
constexpr ParamType const & operator*() const
allow writing *param to access the underlying value (or in other words, *param is the same param....
Definition RTParameter.h:250
void update(ParamType const &iNewValue)
This method is typically called during the processing method when the plugin needs to update the valu...
Definition RTParameter.h:227
ParamID getParamID() const
Definition RTParameter.h:205
T const & value() const
Definition RTParameter.h:217
T ParamType
Definition RTParameter.h:196
RTVstParam(RTVstParameter< T > *iPtr)
Definition RTParameter.h:199
T const & getValue() const
Definition RTParameter.h:214
RTVstParameter< T > * fPtr
Definition RTParameter.h:262
The typed version.
Definition RTParameter.h:96
RTVstParameter(VstParam< T > iParamDef)
Definition RTParameter.h:101
ParamType denormalize(ParamValue iNormalizedValue) const
Definition RTParameter.h:118
ParamValue normalize(ParamType const &iValue) const
Definition RTParameter.h:115
bool resetPreviousValue() override
Called at the end of the frame so that the previous value is set to the current value for the next fr...
Definition RTParameter.h:163
ParamType const & getPreviousValue() const
Definition RTParameter.h:130
ParamType fValue
Definition RTParameter.h:140
bool updateNormalizedValue(ParamValue iNormalizedValue) override
Update the parameter with a new normalized value.
Definition RTParameter.h:148
void update(ParamType const &iNewValue)
This method is typically called during the processing method when the plugin needs to update the valu...
Definition RTParameter.h:178
ParamType fPreviousValue
Definition RTParameter.h:141
T ParamType
Definition RTParameter.h:98
ParamType const & getValue() const
Definition RTParameter.h:127
VstParamDef< T > const * getParamDefT() const
Definition RTParameter.h:109
Base class for a raw vst parameter definition.
Definition ParamDef.h:92
Typed parameter definition.
Definition ParamDef.h:178
Definition RTJmbInParameter.h:26
std::array< RTRawVstParam, N > RTRawVstParams
An array of RTRawVstParam.
Definition RTParameter.h:340
std::array< RTVstParam< T >, N > RTVstParams
An array of RTVstParam.
Definition RTParameter.h:267
std::shared_ptr< VstParamDef< T > > VstParam
Definition ParamDef.h:509