73 tresult
setValue(ParamValue
const &iValue)
override;
79 bool updateValue(ParamValue
const &iValue)
override;
88 using EditorType::commit;
108 std::shared_ptr<RawVstParamDef> iParamDef);
144 return parameterInfo->stepCount;
178 bool update(ParamValue
const &iValue)
override 180 auto const previousValue =
getValue();
181 if(previousValue != iValue)
193 inline tresult
setValue(ParamValue
const &iValue)
override 203 std::unique_ptr<EditorType>
edit()
override 263 fPtr{std::move(iPtr)}
319 std::unique_ptr<GUIRawVstParameter::EditorType>
edit() { DCHECK_F(
exists());
return fPtr->edit(); }
326 std::unique_ptr<GUIRawVstParameter::EditorType>
edit(ParamValue
const &iValue) { DCHECK_F(
exists());
return fPtr->edit(iValue); }
332 [[deprecated(
"Since 4.1.0 - use operator* or .value() instead (ex: if(*param) {...} or if(param.value()) {...}")]]
333 inline operator ParamValue()
const { DCHECK_F(
exists());
return fPtr->getValue(); }
349 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:64
ParamValue value() const
Synonym to getValue()
Definition: GUIRawVstParameter.h:281
~GUIRawVstParameter()=default
GUIRawVstParam & operator=(ParamValue const &iValue)
Allow to write param = 0.5.
Definition: GUIRawVstParameter.h:336
GUIRawVstParam(std::shared_ptr< GUIRawVstParameter > iPtr=nullptr)
Definition: GUIRawVstParameter.h:262
ParamID fParamID
Definition: GUIRawVstParameter.h:97
bool exists() const
Definition: GUIRawVstParameter.h:270
This is the main class that the plugin should use as it exposes only the necessary methods of the par...
Definition: GUIRawVstParameter.h:258
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:326
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const
Definition: GUIRawVstParameter.h:346
bool updateValue(ParamValue const &iValue) override
Change the value of the parameter.
Definition: GUIRawVstParameter.cpp:54
ParamValue operator *() const
allow writing *param to access the underlying value (or in other words, *param is the same param....
Definition: GUIRawVstParameter.h:329
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition: GUIRawVstParameter.h:117
std::shared_ptr< RawVstParamDef > fParamDef
Definition: GUIRawVstParameter.h:248
GUIRawVstParameter(ParamID iParamID, VstParametersSPtr iVstParameters, std::shared_ptr< RawVstParamDef > iParamDef)
Definition: GUIRawVstParameter.cpp:97
Implements all the various equality and relational operators for the type T which is assumed to encap...
Definition: Operators.h:54
ParamValue fInitialParamValue
Definition: GUIRawVstParameter.h:100
std::function< void(ParamValue const &)> ValueAccessor
API to access the value of the param.
Definition: IGUIParameter.h:178
ParamID fParamID
Definition: GUIRawVstParameter.h:246
tresult setValue(ParamValue const &iValue)
Sets the value of this parameter.
Definition: GUIRawVstParameter.h:294
Editor(ParamID iParamID, VstParametersSPtr iVstParameters)
Definition: GUIRawVstParameter.cpp:26
bool fIsEditing
Definition: GUIRawVstParameter.h:101
ParamValue getValue() const
Definition: GUIRawVstParameter.h:132
String toString()
Returns a string representation of this parameter.
Definition: GUIRawVstParameter.h:314
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:193
bool update(ParamValue const &iValue) override
Update the parameter with a value.
Definition: GUIRawVstParameter.h:178
VstParametersSPtr fVstParameters
Definition: GUIRawVstParameter.h:98
bool update(ParamValue const &iValue)
Update the parameter with a value.
Definition: GUIRawVstParameter.h:288
VstParametersSPtr fVstParameters
Definition: GUIRawVstParameter.h:247
GUIRawVstParam & operator=(GUIRawVstParam const &iOther)=default
Assignment operator: fMyParam = registerParam(...);
ITGUIParameter< ParamValue >::ITEditor EditorType
Definition: GUIRawVstParameter.h:43
ParamValue getValue() const
Definition: GUIRawVstParameter.h:278
std::unique_ptr< GUIRawVstParameter::EditorType > edit()
Definition: GUIRawVstParameter.h:319
void toString(String128 oString)
Populates the oString with a string representation of this parameter.
Definition: GUIRawVstParameter.h:152
Editor & operator=(Editor const &)=delete
This class wraps a GUIRawVstParameter to deal with any type T.
Definition: GUIRawVstParameter.h:31
ParamID getParamID() const
Definition: GUIRawVstParameter.h:273
int32 getStepCount() const override
Definition: GUIRawVstParameter.h:140
String toString()
Returns a string representation of this parameter.
Definition: GUIRawVstParameter.h:160
std::unique_ptr< GUIRawVstParameter::EditorType > GUIRawVstParamEditor
Definition: GUIRawVstParameter.h:355
tresult commit() override
Definition: GUIRawVstParameter.cpp:68
std::shared_ptr< VstParameters > VstParametersSPtr
Definition: VstParameters.h:95
ParamValue ParamType
Definition: GUIRawVstParameter.h:42
std::shared_ptr< GUIRawVstParameter > fPtr
Definition: GUIRawVstParameter.h:349
tresult accessValue(ValueAccessor const &iGetter) const override
API to access the underlying value.
Definition: GUIRawVstParameter.h:123
void toString(String128 oString)
Populates the oString with a string representation of this parameter.
Definition: GUIRawVstParameter.h:309
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:409
tresult copyValueFrom(GUIRawVstParam const &iParam)
Shortcut to copy the value from another param to this one.
Definition: GUIRawVstParameter.h:299
Wrapper to edit a single parameter.
Definition: GUIRawVstParameter.h:59
Encapsulates a vst parameter and how to access it (read/write) as well as how to "connect" to it in o...
Definition: GUIRawVstParameter.h:39
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const
Definition: GUIRawVstParameter.h:341
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:168
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Definition: GUIRawVstParameter.h:216
std::unique_ptr< EditorType > edit() override
Definition: GUIRawVstParameter.h:203
Interface to implement to receive parameter changes.
Definition: Parameters.h:43
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition: GUIRawVstParameter.h:224
int32 getStepCount() const
Definition: GUIRawVstParameter.h:304