Jamba C++ API
5.1.1
|
Wraps a GUIJmbParameter<T>
to interpret it as a discrete parameter using the converter.
More...
#include <GUIJmbParameter.h>
Inherits ITGUIParameter< int32 >.
Public Types | |
using | EditorType = typename GUIDiscreteParameter::ITEditor |
Public Types inherited from ITGUIParameter< int32 > | |
using | ParamType = int32 |
The type of the param (alias) More... | |
using | ValueAccessor = std::function< void(int32 const &)> |
API to access the value of the param. More... | |
Public Member Functions | |
tresult | accessValue (ValueAccessor const &iGetter) const override |
API to access the underlying value. More... | |
std::shared_ptr< GUIDiscreteParameter > | asDiscreteParameter (int32 iStepCount) override |
Converts this parameter into a discrete parameter. More... | |
std::unique_ptr< FObjectCx > | connect (Parameters::IChangeListener *iChangeListener) const override |
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... | |
std::unique_ptr< FObjectCx > | connect (Parameters::ChangeCallback iChangeCallback) const override |
Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()> ). More... | |
std::unique_ptr< EditorType > | edit () override |
Creates an editor to modify the parameter in a transactional fashion. More... | |
ParamID | getParamID () const override |
Each parameter has a unique ID returned by this method. More... | |
int32 | getStepCount () const override |
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... | |
tresult | getValue (int32 &oDiscreteValue) const |
Because converting the current Jmb value to an int32 may fail this api returns kResultOk if it works in which case, oDiscreteValue contains the value. More... | |
GUIDiscreteJmbParameter (std::shared_ptr< GUIJmbParameter< T >> iJmbParameter, std::shared_ptr< IDiscreteConverter< T >> iConverter) | |
tresult | resetToDefault () override |
Resets the parameter to its default value. More... | |
tresult | setValue (int32 const &iDiscreteValue) override |
Unconditionally sets the value of the parameter to the value provided. More... | |
std::string | toUTF8String (int32 iPrecision) const override |
Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More... | |
bool | update (int32 const &iDiscreteValue) override |
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 ITGUIParameter< int32 > | |
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... | |
Public Member Functions inherited from IGUIParameter | |
template<typename T > | |
std::shared_ptr< ITGUIParameter< T > > | cast () |
Downcasts this parameter into a typed version. More... | |
Protected Attributes | |
std::shared_ptr< IDiscreteConverter< T > > | fConverter |
std::shared_ptr< GUIJmbParameter< T > > | fJmbParameter |
Wraps a GUIJmbParameter<T>
to interpret it as a discrete parameter using the converter.
using EditorType = typename GUIDiscreteParameter::ITEditor |
|
inline |
|
inlineoverridevirtual |
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 Implements ITGUIParameter< int32 >.
|
inlineoverridevirtual |
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. Implements IGUIParameter.
|
inlineoverridevirtual |
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. |
Implements IGUIParameter.
|
inlineoverridevirtual |
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. |
Implements IGUIParameter.
|
inlineoverridevirtual |
Creates an editor to modify the parameter in a transactional fashion.
Implements ITGUIParameter< int32 >.
|
inlineoverridevirtual |
Each parameter has a unique ID returned by this method.
GUIOptionalParam
) may return pongasoft::VST::UNDEFINED_PARAM_ID
Implements IGUIParameter.
|
inlineoverridevirtual |
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. Implements IGUIParameter.
|
inline |
Because converting the current Jmb value to an int32
may fail this api returns kResultOk
if it works in which case, oDiscreteValue
contains the value.
Otherwise it returns kResultFalse
and oDiscreteValue
is left untouched.
|
inlineoverridevirtual |
Resets the parameter to its default value.
Implements IGUIParameter.
|
inlineoverridevirtual |
Unconditionally sets the value of the parameter to the value provided.
iValue | the value to set |
kResultOk
if successful Implements ITGUIParameter< int32 >.
|
inlineoverridevirtual |
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 |
Implements IGUIParameter.
|
inlineoverridevirtual |
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 Implements ITGUIParameter< int32 >.
|
protected |
|
protected |