|
Jamba C++ API 7.5.0
|
Represents a gui parameter with its underlying backing type T (aka ParamType). More...
#include <IGUIParameter.h>
Inherits IGUIParameter.
Inherited by GUIJmbParameter< T >, GUIValParameter< T >, and GUIVstParameter< T >.
Classes | |
| class | ITEditor |
| Defines the API for the editor which can be obtained by calling ITGUIParameter::edit(). More... | |
Public Types | |
| using | ParamType = T |
| The type of the param (alias). | |
| using | ValueAccessor = std::function<void(T const &)> |
| API to access the value of the param. | |
Public Member Functions | |
| virtual tresult | accessValue (ValueAccessor const &iGetter) const =0 |
| API to access the underlying value. | |
| virtual std::unique_ptr< ITEditor > | edit ()=0 |
| Creates an editor to modify the parameter in a transactional fashion. | |
| virtual std::unique_ptr< ITEditor > | edit (ParamType const &iValue) |
| Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the parameter value to iValue. | |
| virtual tresult | setValue (ParamType const &iValue)=0 |
| Unconditionally sets the value of the parameter to the value provided. | |
| 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 case then updates it to the new value. | |
| Public Member Functions inherited from IGUIParameter | |
| virtual std::shared_ptr< GUIDiscreteParameter > | asDiscreteParameter (int32 iStepCount)=0 |
| Converts this parameter into a discrete parameter. | |
| template<typename T> | |
| std::shared_ptr< ITGUIParameter< T > > | cast () |
| Downcasts this parameter into a typed version. | |
| virtual std::unique_ptr< FObjectCx > | connect (Parameters::ChangeCallback iChangeCallback) const =0 |
| Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()>). | |
| 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, the listener will be notified of the changes (Parameters::IChangeListener::onParameterChange(ParamID)). | |
| virtual ParamID | getParamID () const =0 |
| Each parameter has a unique ID returned by this method. | |
| virtual int32 | getStepCount () const =0 |
| When a parameter is a discrete parameter (which means its underlying backing type is an int32 with values in the discrete range [0, getStepCount()]), this method will return the number of steps (> 0). | |
| virtual tresult | resetToDefault ()=0 |
| Resets the parameter to its default value. | |
| virtual std::string | toUTF8String (int32 iPrecision) const =0 |
| Returns the current value of the parameter as a string (which is properly UTF-8 encoded). | |
Represents a gui parameter with its underlying backing type T (aka ParamType).
Since we know the ParamType, this subclass of IGUIParameter adds the basic manipulation methods to deal with the parameter.
| T | the underlying backing type (aka ParamType). |
| using ParamType = T |
The type of the param (alias).
| using ValueAccessor = std::function<void(T const &)> |
API to access the value of the param.
|
pure virtual |
API to access the underlying value.
getValue() has a different api depending on the type of param (Vst and Jmb). As a result this interface only provides a common way to access it in both cases via an accessor which allows to:
Implemented in GUIRawVstParameter.
|
pure virtual |
Creates an editor to modify the parameter in a transactional fashion.
Implemented in GUIJmbParameter< T >, GUIRawVstParameter, GUIValParameter< T >, GUIValParameter< int32 >, and GUIVstParameter< T >.
|
inlinevirtual |
Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the parameter value to iValue.
|
pure virtual |
Unconditionally sets the value of the parameter to the value provided.
| iValue | the value to set |
Implemented in GUIJmbParameter< T >, GUIRawVstParameter, GUIValParameter< T >, GUIValParameter< int32 >, and GUIVstParameter< T >.
|
pure virtual |
First check if the value provided (iValue) is different from the current value and if that is the case then updates it to the new value.
| iValue | the value to update |
Implemented in GUIJmbParameter< T >, GUIRawVstParameter, GUIValParameter< T >, GUIValParameter< int32 >, and GUIVstParameter< T >.