Jamba C++ API  5.1.1
GUIRawVstParam Class Reference

This is the main class that the plugin should use as it exposes only the necessary methods of the param as well as redefine a couple of operators which helps in writing simpler and natural code (the param behaves like T in many ways). More...

#include <GUIRawVstParameter.h>

Inherits Dereferenceable< GUIRawVstParam >.

Public Types

using Editor = std::unique_ptr< EditorType >
 
using EditorType = GUIRawVstParameter::EditorType
 
using ParamType = ParamValue
 

Public Member Functions

std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const
 
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const
 
tresult copyValueFrom (GUIRawVstParam const &iParam)
 Shortcut to copy the value from another param to this one. More...
 
Editor edit ()
 
Editor edit (ParamValue const &iValue)
 Shortcut to create an editor and set the value to it. More...
 
bool exists () const
 
ParamID getParamID () const
 
int32 getStepCount () const
 
ParamValue getValue () const
 
 GUIRawVstParam (std::shared_ptr< GUIRawVstParameter > iPtr=nullptr)
 
ParamValue operator * () const
 allow writing *param to access the underlying value (or in other words, *param is the same param.value()) More...
 
 operator ParamValue () const
 Allow to use the param as the underlying ParamType (ex: "if(param)" in the case ParamType is bool)) More...
 
GUIRawVstParamoperator= (GUIRawVstParam const &iOther)=default
 Assignment operator: fMyParam = registerParam(...); More...
 
GUIRawVstParamoperator= (ParamValue const &iValue)
 Allow to write param = 0.5. More...
 
tresult resetToDefault ()
 Resets the param to its default value. More...
 
tresult setValue (ParamValue const &iValue)
 Sets the value of this parameter. More...
 
void toString (String128 oString)
 Populates the oString with a string representation of this parameter. More...
 
Steinberg::String toString ()
 Returns a string representation of this parameter. More...
 
std::string toUTF8String (int32 iPrecision) const
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More...
 
bool update (ParamValue const &iValue)
 Update the parameter with a value. More...
 
ParamValue value () const
 Synonym to getValue() More...
 

Private Attributes

std::shared_ptr< GUIRawVstParameterfPtr
 

Detailed Description

This is the main class that the plugin should use as it exposes only the necessary methods of the param as well as redefine a couple of operators which helps in writing simpler and natural code (the param behaves like T in many ways).

Member Typedef Documentation

◆ Editor

using Editor = std::unique_ptr<EditorType>

◆ EditorType

◆ ParamType

using ParamType = ParamValue

Constructor & Destructor Documentation

◆ GUIRawVstParam()

GUIRawVstParam ( std::shared_ptr< GUIRawVstParameter iPtr = nullptr)
inline

Member Function Documentation

◆ connect() [1/2]

std::unique_ptr<FObjectCx> connect ( Parameters::IChangeListener iChangeListener) const
inline
Returns
an object maintaining the connection between the parameter and the listener

◆ connect() [2/2]

std::unique_ptr<FObjectCx> connect ( Parameters::ChangeCallback  iChangeCallback) const
inline
Returns
an object maintaining the connection between the parameter and the callback

◆ copyValueFrom()

tresult copyValueFrom ( GUIRawVstParam const &  iParam)
inline

Shortcut to copy the value from another param to this one.

◆ edit() [1/2]

Editor edit ( )
inline
Returns
an editor to modify the parameter (see Editor)

◆ edit() [2/2]

Editor edit ( ParamValue const &  iValue)
inline

Shortcut to create an editor and set the value to it.

Returns
an editor to modify the parameter (see Editor)

◆ exists()

bool exists ( ) const
inline

◆ getParamID()

ParamID getParamID ( ) const
inline

◆ getStepCount()

int32 getStepCount ( ) const
inline
Returns
number of steps (for discrete param) or 0 for continuous

◆ getValue()

ParamValue getValue ( ) const
inline
Returns
the current value of the parameter as a T (using the Denormalizer)

◆ operator *()

ParamValue operator * ( ) const
inline

allow writing *param to access the underlying value (or in other words, *param is the same param.value())

◆ operator ParamValue()

operator ParamValue ( ) const
inline

Allow to use the param as the underlying ParamType (ex: "if(param)" in the case ParamType is bool))

◆ operator=() [1/2]

GUIRawVstParam& operator= ( GUIRawVstParam const &  iOther)
default

Assignment operator: fMyParam = registerParam(...);

◆ operator=() [2/2]

GUIRawVstParam& operator= ( ParamValue const &  iValue)
inline

Allow to write param = 0.5.

◆ resetToDefault()

tresult resetToDefault ( )
inline

Resets the param to its default value.

◆ setValue()

tresult setValue ( ParamValue const &  iValue)
inline

Sets the value of this parameter.

Note that this is "transactional" and if you want to make further changes that spans multiple calls (ex: onMouseDown / onMouseMoved / onMouseUp) you should use an editor

◆ toString() [1/2]

void toString ( String128  oString)
inline

Populates the oString with a string representation of this parameter.

◆ toString() [2/2]

Steinberg::String toString ( )
inline

Returns a string representation of this 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

◆ update()

bool update ( ParamValue const &  iValue)
inline

Update the parameter with a value.

Returns
true if the value was actually updated, false if it is the same

◆ value()

ParamValue value ( ) const
inline

Synonym to getValue()

Member Data Documentation

◆ fPtr

std::shared_ptr<GUIRawVstParameter> fPtr
private

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