72 tresult
setValue(ParamValue
const &iValue)
override;
78 bool updateValue(ParamValue
const &iValue)
override;
87 using EditorType::commit;
107 std::shared_ptr<RawVstParamDef> iParamDef);
143 return parameterInfo->stepCount;
177 bool update(ParamValue
const &iValue)
override 179 auto const previousValue =
getValue();
180 if(previousValue != iValue)
192 inline tresult
setValue(ParamValue
const &iValue)
override 202 std::unique_ptr<EditorType>
edit()
override 262 fPtr{std::move(iPtr)}
308 std::unique_ptr<GUIRawVstParameter::EditorType>
edit() { DCHECK_F(
exists());
return fPtr->edit(); }
315 std::unique_ptr<GUIRawVstParameter::EditorType>
edit(ParamValue
const &iValue) { DCHECK_F(
exists());
return fPtr->edit(iValue); }
318 inline operator ParamValue()
const { DCHECK_F(
exists());
return fPtr->getValue(); }
340 std::shared_ptr<GUIRawVstParameter>
fPtr;
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount) override
This implementation will adapt this parameter to be interpreted as a discrete parameter.
Definition: GUIRawVstParameter.cpp:144
~Editor() override
Definition: GUIRawVstParameter.h:63
~GUIRawVstParameter()=default
GUIRawVstParam & operator=(ParamValue const &iValue)
Allow to write param = 0.5.
Definition: GUIRawVstParameter.h:321
GUIRawVstParam(std::shared_ptr< GUIRawVstParameter > iPtr=nullptr)
Definition: GUIRawVstParameter.h:261
ParamID fParamID
Definition: GUIRawVstParameter.h:96
bool exists() const
Definition: GUIRawVstParameter.h:269
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIRawVstParameter.h:257
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition: Parameters.h:55
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition: IGUIParameter.h:33
std::unique_ptr< GUIRawVstParameter::EditorType > edit(ParamValue const &iValue)
Shortcut to create an editor and set the value to it.
Definition: GUIRawVstParameter.h:315
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const
Definition: GUIRawVstParameter.h:337
bool updateValue(ParamValue const &iValue) override
Change the value of the parameter.
Definition: GUIRawVstParameter.cpp:54
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition: GUIRawVstParameter.h:116
std::shared_ptr< RawVstParamDef > fParamDef
Definition: GUIRawVstParameter.h:247
GUIRawVstParameter(ParamID iParamID, VstParametersSPtr iVstParameters, std::shared_ptr< RawVstParamDef > iParamDef)
Definition: GUIRawVstParameter.cpp:97
ParamValue fInitialParamValue
Definition: GUIRawVstParameter.h:99
std::function< void(ParamValue const &)> ValueAccessor
API to access the value of the param.
Definition: IGUIParameter.h:178
ParamID fParamID
Definition: GUIRawVstParameter.h:245
tresult setValue(ParamValue const &iValue)
Sets the value of this parameter.
Definition: GUIRawVstParameter.h:283
Editor(ParamID iParamID, VstParametersSPtr iVstParameters)
Definition: GUIRawVstParameter.cpp:26
bool fIsEditing
Definition: GUIRawVstParameter.h:100
ParamValue getValue() const
Definition: GUIRawVstParameter.h:131
String toString()
Returns a string representation of this parameter.
Definition: GUIRawVstParameter.h:303
Definition: GUIState.h:36
tresult rollback() override
Call this if you want to revert to the original value of the parameter (when the editor is created).
Definition: GUIRawVstParameter.cpp:82
tresult setValue(ParamValue const &iValue) override
Sets the value of this parameter.
Definition: GUIRawVstParameter.h:192
bool update(ParamValue const &iValue) override
Update the parameter with a value.
Definition: GUIRawVstParameter.h:177
VstParametersSPtr fVstParameters
Definition: GUIRawVstParameter.h:97
VstParametersSPtr fVstParameters
Definition: GUIRawVstParameter.h:246
GUIRawVstParam & operator=(GUIRawVstParam const &iOther)=default
Assignment operator: fMyParam = registerParam(...);
ITGUIParameter< ParamValue >::ITEditor EditorType
Definition: GUIRawVstParameter.h:42
ParamValue getValue() const
Definition: GUIRawVstParameter.h:277
std::unique_ptr< GUIRawVstParameter::EditorType > edit()
Definition: GUIRawVstParameter.h:308
bool operator!=(const GUIRawVstParam &rhs) const
Allow to write param1 != param2.
Definition: GUIRawVstParameter.h:327
void toString(String128 oString)
Populates the oString with a string representation of this parameter.
Definition: GUIRawVstParameter.h:151
Editor & operator=(Editor const &)=delete
This class wraps a GUIRawVstParameter to deal with any type T.
Definition: GUIRawVstParameter.h:30
ParamID getParamID() const
Definition: GUIRawVstParameter.h:272
int32 getStepCount() const override
Definition: GUIRawVstParameter.h:139
String toString()
Returns a string representation of this parameter.
Definition: GUIRawVstParameter.h:159
std::unique_ptr< GUIRawVstParameter::EditorType > GUIRawVstParamEditor
Definition: GUIRawVstParameter.h:346
bool operator==(const GUIRawVstParam &rhs) const
Allow to write param1 == param2.
Definition: GUIRawVstParameter.h:324
tresult commit() override
Definition: GUIRawVstParameter.cpp:68
std::shared_ptr< VstParameters > VstParametersSPtr
Definition: VstParameters.h:95
ParamValue ParamType
Definition: GUIRawVstParameter.h:41
std::shared_ptr< GUIRawVstParameter > fPtr
Definition: GUIRawVstParameter.h:340
tresult accessValue(ValueAccessor const &iGetter) const override
API to access the underlying value.
Definition: GUIRawVstParameter.h:122
void toString(String128 oString)
Populates the oString with a string representation of this parameter.
Definition: GUIRawVstParameter.h:298
tresult setValue(ParamValue const &iValue) override
Change the value of the parameter.
Definition: GUIRawVstParameter.cpp:39
std::shared_ptr< GUIVstParameter< T > > asVstParameter()
Converts to a typed parameter.
Definition: GUIVstParameter.h:372
tresult copyValueFrom(GUIRawVstParam const &iParam)
Shortcut to copy the value from another param to this one.
Definition: GUIRawVstParameter.h:288
Wrapper to edit a single parameter.
Definition: GUIRawVstParameter.h:58
Encapsulates a vst parameter and how to access it (read/write) as well as how to "connect" to it in o...
Definition: GUIRawVstParameter.h:38
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const
Definition: GUIRawVstParameter.h:332
std::string toUTF8String(int32 iPrecision) const override
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition: GUIRawVstParameter.h:167
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Definition: GUIRawVstParameter.h:215
std::unique_ptr< EditorType > edit() override
Definition: GUIRawVstParameter.h:202
Interface to implement to receive parameter changes.
Definition: Parameters.h:43
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition: GUIRawVstParameter.h:223
int32 getStepCount() const
Definition: GUIRawVstParameter.h:293