30 namespace Debug {
class ParamDisplay; }
33 using namespace Params;
61 inline bool existsVst(ParamID iParamID)
const {
return fVstParameters && fVstParameters->exists(iParamID); }
66 inline bool existsJmb(ParamID iParamID)
const {
return fJmbParams.find(iParamID) != fJmbParams.cend(); }
73 if(existsVst(iParamID))
74 return std::make_unique<GUIRawVstParameter>(iParamID, fVstParameters);
82 return fPluginParameters.getRawVstParamDef(iParamID);
87 std::unique_ptr<GUIVstParameter<T>> getGUIVstParameter(ParamID iParamID)
const;
92 return iParamDef ? getGUIVstParameter<T>(iParamDef->fParamID) :
nullptr;
103 return fVstParameters ? fVstParameters->connect(iParamID, iChangeListener) :
nullptr;
114 return fVstParameters ? fVstParameters->connect(iParamID, std::move(iChangeCallback)) :
nullptr;
134 template<
typename TView>
136 return fViewCxMgr.registerConnectionFor(iView,
this);
148 virtual tresult readRTState(IBStreamer &iStreamer);
154 virtual tresult readGUIState(IBStreamer &iStreamer);
160 virtual tresult writeGUIState(IBStreamer &oStreamer)
const;
166 std::unique_ptr<GUIParamCxMgr> createParamCxMgr();
177 tresult broadcast(
JmbParam<T> const &iParamDef, T
const &iMessage);
202 std::map<ParamID, std::unique_ptr<IGUIJmbParameter>> fJmbParams{};
205 std::vector<ParamID> fAllRegistrationOrder{};
212 void addJmbParam(std::unique_ptr<IGUIJmbParameter> iParameter);
215 IPtr<IMessage> allocateMessage()
override;
218 tresult sendMessage(IPtr<IMessage> iMessage)
override;
226 template<
typename TPluginParameters>
235 fParams{iPluginParameters}
249 std::unique_ptr<IGUIJmbParameter> guiParam{rawPtr};
250 addJmbParam(std::move(guiParam));
251 if(iParamDef->fShared && iParamDef->fSerializer)
253 switch(iParamDef->fOwner)
256 fMessageHandler.registerHandler(iParamDef->fParamID, rawPtr);
260 rawPtr->setMessageProducer(
this);
265 DLOG_F(ERROR,
"not reached");
278 if(!iParamDef->fShared)
280 DLOG_F(WARNING,
"broadcast ignored: parameter [%d] is not marked shared", iParamDef->fParamID);
284 tresult res = kResultOk;
286 auto message = allocateMessage();
296 if(iParamDef->writeToMessage(iMessage, m) == kResultOk)
297 res |= sendMessage(message);
313 auto param = getRawVstParameter(iParamID);
317 DLOG_F(WARNING,
"vst param [%d] not found", iParamID);
321 auto rawParamDef = getRawVstParamDef(iParamID);
323 auto paramDef = std::dynamic_pointer_cast<
VstParamDef<T>>(rawParamDef);
327 return std::make_unique<GUIVstParameter<T>>(std::move(param), paramDef);
331 DLOG_F(WARNING,
"vst param [%d] is not of the requested type", iParamID);
Definition: Parameters.h:39
Parameters const & getPluginParameters() const
Definition: GUIState.h:50
std::shared_ptr< VstParamDef< T > > VstParam
Definition: ParamDef.h:358
Definition: GUIState.h:39
Definition: GUIJmbParameter.h:40
Definition: MessageProducer.h:33
Definition: ParamDisplay.h:33
Definition: Messaging.h:43
tresult handleMessage(Message const &iMessage)
Definition: GUIState.h:171
void setMessageID(MessageID messageID)
Definition: Messaging.h:53
std::unique_ptr< FObjectCx > connect(ParamID iParamID, Parameters::IChangeListener *iChangeListener) const
Definition: GUIState.h:101
bool existsJmb(ParamID iParamID) const
Definition: GUIState.h:66
GUIJmbParam< T > add(JmbParam< T > iParamDef)
Definition: GUIState.h:246
std::unique_ptr< GUIRawVstParameter > getRawVstParameter(ParamID iParamID) const
Definition: GUIState.h:71
std::shared_ptr< JmbParamDef< T > > JmbParam
Definition: ParamDef.h:365
std::shared_ptr< RawVstParamDef > getRawVstParamDef(ParamID iParamID) const
Definition: GUIState.h:80
Definition: NormalizedState.h:38
std::vector< ParamID > const & getAllRegistrationOrder() const
Definition: GUIState.h:180
Definition: GUIParamCxAware.h:277
std::unique_ptr< GUIVstParameter< T > > getGUIVstParameter(ParamID iParamID) const
Definition: GUIState.h:311
TPluginParameters PluginParameters
Definition: GUIState.h:230
Definition: GUIJmbParameter.h:230
ViewGUIParamCxAware< TView > * registerConnectionFor(TView *iView)
Definition: GUIState.h:135
Definition: GUIJmbParameter.h:86
std::function< void()> ChangeCallback
Definition: Parameters.h:57
bool existsVst(ParamID iParamID) const
Definition: GUIState.h:61
Definition: MessageHandler.h:39
Definition: GUIState.h:227
tresult broadcast(JmbParam< T > const &iParamDef, T const &iMessage)
Definition: GUIState.h:276
Parameters const & fPluginParameters
Definition: GUIState.h:187
Definition: GUIParamCxMgr.h:29
std::unique_ptr< GUIVstParameter< T > > getGUIVstParameter(VstParam< T > iParamDef) const
Definition: GUIState.h:91
Definition: ViewCxMgr.h:87
Definition: ParamDef.h:129
std::shared_ptr< VstParameters > VstParametersSPtr
Definition: VstParameters.h:87
std::unique_ptr< FObjectCx > connect(ParamID iParamID, Parameters::ChangeCallback iChangeCallback) const
Definition: GUIState.h:112
GUIPluginState(PluginParameters const &iPluginParameters)
Definition: GUIState.h:233
PluginParameters const & fParams
Definition: GUIState.h:239
Definition: Parameters.h:45