Jamba C++ API
5.1.1
|
Encapsulates a vst parameter and how to access it (read/write) as well as how to "connect" to it in order to be notified of changes. More...
#include <GUIRawVstParameter.h>
Inherits ITGUIParameter< ParamValue >.
Classes | |
class | Editor |
Wrapper to edit a single parameter. More... | |
Public Types | |
using | EditorType = ITGUIParameter< ParamValue >::ITEditor |
using | ParamType = ParamValue |
Public Types inherited from ITGUIParameter< ParamValue > | |
using | ParamType = ParamValue |
The type of the param (alias) More... | |
using | ValueAccessor = std::function< void(ParamValue const &)> |
API to access the value of the param. More... | |
Public Member Functions | |
tresult | accessValue (ValueAccessor const &iGetter) const override |
API to access the underlying value. More... | |
std::shared_ptr< GUIDiscreteParameter > | asDiscreteParameter (int32 iStepCount) override |
This implementation will adapt this parameter to be interpreted as a discrete parameter. More... | |
template<typename T > | |
std::shared_ptr< GUIVstParameter< T > > | asVstParameter () |
Converts to a typed parameter. More... | |
std::unique_ptr< FObjectCx > | connect (Parameters::IChangeListener *iChangeListener) const override |
std::unique_ptr< FObjectCx > | connect (Parameters::ChangeCallback iChangeCallback) const override |
std::unique_ptr< EditorType > | edit () override |
ParamID | getParamID () const override |
Each parameter has a unique ID returned by this method. More... | |
int32 | getStepCount () const override |
ParamValue | getValue () const |
GUIRawVstParameter (ParamID iParamID, VstParametersSPtr iVstParameters, std::shared_ptr< RawVstParamDef > iParamDef) | |
tresult | resetToDefault () override |
Resets the parameter to its default value. More... | |
tresult | setValue (ParamValue const &iValue) override |
Sets the value of this parameter. More... | |
void | toString (String128 oString) |
Populates the oString with a string representation of this parameter. More... | |
Steinberg::String | toString () |
Returns a string representation of this parameter. More... | |
std::string | toUTF8String (int32 iPrecision) const override |
Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More... | |
bool | update (ParamValue const &iValue) override |
Update the parameter with a value. More... | |
~GUIRawVstParameter ()=default | |
Public Member Functions inherited from ITGUIParameter< ParamValue > | |
virtual std::unique_ptr< ITEditor > | edit (ParamType const &iValue) |
Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the parameter value to iValue . More... | |
Public Member Functions inherited from IGUIParameter | |
template<typename T > | |
std::shared_ptr< ITGUIParameter< T > > | cast () |
Downcasts this parameter into a typed version. More... | |
Private Attributes | |
std::shared_ptr< RawVstParamDef > | fParamDef |
ParamID | fParamID |
VstParametersSPtr | fVstParameters |
Encapsulates a vst parameter and how to access it (read/write) as well as how to "connect" to it in order to be notified of changes.
This "raw" version deals with ParamValue which is the underlying type used by the vst sdk which is always a number in the range [0.0, 1.0]. The class VSTParameter deals with other types and automatic normalization/denormalization.
using EditorType = ITGUIParameter<ParamValue>::ITEditor |
using ParamType = ParamValue |
GUIRawVstParameter | ( | ParamID | iParamID, |
VstParametersSPtr | iVstParameters, | ||
std::shared_ptr< RawVstParamDef > | iParamDef | ||
) |
|
default |
|
inlineoverridevirtual |
API to access the underlying value.
getValue()
has a different api depending on the type of param (Vst and Jmb). As a result this interface only provides a common way to access it in both cases via an accessor which allows to:
kResultOk
if the getter is called, and kResultFalse
if the getter is not called for some reason Implements ITGUIParameter< ParamValue >.
|
overridevirtual |
This implementation will adapt this parameter to be interpreted as a discrete parameter.
If it is already a discrete parameter, then iStepCount
is ignored. Otherwise, if iStepCount
is > 0, then the parameter will be adapted to be handled as a discrete parameter with iStepCount
steps even if it is not. For example, if you have a parameter representing a gain value (which is not a discrete value), it can still be used with a DiscreteButtonView
so you can split the range into discrete values and have a button for each.
Implements IGUIParameter.
std::shared_ptr< GUIVstParameter< T > > asVstParameter | ( | ) |
Converts to a typed parameter.
nullptr
if the underlying parameter is not of proper type
|
inlineoverridevirtual |
Implements IGUIParameter.
|
inlineoverridevirtual |
Implements IGUIParameter.
|
inlineoverridevirtual |
Implements ITGUIParameter< ParamValue >.
|
inlineoverridevirtual |
Each parameter has a unique ID returned by this method.
GUIOptionalParam
) may return pongasoft::VST::UNDEFINED_PARAM_ID
Implements IGUIParameter.
|
inlineoverridevirtual |
Implements IGUIParameter.
|
inline |
|
inlineoverridevirtual |
Resets the parameter to its default value.
Implements IGUIParameter.
|
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< ParamValue >.
|
inline |
Populates the oString with a string representation of this parameter.
|
inline |
Returns a string representation of this parameter.
|
inlineoverridevirtual |
Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
iPrecision | if iPrecision < 0 the parameter is free to use whichever precision is tied to the parameter otherwise it should use the one provided |
Implements IGUIParameter.
|
inlineoverridevirtual |
Update the parameter with a value.
Implements ITGUIParameter< ParamValue >.
|
private |
|
private |
|
private |