Jamba C++ API  4.0.0
GUIVstParameter< T > Class Template Reference

This class wraps a GUIRawVstParameter to deal with any type T. More...

#include <GUIRawVstParameter.h>

Inherits ITGUIParameter< T >.

Classes

class  Editor
 Wrapper to edit a single parameter. More...
 

Public Types

using EditorType = typename ITGUIParameter< T >::ITEditor
 
using ParamType = T
 
- Public Types inherited from ITGUIParameter< T >
using ParamType = T
 The type of the param (alias) More...
 
using ValueAccessor = std::function< void(T const &)>
 API to access the value of the param. More...
 

Public Member Functions

tresult accessValue (typename ITGUIParameter< T >::ValueAccessor const &iGetter) const override
 
std::shared_ptr< GUIDiscreteParameterasDiscreteParameter (int32 iStepCount) override
 Converts this parameter into a discrete parameter. More...
 
std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const override
 
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const override
 
std::unique_ptr< EditorTypeedit () override
 
ParamValue getNormalizedValue () const
 
ParamID getParamID () const override
 Each parameter has a unique ID returned by this method. More...
 
int32 getStepCount () const override
 
ParamType getValue () const
 
 GUIVstParameter (std::shared_ptr< GUIRawVstParameter > iRawParameter, std::shared_ptr< IParamConverter< T >> iConverter)
 
tresult setNormalizedValue (ParamValue const &iNormalizedValue)
 Sets the value of this parameter as a normalized value. More...
 
tresult setValue (ParamType const &iValue) override
 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...
 
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 (ParamType const &iValue) override
 Update the parameter with a value. More...
 
 ~GUIVstParameter ()
 
- Public Member Functions inherited from ITGUIParameter< T >
virtual tresult accessValue (ValueAccessor const &iGetter) const =0
 API to access the underlying value. More...
 
virtual std::unique_ptr< ITEditoredit (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...
 

Private Attributes

std::shared_ptr< IParamConverter< T > > fConverter
 
std::shared_ptr< GUIRawVstParameterfRawParameter
 

Detailed Description

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

This class wraps a GUIRawVstParameter to deal with any type T.

Member Typedef Documentation

◆ EditorType

using EditorType = typename ITGUIParameter<T>::ITEditor

◆ ParamType

using ParamType = T

Constructor & Destructor Documentation

◆ GUIVstParameter()

GUIVstParameter ( std::shared_ptr< GUIRawVstParameter iRawParameter,
std::shared_ptr< IParamConverter< T >>  iConverter 
)
inline

◆ ~GUIVstParameter()

~GUIVstParameter ( )
inline

Member Function Documentation

◆ accessValue()

tresult accessValue ( typename ITGUIParameter< T >::ValueAccessor const &  iGetter) const
inlineoverride

◆ asDiscreteParameter()

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

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.

Implements IGUIParameter.

◆ connect() [1/2]

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

Implements IGUIParameter.

◆ connect() [2/2]

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

Implements IGUIParameter.

◆ edit()

std::unique_ptr<EditorType> edit ( )
inlineoverridevirtual
Returns
an editor to modify the parameter (see Editor)

Implements ITGUIParameter< T >.

◆ getNormalizedValue()

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

◆ getParamID()

ParamID getParamID ( ) const
inlineoverridevirtual

Each parameter has a unique ID returned by this method.

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

Implements IGUIParameter.

◆ getStepCount()

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

Implements IGUIParameter.

◆ getValue()

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

◆ 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 ( ParamType const &  iValue)
inlineoverridevirtual

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

Implements ITGUIParameter< T >.

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

◆ toUTF8String()

std::string toUTF8String ( int32  iPrecision) const
inlineoverridevirtual

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

Implements IGUIParameter.

◆ update()

bool update ( ParamType const &  iValue)
inlineoverridevirtual

Update the parameter with a value.

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

Implements ITGUIParameter< T >.

Member Data Documentation

◆ fConverter

std::shared_ptr<IParamConverter<T> > fConverter
private

◆ fRawParameter

std::shared_ptr<GUIRawVstParameter> fRawParameter
private

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