19#include <pluginterfaces/vst/ivstaudioprocessor.h>
21#ifndef __PONGASOFT_VST_RT_PARAMETER_H__
22#define __PONGASOFT_VST_RT_PARAMETER_H__
25#include <pongasoft/logging/logging.h>
198 DCHECK_F(
fPtr !=
nullptr);
214 inline T
const &
value()
const {
return fPtr->getValue(); }
247 [[deprecated(
"Since 4.1.0 - use operator* or value() instead (ex: *fState.fBypass or fState.fBypass.value())")]]
266template<
typename T,
size_t N>
281 DCHECK_F(
fPtr !=
nullptr);
288 inline ParamValue
const &
getValue()
const {
return fPtr->getNormalizedValue(); }
291 inline ParamValue
const &
value()
const {
return fPtr->getNormalizedValue(); }
298 inline bool update(ParamValue
const &iNewValue) {
return fPtr->updateNormalizedValue(iNewValue); }
304 inline bool update(ParamValue
const &iNewValue, ProcessData &oData)
326 [[deprecated(
"Since 4.1.0 - use operator* instead")]]
327 inline operator ParamValue
const &()
const {
return fPtr->getNormalizedValue(); }
336 inline 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:339
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:330
ParamValue const & value() const
Definition RTParameter.h:291
ParamValue const & previous() const
Definition RTParameter.h:336
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:333
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:73
RawVstParamDef const * getParamDef() const
Definition RTParameter.h:49
ParamValue const & getPreviousNormalizedValue() const
Definition RTParameter.h:63
tresult addToOutput(ProcessData &oData)
Add the current normalized value as an output parameter changes.
Definition RTParameter.cpp:30
ParamValue const & getNormalizedValue() const
Definition RTParameter.h:60
std::shared_ptr< RawVstParamDef > fParamDef
Definition RTParameter.h:82
virtual bool resetPreviousValue()
Called at the end of the frame so that previous value is set to current value for the next frame.
Definition RTParameter.cpp:66
ParamID getParamID() const
Definition RTParameter.h:46
ParamValue fNormalizedValue
Definition RTParameter.h:83
ParamValue fPreviousNormalizedValue
Definition RTParameter.h:84
virtual bool updateNormalizedValue(ParamValue iNormalizedValue)
Update the parameter with a new normalized value.
Definition RTParameter.cpp:50
ParamValue const & normalizedValue() const
Return the normalized value.
Definition RTParameter.h:217
ParamType denormalize(ParamValue iNormalizedValue) const
Definition RTParameter.h:208
bool hasChanged() const
Definition RTParameter.h:239
ParamValue normalize(ParamType const &iValue) const
Definition RTParameter.h:205
RTVstParam< T > & operator=(ParamType const &iValue)
Allow to write param = 3.0.
Definition RTParameter.h:257
tresult addToOutput(ProcessData &oData)
Add the current normalized value as an output parameter changes which propagates the change to the vs...
Definition RTParameter.h:244
constexpr ParamType const * operator->() const
Definition RTParameter.h:254
ParamType const & previous() const
Definition RTParameter.h:260
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:230
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:251
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:224
ParamID getParamID() const
Definition RTParameter.h:202
T const & value() const
Definition RTParameter.h:214
T ParamType
Definition RTParameter.h:193
RTVstParam(RTVstParameter< T > *iPtr)
Definition RTParameter.h:196
T const & getValue() const
Definition RTParameter.h:211
RTVstParameter< T > * fPtr
Definition RTParameter.h:263
The typed version.
Definition RTParameter.h:93
RTVstParameter(VstParam< T > iParamDef)
Definition RTParameter.h:98
ParamType denormalize(ParamValue iNormalizedValue) const
Definition RTParameter.h:115
ParamValue normalize(ParamType const &iValue) const
Definition RTParameter.h:112
bool resetPreviousValue() override
Called at the end of the frame so that previous value is set to current value for the next frame.
Definition RTParameter.h:160
ParamType const & getPreviousValue() const
Definition RTParameter.h:127
ParamType fValue
Definition RTParameter.h:137
bool updateNormalizedValue(ParamValue iNormalizedValue) override
Update the parameter with a new normalized value.
Definition RTParameter.h:145
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:175
ParamType fPreviousValue
Definition RTParameter.h:138
T ParamType
Definition RTParameter.h:95
ParamType const & getValue() const
Definition RTParameter.h:124
VstParamDef< T > const * getParamDefT() const
Definition RTParameter.h:106
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
Definition RTParameter.h:343
std::array< RTVstParam< T >, N > RTVstParams
Definition RTParameter.h:267
std::shared_ptr< VstParamDef< T > > VstParam
Definition ParamDef.h:509