21#include <pluginterfaces/vst/vsttypes.h>
22#include <pongasoft/logging/logging.h>
28using namespace Steinberg::Vst;
40 static_assert(std::is_default_constructible_v<T>,
"T must have a default/empty constructor: T()");
41 static_assert(std::is_copy_constructible_v<T>,
"T must have a copy constructor: T(T const &)");
42 static_assert(std::is_copy_assignable_v<T>,
"T must be copy assignable: T& operator=(T const &)");
48 using FObject::update;
101 std::unique_ptr<EditorType>
edit()
override
103 return std::make_unique<DefaultEditorImpl<T>>(
this,
getValue());
111 template<
class ValueModifier>
114 if(iValueModifier(&
fValue))
172 return std::make_unique<FObjectCxCallback>(
const_cast<GUIValParameter *
>(
this), iChangeCallback);
int32 getStepCount() const override
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition GUIValParameter.h:205
int32 fStepCount
Definition GUIValParameter.h:208
GUIDiscreteValParameter(ParamID iParamID, int32 iDefaultValue, int32 iStepCount)
Definition GUIValParameter.h:197
T fDefaultValue
Definition GUIValParameter.h:180
bool updateIf(ValueModifier const &iValueModifier)
Use this flavor of update if you want to modify the value itself.
Definition GUIValParameter.h:112
std::string toUTF8String(int32 iPrecision) const override
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
Definition GUIValParameter.h:154
ParamID fParamID
Definition GUIValParameter.h:179
ParamType & getValue()
Definition GUIValParameter.h:151
int32 getStepCount() const override
When a parameter is a discrete parameter (which means its underlying backing type is an int32 with va...
Definition GUIValParameter.h:70
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition GUIValParameter.h:67
void setParamID(ParamID iParamID)
Definition GUIValParameter.h:68
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount) override
Converts this parameter into a discrete parameter.
Definition GUIValParameter.h:215
tresult resetToDefault() override
Resets the param to its default value.
Definition GUIValParameter.h:135
tresult setValue(ParamType const &iValue) override
Sets the value.
Definition GUIValParameter.h:126
T fValue
Definition GUIValParameter.h:181
GUIValParameter(ParamID iParamID, ParamType const &iDefaultValue)
Definition GUIValParameter.h:52
std::unique_ptr< EditorType > edit() override
Definition GUIValParameter.h:101
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition GUIValParameter.h:170
~GUIValParameter() override
Definition GUIValParameter.h:61
bool update(ParamType const &iValue) override
Update the parameter with a value.
Definition GUIValParameter.h:77
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Definition GUIValParameter.h:162
T ParamType
Definition GUIValParameter.h:45
typename ITGUIParameter< T >::ITEditor EditorType
Definition GUIValParameter.h:46
ParamType const & getValue() const
Definition GUIValParameter.h:148
tresult accessValue(typename ITGUIParameter< T >::ValueAccessor const &iGetter) const override
Definition GUIValParameter.h:141
Defines the API for the editor which can be obtained by calling ITGUIParameter::edit().
Definition IGUIParameter.h:238
Represents a gui parameter with its underlying backing type T (aka ParamType).
Definition IGUIParameter.h:172
std::function< void(T const &)> ValueAccessor
API to access the value of the param.
Definition IGUIParameter.h:183
Interface to implement to receive parameter changes.
Definition Parameters.h:45
std::function< void()> ChangeCallback
A callback that will be invoked for changes.
Definition Parameters.h:56
constexpr auto is_operator_not_eq_defined
Allows to detect whether a type defines operator!= at compile time.
Definition Metaprogramming.h:70
constexpr auto is_static_cast_defined
Allows to detect (at compilation time) whether the call static_cast<To>(from) (where from is of type ...
Definition Metaprogramming.h:94
std::string toUTF8String(T const &iValue, Steinberg::int32 iPrecision)
This generic function will determine (at compilation time) whether T can be written to an ostream and...
Definition Utils.h:47
std::shared_ptr< T > make_sfo(Args &&...iArgs)
The VST SDK uses the concept of FObject (which are self contained reference counted objects) but requ...
Definition Utils.h:86