Jamba C++ API
5.1.1
|
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) More... | |
using | ValueAccessor = std::function< void(T const &)> |
API to access the value of the param. More... | |
Public Member Functions | |
virtual tresult | accessValue (ValueAccessor const &iGetter) const =0 |
API to access the underlying value. More... | |
virtual std::unique_ptr< ITEditor > | edit ()=0 |
Creates an editor to modify the parameter in a transactional fashion. More... | |
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 . More... | |
virtual tresult | setValue (ParamType const &iValue)=0 |
Unconditionally sets the value of the parameter to the value provided. More... | |
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. More... | |
Public Member Functions inherited from IGUIParameter | |
virtual std::shared_ptr< GUIDiscreteParameter > | asDiscreteParameter (int32 iStepCount)=0 |
Converts this parameter into a discrete parameter. More... | |
template<typename T > | |
std::shared_ptr< ITGUIParameter< T > > | cast () |
Downcasts this parameter into a typed version. More... | |
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) ). More... | |
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()> ). More... | |
virtual ParamID | getParamID () const =0 |
Each parameter has a unique ID returned by this method. More... | |
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 ). More... | |
virtual tresult | resetToDefault ()=0 |
Resets the parameter to its default value. More... | |
virtual std::string | toUTF8String (int32 iPrecision) const =0 |
Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More... | |
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:
kResultOk
if the getter is called, and kResultFalse
if the getter is not called for some reason Implemented in GUIDiscreteJmbParameter< T >, and GUIRawVstParameter.
|
pure virtual |
Creates an editor to modify the parameter in a transactional fashion.
Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.
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 |
kResultOk
if successful Implemented in GUIDiscreteJmbParameter< T >, GUIRawVstParameter, GUIVstParameter< T >, GUIJmbParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.
|
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.
T
does not provide a way to compare the value, then this call will delegate to setValue(ParamType const &)
and return true
.iValue | the value to update |
true
if the value was updated Implemented in GUIDiscreteJmbParameter< T >, GUIRawVstParameter, GUIVstParameter< T >, GUIJmbParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.