|
| std::unique_ptr< FObjectCx > | connect (Parameters::ChangeCallback iChangeCallback) const |
| | Creates a connection between this parameter and the callback: whenever the parameter changes, the callback will be invoked (std::function<void()>).
|
| std::unique_ptr< FObjectCx > | connect (Parameters::IChangeListener *iChangeListener) const |
| | Creates a connection between this parameter and the change listener: whenever the parameter changes, the listener will be notified of the changes (Parameters::IChangeListener::onParameterChange(ParamID)).
|
| std::unique_ptr< EditorType > | edit () |
| | Creates an editor to modify the parameter in a transactional fashion.
|
| std::unique_ptr< EditorType > | edit (ParamType const &iValue) |
| | Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the parameter value to iValue.
|
| bool | exists () const |
| | Always return true because by definition an optional parameter always exist.
|
| ParamID | getParamID () const |
| | Each parameter has a unique ID returned by this method.
|
| int32 | getStepCount () const |
| | When a parameter is a discrete parameter (which means its underlying backing type is an int32 with values in the discrete range [0, getStepCount()]), this method will return the number of steps (> 0).
|
| ParamType | getValue () const |
| | GUIOptionalParam () |
| | GUIOptionalParam (std::shared_ptr< ITGUIParameter< T > > iParameter) |
| | GUIOptionalParam (T const &iDefaultValue) |
| | operator ParamType () const |
| | Allow to use the param as the underlying ParamType.
|
| constexpr ParamType | operator* () const |
| | allow writing *param to access the underlying value (or in other words, *param is the same param.value())
|
| constexpr Value | operator-> () const |
| | allow writing param->x to access the underlying value when T is a struct or class
|
| GUIOptionalParam & | operator= (T const &iValue) |
| | Allow to write param = 3 instead of param.update(3) for example.
|
| tresult | resetToDefault () |
| | Resets the param to its default value.
|
| tresult | setValue (ParamType const &iValue) |
| | Unconditionally sets the value of the parameter to the value provided.
|
| std::string | toUTF8String (int32 iPrecision) const |
| | Returns the current value of the parameter as a string (which is properly UTF-8 encoded).
|
| bool | update (ParamType const &iValue) |
| | First check if the value provided (iValue) is different from the current value and if that is the case then updates it to the new value.
|
| ParamType | value () const |
| | Synonym to getValue().
|
template<typename T>
class pongasoft::VST::GUI::Params::GUIOptionalParam< T >
Represents an optional parameter (Jmb, Vst or no param at all).
Like GUIVstParam and GUIJmbParam, this class is a wrapper around the underlying parameter. This parameter is used in very generic views that need to handle a Vst or Jmb parameter, as well as no parameter at all (which is for example the case when adding a brand new view in the VSTGUI editor) and still be functional.
You can obtain an instance of an optional parameter by calling any ParamAware::registerOptionalXXX (resp. ParamAware::registerOptionalDiscreteXX) method.
- Note
- Because GUIOptionalParam can represent a Vst parameter or a Jmb parameter, there are some restrictions on T itself (which do not exist if you use GUIJmbParam):
- T must have empty constructor: T()
- T have a copy constructor: T(T const &)
- T must be copy assignable: T& operator=(T const &)