30 std::shared_ptr<ITGUIParameter<T>> optionalParam =
nullptr;
34 auto typedParam = param->cast<T>();
37 optionalParam = std::move(typedParam);
41 DLOG_F(WARNING,
"param [%d] is not of the requested type [%s]", iParamID, Utils::typeString<T>().c_str());
48 optionalParam = VstUtils::make_sfo<GUIValParameter<T>>(iParamID, T{});
52 DLOG_F(WARNING,
"could not find any parameter (vst or jmb) with id [%d]... reverting to default", iParamID);
80 DLOG_F(WARNING,
"jmb param [%d] not found", iParamID);
87 DLOG_F(WARNING,
"jmb param [%d] is not of the requested type [%s]", iParamID,
typeid(T).name());
96 template<
typename TParam>
101 DLOG_F(WARNING,
"Callback is empty... unlikely what you want to do");
110 fParamCxs.emplace_back(iParam.connect(std::move(iCallback)));
119 template<
typename TParam>
122 bool iInvokeCallback)
126 DLOG_F(WARNING,
"Callback is empty... unlikely what you want to do");
134 auto callback = [iParam, cb2 = std::move(iCallback)] ()
mutable { cb2(iParam); };
139 fParamCxs.emplace_back(iParam.connect(std::move(callback)));
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition: Parameters.h:55
std::vector< std::unique_ptr< FObjectCx > > fParamCxs
Definition: GUIParamCxMgr.h:233
std::shared_ptr< IGUIJmbParameter > getJmbParameter(ParamID iParamID) const
Definition: GUIState.cpp:282
TParam __registerCallback1(TParam iParam, Parameters::ChangeCallback1< TParam > iCallback, bool iInvokeCallback)
Definition: GUIParamCxMgr.hpp:120
GUIState * fGUIState
Definition: GUIParamCxMgr.h:230
std::shared_ptr< GUIVstParameter< T > > getGUIVstParameter(ParamID iParamID) const
Definition: GUIState.h:342
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIVstParameter.h:278
TParam __registerListener(TParam iParam, Parameters::IChangeListener *iChangeListener)
Definition: GUIParamCxMgr.h:215
Definition: GUIState.h:36
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIJmbParameter.h:495
GUIVstParam< T > registerVstParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition: GUIParamCxMgr.hpp:63
std::shared_ptr< IGUIParameter > findParam(ParamID iParamID) const
Generic call which returns a param with the given id or nullptr if there isn't one.
Definition: GUIState.cpp:35
This is the templated version providing serializer methods, very similar to the GUIVstParameter conce...
Definition: GUIJmbParameter.h:86
GUIOptionalParam< T > registerOptionalParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition: GUIParamCxMgr.hpp:26
std::function< void(Param &)> ChangeCallback1
A callback which will be invoked for changes with the param as an argument.
Definition: Parameters.h:61
GUIJmbParam< T > registerJmbParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition: GUIParamCxMgr.hpp:74
constexpr ParamID UNDEFINED_PARAM_ID
Constant used throughout the code to test whether the ParamID represents a valid id or an undefined o...
Definition: Types.h:47
TParam __registerCallback(TParam iParam, Parameters::ChangeCallback iCallback, bool iInvokeCallback)
Definition: GUIParamCxMgr.hpp:97
Interface to implement to receive parameter changes.
Definition: Parameters.h:43
Represents an optional parameter (Jmb, Vst or no param at all).
Definition: GUIOptionalParam.h:48