79 std::shared_ptr<IGUIParameter>
findParam(ParamID iParamID)
const;
87 return std::make_shared<GUIRawVstParameter>(iParamID,
120 return ptr->connect(iChangeListener);
135 return ptr->connect(iChangeCallback);
157 template<
typename TView>
164 template<
typename TView>
165 [[deprecated(
"Since 4.0.0 - Use makeParamAware instead")]]
173 std::shared_ptr<IGUIJmbParameter>
getJmbParameter(ParamID iParamID)
const;
179 virtual tresult
readRTState(IBStreamer &iStreamer);
228 bool showDialog(std::string iTemplateName)
override;
257 std::map<ParamID, std::shared_ptr<IGUIJmbParameter>>
fJmbParams{};
267 void addJmbParam(std::shared_ptr<IGUIJmbParameter> iParameter);
273 tresult
sendMessage(IPtr<IMessage> iMessage)
override;
276 IBStreamer &iStreamer,
288template<
typename TPluginParameters>
292 static_assert(std::is_convertible<TPluginParameters*, Parameters*>::value,
"TPluginParameters must be a subclass of Parameters");
313 auto guiParam = iParamDef->newGUIParam();
324 if(!iParamDef->fShared)
326 DLOG_F(WARNING,
"broadcast ignored: parameter [%d] is not marked shared", iParamDef->fParamID);
330 tresult res = kResultOk;
342 if(iParamDef->writeToMessage(iMessage, m) == kResultOk)
363 DLOG_F(WARNING,
"vst param [%d] not found", iParamID);
367 auto res = param->asVstParameter<T>();
373 DLOG_F(WARNING,
"vst param [%d] is not of the requested type", iParamID);
395 auto ptr = std::dynamic_pointer_cast<JmbParamDef<T>>(IParamDef::shared_from_this());
This helper class is used to display the parameters (vst/jmb) WARNING: this class is allocating memor...
Definition ParamDisplay.h:35
PluginParameters const & fParams
Definition GUIState.h:304
TPluginParameters PluginParameters
Definition GUIState.h:295
GUIPluginState(PluginParameters const &iPluginParameters)
Definition GUIState.h:298
bool dismissDialog() override
Dismisses the currently shown dialog.
Definition GUIState.cpp:343
Parameters const & getPluginParameters() const
Definition GUIState.h:55
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:36
std::shared_ptr< RawVstParamDef > getRawVstParamDef(ParamID iParamID) const
Definition GUIState.h:95
bool showDialog(std::string iTemplateName) override
This method is called with the name of the template to use for the dialog.
Definition GUIState.cpp:332
bool existsVst(ParamID iParamID) const
Definition GUIState.h:66
ParamAwareView< TView > * registerConnectionFor(TView *iView)
Definition GUIState.h:166
ParamAwareView< TView > * makeParamAware(TView *iView)
Allow for registering an arbitrary callback on an arbitrary view without having to inherit from the v...
Definition GUIState.h:158
virtual tresult readGUIState(IBStreamer &iStreamer)
This method is called from the GUI controller setState method and reads the state previously saved by...
Definition GUIState.cpp:119
virtual tresult readRTState(IBStreamer &iStreamer)
This method is called from the GUI controller setComponentState method and reads the state coming fro...
Definition GUIState.cpp:102
std::shared_ptr< GUIVstParameter< T > > getGUIVstParameter(VstParam< T > iParamDef) const
Definition GUIState.h:106
std::unique_ptr< FObjectCx > connect(ParamID iParamID, Parameters::IChangeListener *iChangeListener) const
Connects the paramID to the listener.
Definition GUIState.h:116
virtual tresult readDeprecatedGUIState(uint16 iDeprecatedVersion, IBStreamer &iStreamer, NormalizedState::SaveOrder const &iLatestSaveOrder)
Definition GUIState.cpp:143
std::vector< ParamID > const & getAllRegistrationOrder() const
Definition GUIState.h:211
std::unique_ptr< GUIParamCxMgr > createParamCxMgr()
The CustomView class automatically calls this method to get a handle of a ParamCxMgr used to register...
Definition GUIState.cpp:277
virtual tresult init(VstParametersSPtr iVstParameters, IMessageProducer *iMessageProducer, IDialogHandler *iDialogHandler)
Called by the GUIController.
Definition GUIState.cpp:241
virtual tresult writeGUIState(IBStreamer &oStreamer) const
This method is called from the GUI controller getState method and writes the state specific to the GU...
Definition GUIState.cpp:205
std::shared_ptr< IGUIJmbParameter > getJmbParameter(ParamID iParamID) const
Definition GUIState.cpp:285
IMessageProducer * fMessageProducer
Definition GUIState.h:248
tresult setParamNormalized(NormalizedState const *iNormalizedState)
Definition GUIState.cpp:86
ParamAwareViews fParamAwareViews
Definition GUIState.h:245
std::unique_ptr< FObjectCx > connect(ParamID iParamID, Parameters::ChangeCallback iChangeCallback) const
Connects the paramID to the callback.
Definition GUIState.h:131
Parameters const & fPluginParameters
Definition GUIState.h:239
IDialogHandler * fDialogHandler
Definition GUIState.h:254
std::shared_ptr< GUIRawVstParameter > getRawVstParameter(ParamID iParamID) const
Definition GUIState.h:84
VstParametersSPtr fVstParameters
Definition GUIState.h:242
std::vector< ParamID > fAllRegistrationOrder
Definition GUIState.h:260
MessageHandler fMessageHandler
Definition GUIState.h:251
GUIJmbParam< T > add(JmbParam< T > iParamDef)
This method is called for each parameter managed by the GUIState that is not a regular VST parameter.
Definition GUIState.h:311
std::shared_ptr< GUIVstParameter< T > > getGUIVstParameter(ParamID iParamID) const
Definition GUIState.h:357
GUIState(Parameters const &iPluginParameters)
Definition GUIState.cpp:28
tresult broadcast(JmbParam< T > const &iParamDef, T const &iMessage)
Broadcast a message without requiring the need to instantiate a GUIJmbParam.
Definition GUIState.h:322
IPtr< IMessage > allocateMessage() override
Allocates a message instance.
Definition GUIState.cpp:310
std::map< ParamID, std::shared_ptr< IGUIJmbParameter > > fJmbParams
Definition GUIState.h:257
void addJmbParam(std::shared_ptr< IGUIJmbParameter > iParameter)
Definition GUIState.cpp:49
bool existsJmb(ParamID iParamID) const
Definition GUIState.h:71
virtual tresult handleGUIStateUpgrade(int16 iDeprecatedVersion, int16 iVersion) const
When Jamba detects that a previously saved GUI state matches a deprecated version (as registered with...
Definition GUIState.h:224
tresult sendMessage(IPtr< IMessage > iMessage) override
Sends the given message to the peer.
Definition GUIState.cpp:321
tresult handleMessage(Message const &iMessage)
Handle an incoming message => will forward to JmbParam marked shared by rtOwner.
Definition GUIState.h:202
Defines the interface to show or dismiss a modal/dialog window which is a window that captures all ev...
Definition IDialogHandler.h:47
This class manages the views that have been made "param aware".
Definition ParamAwareViews.h:88
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition GUIJmbParameter.h:497
This is the templated version providing serializer methods, very similar to the GUIVstParameter conce...
Definition GUIJmbParameter.h:88
Maintains the connections established between parameters and its listeners/callbacks.
Definition GUIParamCxMgr.h:33
This subclass allows for registering callbacks to any kind of view without having to inherit from it.
Definition ParamAware.h:563
Abstraction for allocating and sending a message.
Definition MessageProducer.h:35
std::shared_ptr< GUI::Params::IGUIJmbParameter > newGUIParam() override
Create a new IGUIJmbParameter of the proper subtype.
Definition GUIState.h:393
Simple implementation of IMessageHandler which will delegate the message handling based on MessageID.
Definition MessageHandler.h:41
Simple wrapper class with better api.
Definition Messaging.h:46
void setMessageID(MessageID messageID)
Definition Messaging.h:55
Used to communicate the state between the UI and the RT and read/write to stream.
Definition NormalizedState.h:39
Interface to implement to receive parameter changes.
Definition Parameters.h:45
This is the class which maintains all the registered parameters.
Definition Parameters.h:39
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition Parameters.h:56
Definition ParamDisplay.cpp:29
std::shared_ptr< VstParameters > VstParametersSPtr
Definition VstParameters.h:96
Definition DrawContext.cpp:25
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
std::shared_ptr< JmbParamDef< T > > JmbParam
Definition ParamDef.h:522
std::shared_ptr< VstParamDef< T > > VstParam
Definition ParamDef.h:509
Maintains the order used to save/restore the RT and GUI state.
Definition NormalizedState.h:45