22#include <pluginterfaces/vst/vsttypes.h>
23#include <pluginterfaces/base/ftypes.h>
30using namespace Steinberg;
31using namespace Steinberg::Vst;
144 std::shared_ptr<ITGUIParameter<T>>
cast();
311 virtual std::unique_ptr<ITEditor>
edit() = 0;
318 auto editor =
edit();
319 editor->setValue(iValue);
406 IGUIParam(std::shared_ptr<IGUIParameter> iPtr =
nullptr) :
407 fPtr{std::move(iPtr)}
439 std::shared_ptr<IGUIParameter>
fPtr;
~DefaultEditorImpl() override
Definition IGUIParameter.h:345
tresult commit() override
Commits all the changes applied to the parameter.
Definition IGUIParameter.h:369
T fInitialValue
Definition IGUIParameter.h:387
tresult rollback() override
Rollback all the changes that were made to this parameter (since this editor was created).
Definition IGUIParameter.h:378
ITGUIParameter< T > * fGUIParameter
Definition IGUIParameter.h:386
DefaultEditorImpl(ITGUIParameter< T > *iGUIParameter, T const &iDefaultValue)
Definition IGUIParameter.h:338
bool fDoneEditing
Definition IGUIParameter.h:388
tresult setValue(T const &iValue) override
Unconditionally sets the value of the parameter to the value provided.
Definition IGUIParameter.h:356
bool updateValue(T const &iValue) override
First check if the value provided (iValue) is different from the current value and if that is the cas...
Definition IGUIParameter.h:348
int32 getStepCount() const
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition IGUIParameter.h:420
void resetToDefault()
Resets the parameter to its default value.
Definition IGUIParameter.h:428
std::string toUTF8String(int32 iPrecision) const
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition IGUIParameter.h:424
ParamID getParamID() const
Each parameter has a unique ID returned by this method.
Definition IGUIParameter.h:416
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const
Creates a connection between this parameter and the callback: whenever the parameter changes,...
Definition IGUIParameter.h:436
bool exists() const
Returns true if this wrapper actually refers to an actual parameter.
Definition IGUIParameter.h:412
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const
Creates a connection between this parameter and the change listener: whenever the parameter changes,...
Definition IGUIParameter.h:432
IGUIParam(std::shared_ptr< IGUIParameter > iPtr=nullptr)
Constructor.
Definition IGUIParameter.h:406
std::shared_ptr< IGUIParameter > fPtr
Definition IGUIParameter.h:439
Defines the basic and common API of all parameter editors (allow to commit/rollback).
Definition IGUIParameter.h:60
virtual tresult rollback()=0
Rollback all the changes that were made to this parameter (since this editor was created).
virtual tresult commit()=0
Commits all the changes applied to the parameter.
virtual ~Editor()=default
Technically the destructor must only call rollback(), but due to the fact that it is a virtual method...
A discrete parameter is defined by a parameter whose underlying backing type is an int32 and whose nu...
Definition IGUIParameter.h:54
virtual std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const =0
Creates a connection between this parameter and the change listener: whenever the parameter changes,...
virtual std::string toUTF8String(int32 iPrecision) const =0
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
virtual std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount)=0
Converts this parameter into a discrete parameter.
virtual tresult resetToDefault()=0
Resets the parameter to its default value.
virtual ParamID getParamID() const =0
Each parameter has a unique ID returned by this method.
virtual std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const =0
Creates a connection between this parameter and the callback: whenever the parameter changes,...
virtual int32 getStepCount() const =0
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
std::shared_ptr< ITGUIParameter< T > > cast()
Downcasts this parameter into a typed version.
Definition IGUIParameter.hpp:30
Defines the API for the editor which can be obtained by calling ITGUIParameter::edit().
Definition IGUIParameter.h:238
virtual bool updateValue(ParamType const &iValue)=0
First check if the value provided (iValue) is different from the current value and if that is the cas...
virtual tresult commit()=0
Importing other commit method from superclass.
virtual tresult commit(ParamType const &iValue)
Shortcut method which calls setValue(ParamType const &) followed by commit().
Definition IGUIParameter.h:264
virtual tresult setValue(ParamType const &iValue)=0
Unconditionally sets the value of the parameter to the value provided.
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition IGUIParameter.h:172
virtual std::unique_ptr< ITEditor > edit(ParamType const &iValue)
Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the par...
Definition IGUIParameter.h:316
virtual tresult accessValue(ValueAccessor const &iGetter) const =0
API to access the underlying value.
ParamValue ParamType
Definition IGUIParameter.h:176
virtual std::unique_ptr< ITEditor > edit()=0
Creates an editor to modify the parameter in a transactional fashion.
virtual bool update(ParamType const &iValue)=0
First check if the value provided (iValue) is different from the current value and if that is the cas...
virtual tresult setValue(ParamType const &iValue)=0
Unconditionally sets the value of the parameter to the value provided.
std::function< void(ParamValue const &)> ValueAccessor
Definition IGUIParameter.h:183
Interface to implement to receive parameter changes.
Definition Parameters.h:45
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition Parameters.h:56