Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
GUIVstParameter< T > Class Template Reference

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

#include <GUIVstParameter.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).
using ValueAccessor = std::function<void(T const &)>
 API to access the value of the param.

Public Member Functions

tresult accessValue (typename ITGUIParameter< T >::ValueAccessor const &iGetter) const override
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter (int32 iStepCount) override
 Converts this parameter into a discrete parameter.
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const override
std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const override
std::unique_ptr< EditorTypeedit () override
ParamValue getNormalizedValue () const
ParamID getParamID () const override
 Each parameter has a unique ID returned by this method.
int32 getStepCount () const override
ParamType getValue () const
 GUIVstParameter (std::shared_ptr< GUIRawVstParameter > iRawParameter, std::shared_ptr< IParamConverter< T > > iConverter)
tresult resetToDefault () override
 Resets the parameter to its default value.
tresult setNormalizedValue (ParamValue const &iNormalizedValue)
 Sets the value of this parameter as a normalized value.
tresult setValue (ParamType const &iValue) override
 Sets the value of this parameter.
Steinberg::String toString ()
 Returns a string representation of this parameter.
void toString (String128 oString)
 Populates the oString with a string representation of this parameter.
std::string toUTF8String (int32 iPrecision) const override
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
bool update (ParamType const &iValue) override
 Update the parameter with a value.
 ~GUIVstParameter ()
Public Member Functions inherited from ITGUIParameter< T >
virtual tresult accessValue (ValueAccessor const &iGetter) const =0
 API to access the underlying value.
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.
Public Member Functions inherited from IGUIParameter
template<typename T>
std::shared_ptr< ITGUIParameter< T > > cast ()
 Downcasts this parameter into a typed version.

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

template<typename T>
using EditorType = typename ITGUIParameter<T>::ITEditor

◆ ParamType

template<typename T>
using ParamType = T

Constructor & Destructor Documentation

◆ GUIVstParameter()

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

◆ ~GUIVstParameter()

template<typename T>
~GUIVstParameter ( )
inline

Member Function Documentation

◆ accessValue()

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

◆ asDiscreteParameter()

template<typename T>
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]

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

Implements IGUIParameter.

◆ connect() [2/2]

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

Implements IGUIParameter.

◆ edit()

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

Implements ITGUIParameter< T >.

◆ getNormalizedValue()

template<typename T>
ParamValue getNormalizedValue ( ) const
inline
Returns
the current value of the parameter as a normalized value

◆ getParamID()

template<typename T>
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()

template<typename T>
int32 getStepCount ( ) const
inlineoverridevirtual
Returns
number of steps (for discrete param) or 0 for continuous

Implements IGUIParameter.

◆ getValue()

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

◆ resetToDefault()

template<typename T>
tresult resetToDefault ( )
inlineoverridevirtual

Resets the parameter to its default value.

Implements IGUIParameter.

◆ setNormalizedValue()

template<typename T>
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()

template<typename T>
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]

template<typename T>
Steinberg::String toString ( )
inline

Returns a string representation of this parameter.

◆ toString() [2/2]

template<typename T>
void toString ( String128 oString)
inline

Populates the oString with a string representation of this parameter.

◆ toUTF8String()

template<typename T>
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()

template<typename T>
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

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

◆ fRawParameter

template<typename T>
std::shared_ptr<GUIRawVstParameter> fRawParameter
private

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