Jamba C++ API  4.0.0
GUIVstParam< T > Class Template 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 <GUIVstParameter.h>

Public Member Functions

std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const
 
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const
 
tresult copyValueFrom (GUIVstParam< T > const &iParam)
 Shortcut to copy the value from another param to this one. More...
 
std::unique_ptr< typename GUIVstParameter< T >::EditorType > edit ()
 
std::unique_ptr< typename GUIVstParameter< T >::EditorType > edit (T const &iValue)
 Shortcut to create an editor and set the value to it. More...
 
bool exists () const
 
ParamValue getNormalizedValue () const
 
ParamID getParamID () const
 
int32 getStepCount () const
 
getValue () const
 
 GUIVstParam (std::shared_ptr< GUIVstParameter< T >> iPtr=nullptr)
 
 operator T () const
 Allow to use the param as the underlying ParamType (ex: if(param) in the case ParamType is bool)) More...
 
bool operator!= (const GUIVstParam &rhs) const
 Allow to write param1 != param2. More...
 
GUIVstParam< T > & operator= (GUIVstParam< T > const &iOther)=default
 Assignment operator: fMyParam = registerParam(...); More...
 
GUIVstParam< T > & operator= (T const &iValue)
 Allow to write param = 3.0. More...
 
bool operator== (const GUIVstParam< T > &rhs) const
 Allow to write param1 == param2. More...
 
tresult setNormalizedValue (ParamValue const &iNormalizedValue)
 Sets the value of this parameter as a normalized value. More...
 
tresult setValue (T const &iValue)
 Sets the value of this parameter. More...
 
void toString (String128 oString)
 Populates the oString with a string representation of this parameter. More...
 
String toString ()
 Returns a string representation of this parameter. More...
 

Private Attributes

std::shared_ptr< GUIVstParameter< T > > fPtr
 

Detailed Description

template<typename T>
class pongasoft::VST::GUI::Params::GUIVstParam< T >

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).

Template Parameters
Tthe underlying type of the param

Constructor & Destructor Documentation

◆ GUIVstParam()

GUIVstParam ( std::shared_ptr< GUIVstParameter< T >>  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 ( GUIVstParam< T > const &  iParam)
inline

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

Implementation note: uses normalized value as this is faster and avoid math precision loss in normalize/denormalize

◆ edit() [1/2]

std::unique_ptr<typename GUIVstParameter<T>::EditorType> edit ( )
inline
Returns
an editor to modify the parameter (see Editor)

◆ edit() [2/2]

std::unique_ptr<typename GUIVstParameter<T>::EditorType> edit ( T 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

◆ getNormalizedValue()

ParamValue getNormalizedValue ( ) const
inline
Returns
the current value of the parameter as a normalized value

◆ getParamID()

ParamID getParamID ( ) const
inline

◆ getStepCount()

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

◆ getValue()

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

◆ operator T()

operator T ( ) const
inline

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

◆ operator!=()

bool operator!= ( const GUIVstParam< T > &  rhs) const
inline

Allow to write param1 != param2.

◆ operator=() [1/2]

GUIVstParam<T>& operator= ( GUIVstParam< T > const &  iOther)
default

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

◆ operator=() [2/2]

GUIVstParam<T>& operator= ( T const &  iValue)
inline

Allow to write param = 3.0.

◆ operator==()

bool operator== ( const GUIVstParam< T > &  rhs) const
inline

Allow to write param1 == param2.

◆ setNormalizedValue()

tresult setNormalizedValue ( ParamValue const &  iNormalizedValue)
inline

Sets the value of this parameter as a normalized value.

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

◆ setValue()

tresult setValue ( T 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]

String toString ( )
inline

Returns a string representation of this parameter.

Member Data Documentation

◆ fPtr

std::shared_ptr<GUIVstParameter<T> > fPtr
private

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