Jamba C++ API
5.1.1
|
This is the base class of all GUI parameters. More...
#include <IGUIParameter.h>
Inherits enable_shared_from_this< IGUIParameter >.
Inherited by ITGUIParameter< int32 >, ITGUIParameter< ParamValue >, and ITGUIParameter< T >.
Classes | |
class | Editor |
Defines the basic and common API of all parameter editors (allow to commit/rollback) More... | |
Public Member Functions | |
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... | |
This is the base class of all GUI parameters.
The API defined by this class is fairly limited since the underlying type T
is not known or exposed by this generic API.
this
.
|
pure virtual |
Converts this parameter into a discrete parameter.
The discrete parameter returned is a parameter with an underlying backing type int32
and values in the discrete range [0, getStepCount()]
or [0, iStepCount]
if getStepCount() <= 0
.
iStepCount | if this parameter already defines a step count (getStepCount() > 0 ), then this parameter is ignored, otherwise it is used to convert this parameter into a discrete parameter with iStepCount steps. |
nullptr
if this parameter cannot be converted to a discrete parameter. Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.
std::shared_ptr< ITGUIParameter< T > > cast | ( | ) |
Downcasts this parameter into a typed version.
T | the underlying backing type of the parameter |
nullptr
if the cast is not possible
|
pure virtual |
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)
).
iChangeListener | the listener that will be notified on parameter changes. nullptr is allowed and will be a noop. |
Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.
|
pure virtual |
Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()>
).
iChangeCallback | the callback that will be invoked on parameter changes. |
Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.
|
pure virtual |
Each parameter has a unique ID returned by this method.
GUIOptionalParam
) may return pongasoft::VST::UNDEFINED_PARAM_ID
Implemented in GUIDiscreteJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIJmbParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.
|
pure virtual |
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
).
asDiscreteParameter(int32)
may be able to convert/adapt it to one.> 0
if and only if this parameter is a discrete parameter. Implemented in GUIDiscreteJmbParameter< T >, GUIDiscreteValParameter, GUIVstParameter< T >, GUIRawVstParameter, GUIJmbParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.
|
pure virtual |
Resets the parameter to its default value.
Implemented in GUIDiscreteJmbParameter< T >, GUIRawVstParameter, GUIJmbParameter< T >, GUIVstParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.
|
pure virtual |
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
iPrecision | if iPrecision < 0 the parameter is free to use whichever precision is tied to the parameter otherwise it should use the one provided |
Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.