30 auto param =
fGUIState->findParam(iParamID);
31 std::shared_ptr<ITGUIParameter<T>> optionalParam =
nullptr;
35 auto typedParam = param->cast<T>();
38 optionalParam = std::move(typedParam);
42 DLOG_F(WARNING,
"param [%d] is not of the requested type [%s]", iParamID,
Utils::typeString<T>().c_str());
53 DLOG_F(WARNING,
"could not find any parameter (vst or jmb) with id [%d]... reverting to default", iParamID);
66 auto param =
fGUIState->getGUIVstParameter<T>(iParamID);
77 auto param =
fGUIState->getJmbParameter(iParamID);
81 DLOG_F(WARNING,
"jmb param [%d] not found", iParamID);
85 auto res = std::dynamic_pointer_cast<GUIJmbParameter<T>>(param);
88 DLOG_F(WARNING,
"jmb param [%d] is not of the requested type [%s]", iParamID,
typeid(T).name());
97template<
typename TParam>
102 DLOG_F(WARNING,
"Callback is empty... unlikely what you want to do");
111 fParamCxs.emplace_back(iParam.connect(std::move(iCallback)));
120template<
typename TParam>
123 bool iInvokeCallback)
127 DLOG_F(WARNING,
"Callback is empty... unlikely what you want to do");
135 auto callback = [iParam, cb2 = std::move(iCallback)] ()
mutable { cb2(iParam); };
140 fParamCxs.emplace_back(iParam.connect(std::move(callback)));
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition GUIJmbParameter.h:497
Represents an optional parameter (Jmb, Vst or no param at all).
Definition GUIOptionalParam.h:50
TParam __registerCallback1(TParam iParam, Parameters::ChangeCallback1< TParam > iCallback, bool iInvokeCallback)
Definition GUIParamCxMgr.hpp:121
GUIJmbParam< T > registerJmbParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition GUIParamCxMgr.hpp:75
TParam __registerListener(TParam iParam, Parameters::IChangeListener *iChangeListener)
Definition GUIParamCxMgr.h:216
GUIOptionalParam< T > registerOptionalParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition GUIParamCxMgr.hpp:27
GUIState * fGUIState
Definition GUIParamCxMgr.h:231
GUIVstParam< T > registerVstParam(ParamID iParamID, Parameters::IChangeListener *iChangeListener=nullptr)
Definition GUIParamCxMgr.hpp:64
TParam __registerCallback(TParam iParam, Parameters::ChangeCallback iCallback, bool iInvokeCallback)
Definition GUIParamCxMgr.hpp:98
std::vector< std::unique_ptr< FObjectCx > > fParamCxs
Definition GUIParamCxMgr.h:234
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition GUIVstParameter.h:280
Interface to implement to receive parameter changes.
Definition Parameters.h:45
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition Parameters.h:56
std::function< void(Param &)> ChangeCallback1
A callback which will be invoked for changes with the param as an argument.
Definition Parameters.h:62
std::string typeString()
typeid(T).name() does not account for const or reference.
Definition Metaprogramming.h:121
std::shared_ptr< T > make_sfo(Args &&...iArgs)
The VST SDK uses the concept of FObject (which are self contained reference counted objects) but requ...
Definition Utils.h:86
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:48