Jamba C++ API  4.0.0
IGUIParam Class Reference

Wrapper instance returned by ParamAware::registerBaseParam() methods. More...

#include <IGUIParameter.h>

Public Member Functions

std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const
 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< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const
 Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()>). More...
 
bool exists () const
 Returns true if this wrapper actually refers to an actual parameter. More...
 
ParamID getParamID () const
 Each parameter has a unique ID returned by this method. More...
 
int32 getStepCount () const
 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...
 
 IGUIParam (std::shared_ptr< IGUIParameter > iPtr=nullptr)
 Constructor. More...
 
std::string toUTF8String (int32 iPrecision) const
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More...
 

Private Attributes

std::shared_ptr< IGUIParameterfPtr
 

Detailed Description

Wrapper instance returned by ParamAware::registerBaseParam() methods.

You can test for the actual existence of the parameter with the IGUIParam::exists() method.

Note
Although this wrapper does little more than the shared pointer, it is implemented for symmetry with other parameters (GUIVstParam and GUIJmbParam) and hides some implementation details. As a result, it is strongly recommended to use this wrapper instead of IGUIParameter directly.

Constructor & Destructor Documentation

◆ IGUIParam()

IGUIParam ( std::shared_ptr< IGUIParameter iPtr = nullptr)
inline

Constructor.

Member Function Documentation

◆ connect() [1/2]

std::unique_ptr<FObjectCx> connect ( Parameters::IChangeListener iChangeListener) const
inline

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

◆ connect() [2/2]

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

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

◆ exists()

bool exists ( ) const
inline

Returns true if this wrapper actually refers to an actual parameter.

◆ getParamID()

ParamID getParamID ( ) const
inline

Each parameter has a unique ID returned by this method.

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

◆ getStepCount()

int32 getStepCount ( ) const
inline

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.

◆ toUTF8String()

std::string toUTF8String ( int32  iPrecision) const
inline

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

Member Data Documentation

◆ fPtr

std::shared_ptr<IGUIParameter> fPtr
private

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