Jamba  3.0.2
pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView > Class Template Reference

#include <GUIParamCxAware.h>

Inherits pongasoft::VST::GUI::Params::GUIParamCxAware.

Public Types

using ChangeListener = std::function< void(TView *, ParamID)>
 

Public Member Functions

void onParameterChange (ParamID iParamID) override
 
template<typename T >
bool registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
GUIRawVstParam registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback2< TView, GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (GUIJmbParam< T > &iParam, Parameters::ChangeCallback2< TView, GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
void registerListener (ChangeListener iListener)
 
 ViewGUIParamCxAware (TView *iView)
 
- Public Member Functions inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
bool __internal__registerRawVstControl (int32_t iParamID, ParamValue &oControlValue, GUIRawVstParam &oGUIRawVstParam)
 
template<typename T >
bool __internal__registerVstControl (int32_t iParamID, T &oControlValue, GUIVstParam< T > &oGUIVstParam)
 
virtual void initState (GUIState *iGUIState)
 
void invokeAll ()
 
GUIRawVstParam registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIRawVstParam registerParam (RawVstParam const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerParam (VstParam< T > const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIJmbParam< T > registerParam (GUIJmbParam< T > &iParamDef)
 
virtual void registerParameters ()
 
GUIRawVstParam registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
GUIRawVstParam registerRawVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< bool > registerVstBooleanParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< PercentregisterVstPercentParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
void unregisterAll ()
 
bool unregisterParam (ParamID iParamID)
 
GUIRawVstParam unregisterParam (GUIRawVstParam const &iParam)
 
template<typename T >
GUIVstParam< T > unregisterParam (GUIVstParam< T > const &iParam)
 
template<typename T >
GUIJmbParam< T > unregisterParam (GUIJmbParam< T > const &iParam)
 
virtual ~GUIParamCxAware ()
 

Private Attributes

ChangeListener fListener
 
TView * fView
 

Additional Inherited Members

- Protected Attributes inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
std::unique_ptr< GUIParamCxMgrfParamCxMgr {}
 

Detailed Description

template<typename TView>
class pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >

This subclass allows for registering callbacks to any kind of view without having to inherit from it (see GUIState::registerConnectionFor)

Template Parameters
TViewshould be a subclass of VSTGUI::CView

Member Typedef Documentation

◆ ChangeListener

template<typename TView>
using pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::ChangeListener = std::function<void(TView *, ParamID)>

Constructor & Destructor Documentation

◆ ViewGUIParamCxAware()

template<typename TView>
pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::ViewGUIParamCxAware ( TView *  iView)
inlineexplicit

Member Function Documentation

◆ onParameterChange()

template<typename TView>
void pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::onParameterChange ( ParamID  iParamID)
inlineoverridevirtual

Callback when a parameter changes. Empty default implementation

Reimplemented from pongasoft::VST::GUI::Params::GUIParamCxAware.

◆ registerCallback() [1/7]

template<typename TView>
template<typename T >
bool pongasoft::VST::GUI::Params::GUIParamCxAware::registerCallback ( typename T  )

This method registers the callback to be invoked on GUIJmbParam changes. Since the callback (Parameters::ChangeCallback1) is providing the param, it is not returned by this api.

Example:

registerCallback<Range>(fState->fMyParam, [] (GUIJmbParam<Range> &iParam) { iParam.getValue()...; });
Returns
false if GUIParamCxAware::initState has not been called

◆ registerCallback() [2/7]

template<typename TView>
GUIRawVstParam pongasoft::VST::GUI::Params::GUIParamCxAware::registerCallback
inline

Registers a raw parameter (no conversion)

◆ registerCallback() [3/7]

template<typename TView>
template<typename T >
bool pongasoft::VST::GUI::Params::GUIParamCxAware::registerCallback ( typename T  )

Convenient call to register a callback for the Vst param simply by using its description. Takes care of the type due to method API. Since the callback (Parameters::ChangeCallback1) is providing the param, it is not returned by this api.

Example:

registerCallback<int>(fParams->fMyParam, [] (GUIVstParam<int> &iParam) { iParam.getValue()...; });

Note how the compiler requires the type (which seems that it could be inferred).

Returns
false if not found or not proper type

◆ registerCallback() [4/7]

template<typename TView>
template<typename T >
GUIJmbParam< T > pongasoft::VST::GUI::Params::GUIParamCxAware::registerCallback ( typename T  )

This method registers the callback to be invoked on GUIJmbParam changes.

Returns
a copy of iParamDef for convenience and symmetry of the APIs or empty wrapper if GUIParamCxAware::initState has not been called

◆ registerCallback() [5/7]

template<typename TView>
template<typename T >
GUIVstParam< T > pongasoft::VST::GUI::Params::GUIParamCxAware::registerCallback ( typename T  )

Convenient call to register a callback for the Vst param simply by using its description. Takes care of the type due to method API

Returns
empty param if not found or not proper type

◆ registerCallback() [6/7]

template<typename TView>
template<typename T >
bool pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::registerCallback ( VstParam< T > const &  iParamDef,
Parameters::ChangeCallback2< TView, GUIVstParam< T >>  iChangeCallback,
bool  iInvokeCallback = false 
)
inline

Register a callback for the Vst parameter. This version is specific to this class and allow for the view to be passed back (since the view is not inheriting from this class).

Example:

registerCallback<bool>(fParams->fMyParam, [] (CTextLabel *iView, GUIVstParam<bool> &iParam) { iParam.getValue()...; });
Returns
false if not found or not proper type

◆ registerCallback() [7/7]

template<typename TView>
template<typename T >
bool pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::registerCallback ( GUIJmbParam< T > &  iParam,
Parameters::ChangeCallback2< TView, GUIJmbParam< T >>  iChangeCallback,
bool  iInvokeCallback = false 
)
inline

Register a callback for the Jmb parameter. This version is specific to this class and allow for the view to be passed back (since the view is not inheriting from this class).

Example:

registerCallback<Range>(fState->fMyParam, [] (CTextLabel *iView, GUIJmbParam<Range> &iParam) { iParam.getValue()...; });
Returns
false if not found or not proper type

◆ registerListener()

template<typename TView>
void pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::registerListener ( ChangeListener  iListener)
inline

Since this class is intended to be used without inheriting from GUIParamCxAware, you can register a listener so that the onParameterChange method will be invoking this listener.

Member Data Documentation

◆ fListener

template<typename TView>
ChangeListener pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::fListener
private

◆ fView

template<typename TView>
TView* pongasoft::VST::GUI::Params::ViewGUIParamCxAware< TView >::fView
private

The documentation for this class was generated from the following file: