22#include <pluginterfaces/vst/vsttypes.h>
23#include <pongasoft/logging/logging.h>
29using namespace Steinberg::Vst;
37template<std::semiregular T>
44 using FObject::update;
97 std::unique_ptr<EditorType>
edit()
override
99 return std::make_unique<DefaultEditorImpl<T>>(
this,
getValue());
107 template<
class ValueModifier>
108 requires std::predicate<ValueModifier const &, T *>
111 if(iValueModifier(&
fValue))
169 return std::make_unique<FObjectCxCallback>(
const_cast<GUIValParameter *
>(
this), iChangeCallback);
211template<std::semiregular T>
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:202
int32 fStepCount
Definition GUIValParameter.h:205
GUIDiscreteValParameter(ParamID iParamID, int32 iDefaultValue, int32 iStepCount)
Definition GUIValParameter.h:194
T fDefaultValue
Definition GUIValParameter.h:177
ITGUIParameter< T >::ITEditor EditorType
Definition GUIValParameter.h:42
bool updateIf(ValueModifier const &iValueModifier)
Use this flavor of update if you want to modify the value itself.
Definition GUIValParameter.h:109
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:151
ParamID fParamID
Definition GUIValParameter.h:176
ParamType & getValue()
Definition GUIValParameter.h:148
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:66
ParamID getParamID() const override
Each parameter has a unique ID returned by this method.
Definition GUIValParameter.h:63
tresult accessValue(ITGUIParameter< T >::ValueAccessor const &iGetter) const override
Definition GUIValParameter.h:138
void setParamID(ParamID iParamID)
Definition GUIValParameter.h:64
std::shared_ptr< GUIDiscreteParameter > asDiscreteParameter(int32 iStepCount) override
Converts this parameter into a discrete parameter.
Definition GUIValParameter.h:212
tresult resetToDefault() override
Resets the param to its default value.
Definition GUIValParameter.h:132
tresult setValue(ParamType const &iValue) override
Sets the value.
Definition GUIValParameter.h:123
T fValue
Definition GUIValParameter.h:178
GUIValParameter(ParamID iParamID, ParamType const &iDefaultValue)
Definition GUIValParameter.h:48
std::unique_ptr< EditorType > edit() override
Definition GUIValParameter.h:97
std::unique_ptr< FObjectCx > connect(Parameters::ChangeCallback iChangeCallback) const override
Definition GUIValParameter.h:167
~GUIValParameter() override
Definition GUIValParameter.h:57
bool update(ParamType const &iValue) override
Update the parameter with a value.
Definition GUIValParameter.h:73
std::unique_ptr< FObjectCx > connect(Parameters::IChangeListener *iChangeListener) const override
Definition GUIValParameter.h:159
T ParamType
Definition GUIValParameter.h:41
ParamType const & getValue() const
Definition GUIValParameter.h:145
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
std::function< void(T const &)> ValueAccessor
API to access the value of the param.
Definition IGUIParameter.h:186
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
Allows to detect (at compilation time) whether the call static_cast<To>(from) (where from is of type ...
Definition Metaprogramming.h:84
Allows to detect whether a type defines operator!= at compile time.
Definition Metaprogramming.h:62
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