Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
GUIJmbParam< 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 <GUIJmbParameter.h>

Inherits Dereferenceable< GUIJmbParam< T > >.

Public Types

using Editor = std::unique_ptr<EditorType>
using EditorType = typename GUIJmbParameter<T>::EditorType
using ParamType = T

Public Member Functions

tresult broadcast () const
void broadcast (T &&iValue)
void broadcast (T const &iValue)
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback)
std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener)
Editor edit ()
Editor edit (T const &iValue)
bool exists () const
ParamID getParamID () const
T const & getValue () const
 GUIJmbParam (std::shared_ptr< GUIJmbParameter< T > > iPtr=nullptr)
 operator T const & () const
constexpr T const & operator* () const
 allow writing *param to access the underlying value (or in other words, *param is the same param.value())
constexpr T const * operator-> () const
GUIJmbParam< T > & operator= (GUIJmbParam< T > const &iOther)=default
 Assignment operator: fMyParam = registerParam(...);.
GUIJmbParam< T > & operator= (T const &iValue)
 Allow to write param = 3.0.
tresult resetToDefault ()
 Resets the param to its default value.
void setValue (T &&iNewValue)
 The difference with update is that it does not check for equality (case when T is not comparable).
void setValue (T const &iNewValue)
 The difference with update is that it does not check for equality (case when T is not comparable).
std::string toUTF8String (int32 iPrecision) const
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
bool update (T const &iNewValue)
 This method is typically called by a view to change the value of the parameter.
template<class ValueModifier>
bool updateIf (ValueModifier const &iValueModifier)
 Use this flavor of update if you want to modify the value itself.
T const & value () const
 Synonym to getValue().

Private Attributes

std::shared_ptr< GUIJmbParameter< T > > fPtr

Detailed Description

template<typename T>
class pongasoft::VST::GUI::Params::GUIJmbParam< 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

Member Typedef Documentation

◆ Editor

template<typename T>
using Editor = std::unique_ptr<EditorType>

◆ EditorType

template<typename T>
using EditorType = typename GUIJmbParameter<T>::EditorType

◆ ParamType

template<typename T>
using ParamType = T

Constructor & Destructor Documentation

◆ GUIJmbParam()

template<typename T>
GUIJmbParam ( std::shared_ptr< GUIJmbParameter< T > > iPtr = nullptr)
inline

Member Function Documentation

◆ broadcast() [1/3]

template<typename T>
tresult broadcast ( ) const
inline

◆ broadcast() [2/3]

template<typename T>
void broadcast ( T && iValue)
inline

◆ broadcast() [3/3]

template<typename T>
void broadcast ( T const & iValue)
inline

◆ connect() [1/2]

template<typename T>
std::unique_ptr< FObjectCx > connect ( Parameters::ChangeCallback iChangeCallback)
inline

◆ connect() [2/2]

template<typename T>
std::unique_ptr< FObjectCx > connect ( Parameters::IChangeListener * iChangeListener)
inline

◆ edit() [1/2]

template<typename T>
Editor edit ( )
inline
Returns
the editor to change the parameter (commit/rollback)

◆ edit() [2/2]

template<typename T>
Editor edit ( T const & iValue)
inline
Parameters
iValuefirst value to set
Returns
the editor to change the parameter (commit/rollback)

◆ exists()

template<typename T>
bool exists ( ) const
inline

◆ getParamID()

template<typename T>
ParamID getParamID ( ) const
inline

◆ getValue()

template<typename T>
T const & getValue ( ) const
inline

◆ operator T const &()

template<typename T>
operator T const & ( ) const
inline

◆ operator*()

template<typename T>
T const & operator* ( ) const
inlineconstexpr

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

◆ operator->()

template<typename T>
T const * operator-> ( ) const
inlineconstexpr

◆ operator=() [1/2]

template<typename T>
GUIJmbParam< T > & operator= ( GUIJmbParam< T > const & iOther)
default

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

◆ operator=() [2/2]

template<typename T>
GUIJmbParam< T > & operator= ( T const & iValue)
inline

Allow to write param = 3.0.

◆ resetToDefault()

template<typename T>
tresult resetToDefault ( )
inline

Resets the param to its default value.

◆ setValue() [1/2]

template<typename T>
void setValue ( T && iNewValue)
inline

The difference with update is that it does not check for equality (case when T is not comparable).

◆ setValue() [2/2]

template<typename T>
void setValue ( T const & iNewValue)
inline

The difference with update is that it does not check for equality (case when T is not comparable).

◆ toUTF8String()

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

template<typename T>
bool update ( T const & iNewValue)
inline

This method is typically called by a view to change the value of the parameter.

Listeners will be notified of the changes.

◆ updateIf()

template<typename T>
template<class ValueModifier>
bool updateIf ( ValueModifier const & iValueModifier)
inline

Use this flavor of update if you want to modify the value itself.

ValueModifier will be called back with &fValue. The callback should return true when the value was updated, false otherwise

◆ value()

template<typename T>
T const & value ( ) const
inline

Synonym to getValue().

Member Data Documentation

◆ fPtr

template<typename T>
std::shared_ptr<GUIJmbParameter<T> > fPtr
private

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