Jamba C++ API  4.0.0
DefaultEditorImpl< T > Class Template Reference

Default implementation of the editor interface. More...

#include <IGUIParameter.h>

Inherits ITGUIParameter< T >::ITEditor.

Public Member Functions

tresult commit () override
 Commits all the changes applied to the parameter. More...
 
 DefaultEditorImpl (ITGUIParameter< T > *iGUIParameter, T const &iDefaultValue)
 
tresult rollback () override
 Rollback all the changes that were made to this parameter (since this editor was created). More...
 
tresult setValue (T const &iValue) override
 Unconditionaly sets the value of the parameter to the value provided. More...
 
bool updateValue (T const &iValue) override
 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. More...
 
 ~DefaultEditorImpl () override
 
- Public Member Functions inherited from ITGUIParameter< T >::ITEditor
virtual tresult commit (ParamType const &iValue)
 Shortcut method which calls setValue(ParamType const &) followed by commit(). More...
 
- Public Member Functions inherited from IGUIParameter::Editor
virtual ~Editor ()=default
 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... More...
 

Private Attributes

bool fDoneEditing {false}
 
ITGUIParameter< T > * fGUIParameter
 
fInitialValue
 

Detailed Description

template<typename T>
class pongasoft::VST::GUI::Params::DefaultEditorImpl< T >

Default implementation of the editor interface.

Simply delegates the calls to the parameter while maintaining an initial value (for rollback()) and state (already completed).

Private API
This is part of the internal/private API of Jamba and should not be used directly.

Constructor & Destructor Documentation

◆ DefaultEditorImpl()

DefaultEditorImpl ( ITGUIParameter< T > *  iGUIParameter,
T const &  iDefaultValue 
)
inlineexplicit

◆ ~DefaultEditorImpl()

~DefaultEditorImpl ( )
inlineoverride

Member Function Documentation

◆ commit()

tresult commit ( )
inlineoverridevirtual

Commits all the changes applied to the parameter.

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

Implements IGUIParameter::Editor.

◆ rollback()

tresult rollback ( )
inlineoverridevirtual

Rollback all the changes that were made to this parameter (since this editor was created).

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

Implements IGUIParameter::Editor.

◆ setValue()

tresult setValue ( T const &  iValue)
inlineoverridevirtual

Unconditionaly sets the value of the parameter to the value provided.

Parameters
iValuethe value to set
Returns
kResultOk if successful

Implements ITGUIParameter< T >::ITEditor.

◆ updateValue()

bool updateValue ( T const &  iValue)
inlineoverridevirtual

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.

Note
If the type T does not provide a way to compare the value, then this call will delegate to setValue(ParamType const &) and return true.
Parameters
iValuethe value to update
Returns
true if the value was updated

Implements ITGUIParameter< T >::ITEditor.

Member Data Documentation

◆ fDoneEditing

bool fDoneEditing {false}
private

◆ fGUIParameter

ITGUIParameter<T>* fGUIParameter
private

◆ fInitialValue

T fInitialValue
private

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