Jamba C++ API
5.1.1
|
This class is inherited by classes who want to be aware of parameters and be notified when they change. More...
#include <ParamAware.h>
Inherits Parameters::IChangeListener.
Inherited by CustomViewAdapter< CParamDisplay >, CustomViewAdapter< CTextButton >, CustomViewAdapter< CViewContainer >, CustomViewAdapter< TextEdit >, GUIParamCxAware, ParamAwareView< TView >, CustomController, CustomView, and CustomViewAdapter< TView >.
Public Member Functions | |
virtual void | initState (GUIState *iGUIState) |
Called during initialization. More... | |
void | invokeAll () |
Invoke all (currently) registered callbacks and onParameterChange() (if registered). More... | |
void | onParameterChange (ParamID iParamID) override |
This is the callback that should be implemented to handle parameter changes. More... | |
IGUIParam | registerBaseCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback) |
Registers a callback for the "base" param for the most generic use case. More... | |
IGUIParam | registerBaseCallback (ParamID iParamID, Parameters::ChangeCallback1< IGUIParam > iChangeCallback, bool iInvokeCallback) |
Registers a callback for the "base" param for the most generic use case. More... | |
IGUIParam | registerBaseParam (ParamID iParamID, bool iSubscribeToChanges=true) |
Registers the "base" param for the most generic use case but as a result is fairly limited and mainly gives access to the string representation of the param. More... | |
GUIRawVstParam | registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Registers a raw parameter (no conversion). More... | |
GUIRawVstParam | registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback1< GUIRawVstParam > iChangeCallback, bool iInvokeCallback=false) |
Registers a raw parameter (no conversion). More... | |
template<typename T > | |
GUIVstParam< T > | registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIVstParam< T > | registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerCallback (JmbParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerCallback (JmbParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerCallback (GUIJmbParam< T > &iParam, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerCallback (GUIJmbParam< T > &iParam, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Registers a callback for the Jmb param by its id and return the wrapper to the param. More... | |
template<typename T > | |
GUIJmbParam< T > | registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Registers a callback for the Jmb param by its id and return the wrapper to the param. More... | |
template<typename T > | |
GUIJmbParam< T > | registerJmbParam (ParamID iParamID, bool iSubscribeToChanges=true) |
Registers the Jmb param by its id and return the wrapper to the param. More... | |
template<typename T > | |
GUIOptionalParam< T > | registerOptionalCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all. More... | |
template<typename T > | |
GUIOptionalParam< T > | registerOptionalCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIOptionalParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all. More... | |
GUIOptionalParam< int32 > | registerOptionalDiscreteCallback (ParamID iParamID, int32 iStepCount, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. More... | |
GUIOptionalParam< int32 > | registerOptionalDiscreteCallback (ParamID iParamID, int32 iStepCount, Parameters::ChangeCallback1< GUIOptionalParam< int32 >> iChangeCallback, bool iInvokeCallback=false) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. More... | |
GUIOptionalParam< int32 > | registerOptionalDiscreteParam (ParamID iParamID, int32 iStepCount, bool iSubscribeToChanges=true) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. More... | |
template<typename T > | |
GUIOptionalParam< T > | registerOptionalParam (ParamID iParamID, bool iSubscribeToChanges=true) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all. More... | |
GUIRawVstParam | registerParam (RawVstParam const &iParamDef, bool iSubscribeToChanges=true) |
Registers a raw parameter (no conversion). More... | |
template<typename T > | |
GUIVstParam< T > | registerParam (VstParam< T > const &iParamDef, bool iSubscribeToChanges=true) |
Convenient call to register a Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerParam (JmbParam< T > const &iParamDef, bool iSubscribeToChanges=true) |
Convenient call to register a Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam ). More... | |
template<typename T > | |
GUIJmbParam< T > | registerParam (GUIJmbParam< T > &iParam, bool iSubscribeToChanges=true) |
Convenient call to register a Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam ). More... | |
virtual void | registerParameters () |
Subclasses should override this method to register each parameter. More... | |
GUIRawVstParam | registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes. More... | |
GUIRawVstParam | registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIRawVstParam > iChangeCallback, bool iInvokeCallback=false) |
Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes. More... | |
GUIRawVstParam | registerRawVstParam (ParamID iParamID, bool iSubscribeToChanges=true) |
Registers a raw parameter (no conversion) onParameterChange() will be called on changes (if iSubscribeToChanges is set to true ). More... | |
GUIVstParam< bool > | registerVstBooleanParam (ParamID iParamID, bool iSubscribeToChanges=true) |
template<typename T > | |
GUIVstParam< T > | registerVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes. More... | |
template<typename T > | |
GUIVstParam< T > | registerVstCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false) |
Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes. More... | |
template<typename T > | |
GUIVstParam< T > | registerVstParam (ParamID iParamID, bool iSubscribeToChanges=true) |
Register a Vst parameter simply given its id onParameterChange() will be called on changes (if iSubscribeToChanges is set to true ). More... | |
GUIVstParam< Percent > | registerVstPercentParam (ParamID iParamID, bool iSubscribeToChanges=true) |
void | unregisterAll () |
Unregisters all parameters. More... | |
bool | unregisterParam (ParamID iParamID) |
Removes the registration of the provided param (closing the connection/stopping to listen) More... | |
GUIRawVstParam | unregisterParam (GUIRawVstParam const &iParam) |
Removes the registration of the provided param (closing the connection/stopping to listen) More... | |
template<typename T > | |
GUIVstParam< T > | unregisterParam (GUIVstParam< T > const &iParam) |
Removes the registration of the provided param (closing the connection/stopping to listen) More... | |
template<typename T > | |
GUIJmbParam< T > | unregisterParam (GUIJmbParam< T > const &iParam) |
Removes the registration of the provided param (closing the connection/stopping to listen) More... | |
virtual | ~ParamAware () |
Protected Attributes | |
std::unique_ptr< GUIParamCxMgr > | fParamCxMgr {} |
This class is inherited by classes who want to be aware of parameters and be notified when they change.
The typical use case is to have a custom view (or a custom controller) inherits from this class and implements the registerParameters()
method which in turn calls the various registerXXXParam
flavors and then implements onParameterChange()
to handle the callback:
Views::CustomView
, Views::CustomViewAdapter
and Views::CustomController
already inherit from this class.
|
virtual |
|
virtual |
Called during initialization.
Jamba takes care of properly initializing instances of this class with the gui state when they get instantiated.
Reimplemented in StateAwareCustomViewAdapter< TView, TGUIState >, and StateAwareCustomController< TGUIState >.
void invokeAll | ( | ) |
Invoke all (currently) registered callbacks and onParameterChange()
(if registered).
|
inlineoverridevirtual |
This is the callback that should be implemented to handle parameter changes.
This callback is only invoked if any registerXXParam
method is called.
Implements Parameters::IChangeListener.
Reimplemented in ParamAwareView< TView >, CustomViewAdapter< TView >, CustomViewAdapter< CParamDisplay >, CustomViewAdapter< CTextButton >, CustomViewAdapter< TextEdit >, CustomViewAdapter< CViewContainer >, CustomView, ScrollbarView, SwitchViewContainer, and DebugParamDisplayView.
IGUIParam registerBaseCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback | ||
) |
Registers a callback for the "base" param for the most generic use case.
As a result it is fairly limited and mainly gives access to the string representation of the param.
IGUIParam registerBaseCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback1< IGUIParam > | iChangeCallback, | ||
bool | iInvokeCallback | ||
) |
Registers a callback for the "base" param for the most generic use case.
As a result it is fairly limited and mainly gives access to the string representation of the param.
IGUIParam registerBaseParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
Registers the "base" param for the most generic use case but as a result is fairly limited and mainly gives access to the string representation of the param.
onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
|
inline |
Registers a raw parameter (no conversion).
Convenient call using the param def (accessible in state-aware views via fParams->fMyParam
).
|
inline |
Registers a raw parameter (no conversion).
Convenient call using the param def (accessible in state-aware views via fParams->fMyParam
).
|
inline |
Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
|
inline |
Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
Example:
|
inline |
Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
|
inline |
Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
Example:
|
inline |
Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam
).
Takes care of the type due to method API.
|
inline |
Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam
).
Takes care of the type due to method API.
Example:
GUIJmbParam< T > registerJmbCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers a callback for the Jmb param by its id and return the wrapper to the param.
The callback will be invoked when the parameter changes.
GUIJmbParam< T > registerJmbCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback1< GUIJmbParam< T >> | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers a callback for the Jmb param by its id and return the wrapper to the param.
The callback will be invoked when the parameter changes.
GUIJmbParam< T > registerJmbParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
Registers the Jmb param by its id and return the wrapper to the param.
onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
GUIOptionalParam< T > registerOptionalCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all.
This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. The callback will be invoked when the parameter changes.
GUIOptionalParam< T > registerOptionalCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback1< GUIOptionalParam< T >> | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all.
This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. The callback will be invoked when the parameter changes.
GUIOptionalParam< int32 > registerOptionalDiscreteCallback | ( | ParamID | iParamID, |
int32 | iStepCount, | ||
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all.
The underlying parameter will be converted to a discrete parameter if possible. This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. The callback will be invoked when the parameter changes.
GUIOptionalParam< int32 > registerOptionalDiscreteCallback | ( | ParamID | iParamID, |
int32 | iStepCount, | ||
Parameters::ChangeCallback1< GUIOptionalParam< int32 >> | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all.
The underlying parameter will be converted to a discrete parameter if possible. This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. The callback will be invoked when the parameter changes.
GUIOptionalParam< int32 > registerOptionalDiscreteParam | ( | ParamID | iParamID, |
int32 | iStepCount, | ||
bool | iSubscribeToChanges = true |
||
) |
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all.
The underlying parameter will be converted to a discrete parameter if possible. This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
GUIOptionalParam< T > registerOptionalParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
Registers an optional parameter which handles Vst, Jmb or no parameter at all.
This parameter is particularly useful to write very generic views that can accept "any" kind of parameter (Vst or Jmb) while still being usable if no parameter is assigned at all. onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
|
inline |
Registers a raw parameter (no conversion).
Convenient call using the param def (accessible in state-aware views via fParams->fMyParam
).
|
inline |
Convenient call to register a Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
|
inline |
Convenient call to register a Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam
).
Takes care of the type due to method API.
|
inline |
Convenient call to register a Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam
).
Takes care of the type due to method API.
|
inlinevirtual |
Subclasses should override this method to register each parameter.
Jamba automatically calls this method and you should not have to invoke it yourself.
unregisterAll()
prior to calling this method so it is ok to assume that there is no parameter registered prior to this call.ParamAware
, which is generally the case while using the VSTGUI editor Reimplemented in StepPadView, CustomDiscreteControlView, StepButtonView, DiscreteButtonView, ScrollbarView, TCustomControlView< T >, TCustomControlView< int32 >, ParamImageView, TextButtonView, SwitchViewContainer, ParamDisplayView, and TextEditView.
GUIRawVstParam registerRawVstCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes.
GUIRawVstParam registerRawVstCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback1< GUIRawVstParam > | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes.
GUIRawVstParam registerRawVstParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
Registers a raw parameter (no conversion) onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
GUIVstParam< bool > registerVstBooleanParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
GUIVstParam< T > registerVstCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes.
GUIVstParam< T > registerVstCallback | ( | ParamID | iParamID, |
Parameters::ChangeCallback1< GUIVstParam< T >> | iChangeCallback, | ||
bool | iInvokeCallback = false |
||
) |
Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes.
GUIVstParam< T > registerVstParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
Register a Vst parameter simply given its id onParameterChange()
will be called on changes (if iSubscribeToChanges
is set to true
).
GUIVstParam< Percent > registerVstPercentParam | ( | ParamID | iParamID, |
bool | iSubscribeToChanges = true |
||
) |
void unregisterAll | ( | ) |
Unregisters all parameters.
|
inline |
Removes the registration of the provided param (closing the connection/stopping to listen)
true
if the param was present, false
otherwise
|
inline |
Removes the registration of the provided param (closing the connection/stopping to listen)
param = unregisterParam(param)
|
inline |
Removes the registration of the provided param (closing the connection/stopping to listen)
param = unregisterParam(param)
|
inline |
Removes the registration of the provided param (closing the connection/stopping to listen)
param = unregisterParam(param)
|
protected |