20 #include <vstgui/lib/cview.h> 89 bool iInvokeCallback);
99 bool iInvokeCallback);
115 bool iSubscribeToChanges =
true);
128 bool iInvokeCallback =
false);
141 bool iInvokeCallback =
false);
158 bool iSubscribeToChanges =
true);
172 bool iInvokeCallback =
false);
186 bool iInvokeCallback =
false);
208 bool iInvokeCallback =
false);
218 bool iInvokeCallback =
false);
239 bool iInvokeCallback =
false) {
249 bool iInvokeCallback =
false) {
258 [[deprecated(
"Since 4.0.0 - use registerVstParam<bool> directly")]]
262 [[deprecated(
"Since 4.0.0 - use registerVstParam<Percent> directly")]]
287 bool iInvokeCallback =
false);
298 bool iInvokeCallback =
false);
312 return registerVstParam<T>(iParamDef->fParamID, iSubscribeToChanges);
324 bool iInvokeCallback =
false) {
325 return registerVstCallback<T>(iParamDef->fParamID, std::move(iChangeCallback), iInvokeCallback);
344 bool iInvokeCallback =
false) {
345 return registerVstCallback<T>(iParamDef->fParamID, std::move(iChangeCallback), iInvokeCallback);
370 bool iInvokeCallback =
false);
381 bool iInvokeCallback =
false);
395 return registerJmbParam<T>(iParamDef->fParamID, iSubscribeToChanges);
407 bool iInvokeCallback =
false) {
408 return registerJmbCallback<T>(iParamDef->fParamID, std::move(iChangeCallback), iInvokeCallback);
427 bool iInvokeCallback =
false) {
428 return registerJmbCallback<T>(iParamDef->fParamID, std::move(iChangeCallback), iInvokeCallback);
443 return registerJmbParam<T>(iParam.
getParamID(), iSubscribeToChanges);
455 bool iInvokeCallback =
false) {
456 return registerJmbCallback<T>(iParam.
getParamID(), std::move(iChangeCallback), iInvokeCallback);
474 bool iInvokeCallback =
false) {
475 return registerJmbCallback<T>(iParam.
getParamID(), std::move(iChangeCallback), iInvokeCallback);
511 [[deprecated(
"Since 4.0.0 - If you need this kind of granularity, maintain your own connections")]]
519 [[deprecated(
"Since 4.0.0 - If you need this kind of granularity, maintain your own connections")]]
528 [[deprecated(
"Since 4.0.0 - If you need this kind of granularity, maintain your own connections")]]
537 [[deprecated(
"Since 4.0.0 - If you need this kind of granularity, maintain your own connections")]]
560 template<
typename TView>
564 static_assert(std::is_convertible<TView *, VSTGUI::CView*>::value,
"TView must be a subclass of CView");
605 bool iInvokeCallback =
false)
607 auto callback = [view = this->
fView, cb2 = std::move(iChangeCallback)] (
GUIVstParam<T> &iParam) {
611 return ParamAware::registerCallback<T>(iParamDef, std::move(callback), iInvokeCallback);
631 bool iInvokeCallback =
false)
633 auto callback = [view = this->
fView, cb2 = std::move(iChangeCallback)] (
GUIJmbParam<T> &iParam) {
637 return ParamAware::registerCallback<T>(iParam, std::move(callback), iInvokeCallback);
TView * fView
Definition: ParamAware.h:650
GUIOptionalParam< T > registerOptionalParam(ParamID iParamID, bool iSubscribeToChanges=true)
Registers an optional parameter which handles Vst, Jmb or no parameter at all.
Definition: ParamAware.hpp:30
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 ...
Definition: ParamAware.h:322
This class is inherited by classes who want to be aware of parameters and be notified when they chang...
Definition: ParamAware.h:63
void onParameterChange(ParamID iParamID) override
This implementation simply delegates to the listener registered by registerListener().
Definition: ParamAware.h:643
Definition: GUIState.h:41
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 ...
Definition: ParamAware.h:405
GUIRawVstParam registerCallback(RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
Registers a raw parameter (no conversion).
Definition: ParamAware.h:237
std::function< void(TView *, Param &)> ChangeCallback2
A callback which will be invoked for changes with the view and param as arguments.
Definition: Parameters.h:67
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 par...
Definition: ParamAware.hpp:88
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIRawVstParameter.h:265
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition: Parameters.h:55
GUIOptionalParam< T > registerOptionalCallback(ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
Registers an optional parameter which handles Vst, Jmb or no parameter at all.
Definition: ParamAware.hpp:44
void registerListener(ChangeListener iListener)
Registers a listener invoked when a parameter changes.
Definition: ParamAware.h:583
std::shared_ptr< RawVstParamDef > RawVstParam
Definition: ParamDef.h:508
virtual void initState(GUIState *iGUIState)
Called during initialization.
Definition: ParamAware.cpp:36
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 vi...
Definition: ParamAware.h:311
GUIVstParam< Percent > registerVstPercentParam(ParamID iParamID, bool iSubscribeToChanges=true)
Definition: ParamAware.cpp:89
virtual void registerParameters()
Subclasses should override this method to register each parameter.
Definition: ParamAware.h:497
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIVstParameter.h:278
GUIOptionalParam< int32 > registerOptionalDiscreteParam(ParamID iParamID, int32 iStepCount, bool iSubscribeToChanges=true)
Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all.
Definition: ParamAware.cpp:115
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 ...
Definition: ParamAware.h:342
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 (ac...
Definition: ParamAware.h:453
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.
Definition: ParamAware.hpp:128
Definition: DrawContext.cpp:24
GUIVstParam< T > unregisterParam(GUIVstParam< T > const &iParam)
Removes the registration of the provided param (closing the connection/stopping to listen)
Definition: ParamAware.h:529
GUIVstParam< bool > registerVstBooleanParam(ParamID iParamID, bool iSubscribeToChanges=true)
Definition: ParamAware.cpp:81
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.
Definition: ParamAware.cpp:55
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 > registerCallback(VstParam< T > const &iParamDef, Parameters::ChangeCallback2< TView, GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
Register a callback for the Vst parameter.
Definition: ParamAware.h:603
virtual ~ParamAware()
Definition: ParamAware.cpp:28
GUIVstParam< T > registerVstParam(ParamID iParamID, bool iSubscribeToChanges=true)
Register a Vst parameter simply given its id onParameterChange() will be called on changes (if iSubsc...
Definition: ParamAware.hpp:76
std::unique_ptr< GUIParamCxMgr > fParamCxMgr
Definition: ParamAware.h:551
std::function< void(TView *, ParamID)> ChangeListener
Definition: ParamAware.h:571
GUIJmbParam< T > unregisterParam(GUIJmbParam< T > const &iParam)
Removes the registration of the provided param (closing the connection/stopping to listen)
Definition: ParamAware.h:538
GUIRawVstParam unregisterParam(GUIRawVstParam const &iParam)
Removes the registration of the provided param (closing the connection/stopping to listen)
Definition: ParamAware.h:520
void unregisterAll()
Unregisters all parameters.
Definition: ParamAware.cpp:97
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 vi...
Definition: ParamAware.h:394
bool unregisterParam(ParamID iParamID)
Removes the registration of the provided param (closing the connection/stopping to listen)
Definition: ParamAware.h:512
GUIRawVstParam registerRawVstParam(ParamID iParamID, bool iSubscribeToChanges=true)
Registers a raw parameter (no conversion) onParameterChange() will be called on changes (if iSubscrib...
Definition: ParamAware.cpp:44
This subclass allows for registering callbacks to any kind of view without having to inherit from it.
Definition: ParamAware.h:561
std::function< void(Param &)> ChangeCallback1
A callback which will be invoked for changes with the param as an argument.
Definition: Parameters.h:61
std::shared_ptr< VstParamDef< T > > VstParam
Definition: ParamDef.h:507
IGUIParam registerBaseCallback(ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback)
Registers a callback for the "base" param for the most generic use case.
Definition: ParamAware.cpp:173
GUIRawVstParam registerCallback(RawVstParam const &iParamDef, Parameters::ChangeCallback1< GUIRawVstParam > iChangeCallback, bool iInvokeCallback=false)
Registers a raw parameter (no conversion).
Definition: ParamAware.h:247
GUIJmbParam< T > registerCallback(GUIJmbParam< T > &iParam, Parameters::ChangeCallback2< TView, GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
Register a callback for the Jmb parameter.
Definition: ParamAware.h:629
ParamAwareView(TView *iView)
Definition: ParamAware.h:574
ParamID getParamID() const
Definition: GUIJmbParameter.h:514
void invokeAll()
Invoke all (currently) registered callbacks and onParameterChange() (if registered).
Definition: ParamAware.cpp:106
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 ...
Definition: ParamAware.h:425
GUIJmbParam< T > registerJmbParam(ParamID iParamID, bool iSubscribeToChanges=true)
Registers the Jmb param by its id and return the wrapper to the param.
Definition: ParamAware.hpp:116
void onParameterChange(ParamID iParamID) override
This is the callback that should be implemented to handle parameter changes.
Definition: ParamAware.h:543
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...
Definition: ParamAware.h:442
std::shared_ptr< JmbParamDef< T > > JmbParam
Definition: ParamDef.h:514
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.
Definition: ParamAware.cpp:130
GUIRawVstParam registerParam(RawVstParam const &iParamDef, bool iSubscribeToChanges=true)
Registers a raw parameter (no conversion).
Definition: ParamAware.h:229
Wrapper instance returned by ParamAware::registerBaseParam() methods.
Definition: IGUIParameter.h:401
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 (ac...
Definition: ParamAware.h:472
ChangeListener fListener
Definition: ParamAware.h:651
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
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...
Definition: ParamAware.cpp:162