Jamba C++ API
4.4.0
|
Manages the state used by the processor: you add all the parameters that the state manages using the add method. More...
#include <RTState.h>
Inherits IMessageHandler.
Public Member Functions | |
RTRawVstParam | add (RawVstParam iParamDef) |
This method is called for each parameter managed by RTState. More... | |
template<typename T > | |
RTVstParam< T > | add (VstParam< T > iParamDef) |
This method is called for each parameter managed by RTState. More... | |
template<typename T > | |
RTJmbInParam< T > | addJmbIn (JmbParam< T > iParamDef) |
This method should be called to add an rt inbound jmb parameter. More... | |
template<typename T > | |
RTJmbOutParam< T > | addJmbOut (JmbParam< T > iParamDef) |
This method should be called to add an rt outbound jmb parameter. More... | |
virtual void | afterProcessing () |
This method should be called at the end of process(ProcessData &data) method. More... | |
virtual bool | applyParameterChanges (IParameterChanges &inputParameterChanges) |
This method should be called in every frame when there are parameter changes to update this state accordingly. More... | |
virtual bool | beforeProcessing () |
This method should be call at the beginning of the process(ProcessData &data) method before doing anything else. More... | |
std::vector< ParamID > const & | getAllRegistrationOrder () const |
virtual int32 | getParamUpdateSampleOffset (ProcessData &iData, ParamID iParamID) const |
This uses the same algorithm as when the param value is updated (implemented in applyParameterChanges) for consistency. More... | |
tresult | handleMessage (Message const &iMessage) override |
Called by the UI thread (from RTProcessor) to handle messages. More... | |
virtual tresult | init () |
Call this method after adding all the parameters. More... | |
bool | isMessagingEnabled () const |
virtual tresult | readNewState (IBStreamer &iStreamer) |
This method should be called from Processor::setState to update this state to the state stored in the stream. More... | |
RTState (Parameters const &iParameters) | |
virtual tresult | sendPendingMessages (IMessageProducer *iMessageProducer) |
Called (from a GUI timer) to send the messages to the GUI (JmbParam for the moment) More... | |
virtual tresult | writeLatestState (IBStreamer &oStreamer) |
This method should be called from Processor::getState to store the latest state to the stream. More... | |
Protected Member Functions | |
tresult | addInboundMessagingParameter (std::unique_ptr< IRTJmbInParameter > iParameter) |
tresult | addOutboundMessagingParameter (std::unique_ptr< IRTJmbOutParameter > iParameter) |
tresult | addRawParameter (std::unique_ptr< RTRawVstParameter > iParameter) |
virtual void | afterReadNewState (NormalizedState const *iState) |
Gives a chance to subclasses to tweak and/or display the state after being read. More... | |
virtual void | beforeWriteNewState (NormalizedState const *iState) |
Gives a chance to subclasses to tweak and/or display the state before being written. More... | |
virtual void | computeLatestState (NormalizedState *oLatestState) const |
Called from the RT thread from afterProcessing to compute the latest state. More... | |
virtual bool | onNewState (NormalizedState const *iLatestState) |
Called from the RT thread from beforeProcessing to set the new state. More... | |
virtual bool | resetPreviousValues () |
Called from the RT thread from afterProcessing to reset previous values (copy current value to previous). More... | |
Protected Attributes | |
std::vector< ParamID > | fAllRegistrationOrder {} |
std::map< ParamID, std::unique_ptr< IRTJmbInParameter > > | fInboundMessagingParameters {} |
MessageHandler | fMessageHandler {} |
std::map< ParamID, std::unique_ptr< IRTJmbOutParameter > > | fOutboundMessagingParameters {} |
Parameters const & | fPluginParameters |
std::map< ParamID, std::unique_ptr< RTRawVstParameter > > | fVstParameters {} |
Private Member Functions | |
void | computeLatestState () |
Private Attributes | |
Concurrent::LockFree::AtomicValue< NormalizedState > | fLatestState |
Concurrent::LockFree::SingleElementQueue< NormalizedState > | fStateUpdate |
Friends | |
class | Debug::ParamDisplay |
Manages the state used by the processor: you add all the parameters that the state manages using the add method.
Combined with the RTProcessor class, everything will be handled for you (reading/writing the state, updating previous value, etc...).
|
explicit |
RTRawVstParam add | ( | RawVstParam | iParamDef | ) |
This method is called for each parameter managed by RTState.
The order in which this method is called is important and reflects the order that will be used when reading/writing state to the stream
RTVstParam< T > add | ( | VstParam< T > | iParamDef | ) |
This method is called for each parameter managed by RTState.
The order in which this method is called is important and reflects the order that will be used when reading/writing state to the stream
|
protected |
RTJmbInParam< T > addJmbIn | ( | JmbParam< T > | iParamDef | ) |
This method should be called to add an rt inbound jmb parameter.
RTJmbOutParam< T > addJmbOut | ( | JmbParam< T > | iParamDef | ) |
This method should be called to add an rt outbound jmb parameter.
|
protected |
|
protected |
|
virtual |
This method should be called at the end of process(ProcessData &data) method.
It will update the previous state to the current one and save the latest changes (if necessary) so that it is accessible via writeLatestState.
|
inlineprotectedvirtual |
Gives a chance to subclasses to tweak and/or display the state after being read.
|
virtual |
This method should be called in every frame when there are parameter changes to update this state accordingly.
|
virtual |
This method should be call at the beginning of the process(ProcessData &data) method before doing anything else.
The goal of this method is to update the current state with a state set by the UI (typical use case is to initialize the plugin when being loaded)
|
inlineprotectedvirtual |
Gives a chance to subclasses to tweak and/or display the state before being written.
|
protectedvirtual |
Called from the RT thread from afterProcessing to compute the latest state.
Can be overridden
|
private |
|
inline |
|
virtual |
This uses the same algorithm as when the param value is updated (implemented in applyParameterChanges) for consistency.
If the param changes more than once in a frame, only the last value is taken into account.
|
overridevirtual |
Called by the UI thread (from RTProcessor) to handle messages.
Implements IMessageHandler.
|
virtual |
Call this method after adding all the parameters.
If using the RT processor, it will happen automatically.
|
inline |
|
protectedvirtual |
Called from the RT thread from beforeProcessing to set the new state.
Can be overridden
|
virtual |
This method should be called from Processor::setState to update this state to the state stored in the stream.
Note that this method is called from the UI thread so the update is queued until the next frame.
|
protectedvirtual |
Called from the RT thread from afterProcessing to reset previous values (copy current value to previous).
Can be overridden.
|
virtual |
|
virtual |
This method should be called from Processor::getState to store the latest state to the stream.
Note that this method is called from the UI thread and gets the "latest" state as of the end of the last frame.
|
friend |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |