VST 3 SDK VST 3.7
SDK for developing VST plug-in
|
Utility class to handle sample accurate parameter changes coming from IParamValueQueue. More...
#include <sampleaccurate.h>
Public Member Functions | |
Parameter (ParamID pid=0, ParamValue initValue=0.) noexcept | |
void | setValue (ParamValue v) noexcept |
Set the value of the parameter. More... | |
void | setParamID (ParamID pid) noexcept |
Set the ID of the parameter. More... | |
ParamID | getParamID () const noexcept |
Get the ID of the parameter. More... | |
ParamValue | getValue () const noexcept |
Get the current value of the parameter. More... | |
bool | hasChanges () const noexcept |
Are there any pending changes. More... | |
void | beginChanges (IParamValueQueue *valueQueue) noexcept |
Begin change sequence. More... | |
ParamValue | advance (int32 numSamples) noexcept |
Advance the changes in queue. More... | |
ParamValue | flushChanges () noexcept |
Flush all changes in the queue. More... | |
ParamValue | endChanges () noexcept |
End change sequence. More... | |
template<typename Proc > | |
void | advance (int32 numSamples, Proc p) |
Templated variant of advance. More... | |
template<typename Proc > | |
void | flushChanges (Proc p) |
Templated variant of flushChanges. More... | |
template<typename Proc > | |
void | endChanges (Proc p) |
Templated variant of endChanges. More... | |
template<typename Proc > | |
SMTG_ALWAYS_INLINE void | advance (int32 numSamples, Proc p) |
template<typename Proc > | |
SMTG_ALWAYS_INLINE void | flushChanges (Proc p) |
template<typename Proc > | |
SMTG_ALWAYS_INLINE void | endChanges (Proc p) |
Utility class to handle sample accurate parameter changes coming from IParamValueQueue.
The normal use case is to setup the Parameter class once for a specific ParamID and then only use it in the realtime process method.
If there's a change for the parameter in the inputParameterChanges of the ProcessData structure the Parameters beginChange method should be called with the valueQueue of the parmID and then while processing the current audio block the parameter should be advanced as many samples as you would like to handle parameter changes. In the end the endChanges method must be called to cleanup internal data structures. For convenience the endChanges method can be called without a previous beginChanges call.
|
noexcept |
|
noexcept |
Set the value of the parameter.
When this is called during the beginChanges() and endChanges() sequence, the changes in the value queue are ignored
v | the new value of the parameter |
|
noexcept |
Set the ID of the parameter.
pid | the new ID of the parameter |
|
noexcept |
Get the ID of the parameter.
|
noexcept |
Get the current value of the parameter.
|
noexcept |
Are there any pending changes.
|
noexcept |
Begin change sequence.
valueQueue | the queue with the changes |
|
noexcept |
Advance the changes in queue.
numSamples | how many samples to advance in the queue |
|
noexcept |
Flush all changes in the queue.
|
noexcept |
End change sequence.
void advance | ( | int32 | numSamples, |
Proc | p | ||
) |
Templated variant of advance.
calls Proc p with the new value if the value changes
void flushChanges | ( | Proc | p | ) |
Templated variant of flushChanges.
calls Proc p with the new value if the value changes
void endChanges | ( | Proc | p | ) |
Templated variant of endChanges.
calls Proc p with the new value if the value changes
SMTG_ALWAYS_INLINE void advance | ( | int32 | numSamples, |
Proc | p | ||
) |
SMTG_ALWAYS_INLINE void flushChanges | ( | Proc | p | ) |
SMTG_ALWAYS_INLINE void endChanges | ( | Proc | p | ) |