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 210 std::unique_ptr<EditorType>
edit()
override 270 using Editor = std::unique_ptr<EditorType>;
275 fPtr{std::move(iPtr)}
348 [[deprecated(
"Since 4.1.0 - use operator* or .value() instead (ex: if(*param) {...} or if(param.value()) {...}")]]
349 inline operator ParamValue()
const { DCHECK_F(
exists());
return fPtr->getValue(); }
369 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:293
~GUIRawVstParameter()=default
GUIRawVstParam & operator=(ParamValue const &iValue)
Allow to write param = 0.5.
Definition: GUIRawVstParameter.h:352
std::string toUTF8String(int32 iPrecision) const
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition: GUIRawVstParameter.h:356
GUIRawVstParam(std::shared_ptr< GUIRawVstParameter > iPtr=nullptr)
Definition: GUIRawVstParameter.h:274
ParamID fParamID
Definition: GUIRawVstParameter.h:97
bool exists() const
Definition: GUIRawVstParameter.h:282
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
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition: IGUIParameter.h:33
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const
Definition: GUIRawVstParameter.h:366
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:345
std::unique_ptr< EditorType > Editor
Definition: GUIRawVstParameter.h:270
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:255
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:182
ParamID fParamID
Definition: GUIRawVstParameter.h:253
tresult setValue(ParamValue const &iValue)
Sets the value of this parameter.
Definition: GUIRawVstParameter.h:306
Editor edit(ParamValue const &iValue)
Shortcut to create an editor and set the value to it.
Definition: GUIRawVstParameter.h:342
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:330
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:300
VstParametersSPtr fVstParameters
Definition: GUIRawVstParameter.h:254
GUIRawVstParam & operator=(GUIRawVstParam const &iOther)=default
Assignment operator: fMyParam = registerParam(...);
ITGUIParameter< ParamValue >::ITEditor EditorType
Definition: GUIRawVstParameter.h:43
tresult resetToDefault() override
Resets the parameter to its default value.
Definition: GUIRawVstParameter.h:202
ParamValue getValue() const
Definition: GUIRawVstParameter.h:290
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
GUIRawVstParameter::EditorType EditorType
Definition: GUIRawVstParameter.h:269
ParamID getParamID() const
Definition: GUIRawVstParameter.h:285
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:375
tresult commit() override
Definition: GUIRawVstParameter.cpp:68
std::shared_ptr< VstParameters > VstParametersSPtr
Definition: VstParameters.h:95
tresult resetToDefault()
Resets the param to its default value.
Definition: GUIRawVstParameter.h:310
ParamValue ParamType
Definition: GUIRawVstParameter.h:42
std::shared_ptr< GUIRawVstParameter > fPtr
Definition: GUIRawVstParameter.h:369
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:325
ParamValue ParamType
Definition: GUIRawVstParameter.h:268
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:428
tresult copyValueFrom(GUIRawVstParam const &iParam)
Shortcut to copy the value from another param to this one.
Definition: GUIRawVstParameter.h:315
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:361
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:223
std::unique_ptr< EditorType > edit() override
Definition: GUIRawVstParameter.h:210
Editor edit()
Definition: GUIRawVstParameter.h:335
Interface to implement to receive parameter changes.
Definition: Parameters.h:43
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition: GUIRawVstParameter.h:231
int32 getStepCount() const
Definition: GUIRawVstParameter.h:320