Jamba C++ API  4.0.0
IGUIParameter Class Referenceabstract

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< GUIDiscreteParameterasDiscreteParameter (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< FObjectCxconnect (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< FObjectCxconnect (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 std::string toUTF8String (int32 iPrecision) const =0
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More...
 

Detailed Description

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.

Note
GUI parameters are usually "shared" and subclasses will return shared pointers, that may potentially be shared pointers on this.

Member Function Documentation

◆ asDiscreteParameter()

virtual std::shared_ptr<GUIDiscreteParameter> asDiscreteParameter ( int32  iStepCount)
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.

Parameters
iStepCountif 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.
Returns
the discrete parameter or 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 >.

◆ cast()

std::shared_ptr< ITGUIParameter< T > > cast ( )

Downcasts this parameter into a typed version.

Template Parameters
Tthe underlying backing type of the parameter
Returns
the downcasted parameter or nullptr if the cast is not possible

◆ connect() [1/2]

virtual std::unique_ptr<FObjectCx> connect ( Parameters::IChangeListener iChangeListener) const
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)).

Note
This method is usually invoked by the framework but it may be used in the rare cases when the caller requires to handle the duration of the connection in a more granular fashion
Parameters
iChangeListenerthe listener that will be notified on parameter changes. nullptr is allowed and will be a noop.
Returns
the connection between this parameter and the listener and is maintained for as long as this pointer exists

Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.

◆ connect() [2/2]

virtual std::unique_ptr<FObjectCx> connect ( Parameters::ChangeCallback  iChangeCallback) const
pure virtual

Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()>).

Note
This method is usually invoked by the framework but it may be used in the rare cases when the caller requires to handle the duration of the connection in a more granular fashion
Parameters
iChangeCallbackthe callback that will be invoked on parameter changes.
Returns
the connection between this parameter and the callback and is maintained for as long as this pointer exists

Implemented in GUIDiscreteJmbParameter< T >, GUIJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIValParameter< T >, and GUIValParameter< int32 >.

◆ getParamID()

virtual ParamID getParamID ( ) const
pure virtual

Each parameter has a unique ID returned by this method.

Note
Some parameters (in particular GUIOptionalParam) may return pongasoft::VST::UNDEFINED_PARAM_ID

Implemented in GUIDiscreteJmbParameter< T >, GUIVstParameter< T >, GUIRawVstParameter, GUIJmbParameter< T >, GUIValParameter< T >, and GUIValParameter< int32 >.

◆ getStepCount()

virtual int32 getStepCount ( ) const
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).

Note
Although a parameter may not be a discrete parameter itself, the method asDiscreteParameter(int32) may be able to convert/adapt it to one.
Returns
the number of steps which is > 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 >.

◆ toUTF8String()

virtual std::string toUTF8String ( int32  iPrecision) const
pure virtual

Returns the current value of the parameter as a string (which is properly UTF-8 encoded).

Parameters
iPrecisionif 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 >.


The documentation for this class was generated from the following files: