21#include <pluginterfaces/vst/vsttypes.h>
22#include <pongasoft/logging/logging.h>
29using namespace Steinberg::Vst;
46template<std::semiregular T>
53 using Editor = std::unique_ptr<EditorType>;
97 fParameter->accessValue([&res](
auto const &iValue) { res = iValue; });
124 std::unique_ptr<EditorType>
edit()
Implements all the various equality and relational operators for the type T which is assumed to encap...
Definition Operators.h:56
constexpr T const * operator->() const
Definition GUIOptionalParam.h:62
Value(T const &iValue)
Definition GUIOptionalParam.h:65
T fValue
Definition GUIOptionalParam.h:66
friend class GUIOptionalParam
Definition GUIOptionalParam.h:63
Represents an optional parameter (Jmb, Vst or no param at all).
Definition GUIOptionalParam.h:48
GUIOptionalParam class_type
Definition GUIOptionalParam.h:50
ITGUIParameter< T >::ITEditor EditorType
Definition GUIOptionalParam.h:52
std::unique_ptr< EditorType > edit()
Creates an editor to modify the parameter in a transactional fashion.
Definition GUIOptionalParam.h:124
int32 getStepCount() const
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition GUIOptionalParam.h:138
std::unique_ptr< EditorType > edit(ParamType const &iValue)
Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the par...
Definition GUIOptionalParam.h:131
constexpr ParamType operator*() const
allow writing *param to access the underlying value (or in other words, *param is the same param....
Definition GUIOptionalParam.h:141
GUIOptionalParam(T const &iDefaultValue)
Definition GUIOptionalParam.h:75
std::string toUTF8String(int32 iPrecision) const
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition GUIOptionalParam.h:152
ParamID getParamID() const
Each parameter has a unique ID returned by this method.
Definition GUIOptionalParam.h:89
ParamType value() const
Synonym to getValue().
Definition GUIOptionalParam.h:102
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const
Creates a connection between this parameter and the callback: whenever the parameter changes,...
Definition GUIOptionalParam.h:163
GUIOptionalParam()
Definition GUIOptionalParam.h:71
bool exists() const
Always return true because by definition an optional parameter always exists.
Definition GUIOptionalParam.h:85
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const
Creates a connection between this parameter and the change listener: whenever the parameter changes,...
Definition GUIOptionalParam.h:156
bool update(ParamType const &iValue)
First check if the value provided (iValue) is different from the current value and if that is the cas...
Definition GUIOptionalParam.h:106
GUIOptionalParam(std::shared_ptr< ITGUIParameter< T > > iParameter)
Definition GUIOptionalParam.h:79
ParamType getValue() const
Definition GUIOptionalParam.h:94
tresult setValue(ParamType const &iValue)
Unconditionally sets the value of the parameter to the value provided.
Definition GUIOptionalParam.h:113
std::shared_ptr< ITGUIParameter< ParamType > > fParameter
Definition GUIOptionalParam.h:169
T ParamType
Definition GUIOptionalParam.h:51
constexpr Value operator->() const
allow writing param->x to access the underlying value when T is a struct or class
Definition GUIOptionalParam.h:144
tresult resetToDefault()
Resets the param to its default value.
Definition GUIOptionalParam.h:120
std::unique_ptr< EditorType > Editor
Definition GUIOptionalParam.h:53
GUIOptionalParam & operator=(T const &iValue)
Allow to write param = 3 instead of param.update(3) for example.
Definition GUIOptionalParam.h:148
This parameter is not tied to any parameter definition/registration and is primarily used by the opti...
Definition GUIValParameter.h:39
Defines the API for the editor, which can be obtained by calling ITGUIParameter::edit().
Definition IGUIParameter.h:241
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition IGUIParameter.h:175
Interface to implement to receive parameter changes.
Definition Parameters.h:47
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition Parameters.h:61
std::unique_ptr< typename GUIOptionalParam< T >::EditorType > GUIOptionalParamEditor
Definition GUIOptionalParam.h:174
GUIOptionalParam< ParamValue > GUIRawOptionalParam
Definition GUIOptionalParam.h:176
GUIOptionalParamEditor< ParamValue > GUIRawOptionalParamEditor
Definition GUIOptionalParam.h:177
Definition ExpiringDataCache.h:28
constexpr ParamID UNDEFINED_PARAM_ID
Constant used throughout the code to test whether the ParamID represents a valid id or an undefined o...
Definition Types.h:48