Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
GUIRawVstParameter::Editor Class Reference

Wrapper to edit a single parameter. More...

#include <GUIRawVstParameter.h>

Inherits ITGUIParameter< T >::ITEditor.

Public Member Functions

tresult commit () override
 Commits all the changes applied to the parameter.
virtual tresult commit (ParamType const &iValue)
 Shortcut method which calls setValue(ParamType const &) followed by commit().
 Editor (Editor const &)=delete
 Editor (ParamID iParamID, VstParametersSPtr iVstParameters)
Editoroperator= (Editor const &)=delete
tresult rollback () override
 Call this if you want to revert to the original value of the parameter (when the editor is created).
tresult setValue (ParamValue const &iValue) override
 Change the value of the parameter.
bool updateValue (ParamValue const &iValue) override
 Change the value of the parameter.
 ~Editor () override
 Technically the destructor must only call rollback(), but due to the fact that it is a virtual method, it needs to be implemented by each subclass...
Public Member Functions inherited from ITGUIParameter< T >::ITEditor
virtual tresult commit ()=0
 Importing other commit method from superclass.
virtual tresult commit (ParamType const &iValue)
 Shortcut method which calls setValue(ParamType const &) followed by commit().
virtual tresult setValue (ParamType const &iValue)=0
 Unconditionally sets the value of the parameter to the value provided.
virtual bool updateValue (ParamType const &iValue)=0
 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.

Private Attributes

ParamValue fInitialParamValue
bool fIsEditing
ParamID fParamID
VstParametersSPtr fVstParameters

Detailed Description

Wrapper to edit a single parameter.

Usage:

// from a CView::onMouseDown callback fMyParamEditor = fParameter.edit(myParamID); fParamEditor->setValue(myValue);

// from a CView::onMouseMoved callback fParamEditor->setValue(myValue);

// from a CView::onMouseUp/onMouseCancelled callback fMyParamEditor->commit();

Constructor & Destructor Documentation

◆ Editor() [1/2]

Editor ( ParamID iParamID,
VstParametersSPtr iVstParameters )

◆ ~Editor()

~Editor ( )
inlineoverridevirtual

Technically the destructor must only call rollback(), but due to the fact that it is a virtual method, it needs to be implemented by each subclass...

Reimplemented from IGUIParameter::Editor.

◆ Editor() [2/2]

Editor ( Editor const & )
delete

Member Function Documentation

◆ commit() [1/2]

tresult commit ( )
overridevirtual

Commits all the changes applied to the parameter.

Note
If commit() or rollback() has already been called this method does nothing.

Implements IGUIParameter::Editor.

◆ commit() [2/2]

virtual tresult commit ( ParamType const & iValue)
inline

Shortcut method which calls setValue(ParamType const &) followed by commit().

◆ operator=()

Editor & operator= ( Editor const & )
delete

◆ rollback()

tresult rollback ( )
overridevirtual

Call this if you want to revert to the original value of the parameter (when the editor is created).

This has no effect if commit() has already been called

Implements IGUIParameter::Editor.

◆ setValue()

tresult setValue ( ParamValue const & iValue)
override

Change the value of the parameter.

Note that nothing happens if you have called commit or rollback already

◆ updateValue()

bool updateValue ( ParamValue const & iValue)
override

Change the value of the parameter.

Note that nothing happens if you have called commit or rollback already.

Returns
true if the value was updated

Member Data Documentation

◆ fInitialParamValue

ParamValue fInitialParamValue
private

◆ fIsEditing

bool fIsEditing
private

◆ fParamID

ParamID fParamID
private

◆ fVstParameters

VstParametersSPtr fVstParameters
private

The documentation for this class was generated from the following files: