VSTGUI: VST3Editor Class Reference

VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
VST3Editor Class Reference
Version 4.0

VST3 Editor with automatic parameter binding. More...

Inheritance diagram for VST3Editor:

## Public Member Functions
| VST3Editor (Steinberg::Vst::EditController *controller, UTF8StringPtr templateName, UTF8StringPtr xmlFile)
| VST3Editor (UIDescription *desc, Steinberg::Vst::EditController *controller, UTF8StringPtr templateName, UTF8StringPtr xmlFile=nullptr)
bool | exchangeView (UTF8StringPtr templateName)
void | enableTooltips (bool state)
bool | setEditorSizeConstrains (const CPoint &newMinimumSize, const CPoint &newMaximumSize)
void | getEditorSizeConstrains (CPoint &minimumSize, CPoint &maximumSize) const
bool | requestResize (const CPoint &newSize)
void | setZoomFactor (double factor)
double | getZoomFactor () const
void | setAllowedZoomFactors (std::vector< double > zoomFactors)
void | setDelegate (IVST3EditorDelegate *delegate)
| set the delegate of the editor.
IVST3EditorDelegate * | getDelegate () const
UIDescription * | getUIDescription () const
Steinberg::tresult PLUGIN_API | queryInterface (const ::Steinberg::TUID iid, void **obj) override
Public Member Functions inherited from IController
virtual int32_t | getTagForName (UTF8StringPtr name, int32_t registeredTag) const
virtual IControlListener * | getControlListener (UTF8StringPtr controlTagName)
Public Member Functions inherited from IControlListener
virtual | ~IControlListener () noexcept=default
virtual int32_t | controlModifierClicked (CControl *pControl, CButtonState button)
| return 1 if you want the control to not handle it, otherwise 0
Public Member Functions inherited from IViewAddedRemovedObserver
virtual | ~IViewAddedRemovedObserver () noexcept=default
Public Member Functions inherited from IMouseObserver
virtual | ~IMouseObserver () noexcept=default

## Protected Types
using | ParameterChangeListenerMap = std::map< int32_t, ParameterChangeListener * >

## Protected Member Functions
| ~VST3Editor () override
void | init ()
double | getAbsScaleFactor () const
ParameterChangeListener * | getParameterChangeListener (int32_t tag) const
void | recreateView ()
void | requestRecreateView ()
void | syncParameterTags ()
void | save (bool saveAs=false)
bool | enableEditing (bool state)
void | saveScreenshot ()
bool | enableShowEditButton () const
void | enableShowEditButton (bool state)
void | showEditButton (bool state)
bool PLUGIN_API | open (void *parent, const PlatformType &type) override
void PLUGIN_API | close () override
void | beginEdit (int32_t index) override
void | endEdit (int32_t index) override
CView * | createView (const UIAttributes &attributes, const IUIDescription *description) override
CView * | verifyView (CView *view, const UIAttributes &attributes, const IUIDescription *description) override
IController * | createSubController (UTF8StringPtr name, const IUIDescription *description) override
bool | beforeSizeChange (const CRect &newSize, const CRect &oldSize) override
Steinberg::tresult PLUGIN_API | onSize (Steinberg::ViewRect *newSize) override
Steinberg::tresult PLUGIN_API | canResize () override
Steinberg::tresult PLUGIN_API | checkSizeConstraint (Steinberg::ViewRect *rect) override
Steinberg::tresult PLUGIN_API | findParameter (Steinberg::int32 xPos, Steinberg::int32 yPos, Steinberg::Vst::ParamID &resultTag) override
virtual void | valueChanged (CControl *pControl) override
virtual void | controlBeginEdit (CControl *pControl) override
virtual void | controlEndEdit (CControl *pControl) override
virtual void | controlTagWillChange (CControl *pControl) override
virtual void | controlTagDidChange (CControl *pControl) override
void | onViewAdded (CFrame *frame, CView *view) override
void | onViewRemoved (CFrame *frame, CView *view) override
void | onMouseEntered (CView *view, CFrame *frame) override
void | onMouseExited (CView *view, CFrame *frame) override
void | onMouseEvent (MouseEvent &event, CFrame *frame) override
bool | validateCommandMenuItem (CCommandMenuItem *item) override
| called before the item is shown to validate its state
bool | onCommandMenuItemSelected (CCommandMenuItem *item) override
| called when the item was selected

## Protected Attributes
KeyboardHook * | keyboardHook {nullptr}
UIDescription * | description {nullptr}
IVST3EditorDelegate * | delegate {nullptr}
IController * | originalController {nullptr}
IControlListener * | openUIEditorController {nullptr}
ParameterChangeListenerMap | paramChangeListeners
std::string | viewName
std::string | xmlFile
bool | tooltipsEnabled {true}
bool | doCreateView {false}
bool | editingEnabled {false}
double | contentScaleFactor {1.}
double | zoomFactor {1.}
std::vector< double > | allowedZoomFactors
CPoint | minSize
CPoint | maxSize
CRect | nonEditRect
Optional< CPoint > | sizeRequest

## Detailed Description

VST3 Editor with automatic parameter binding.

The VST3Editor class represents the view for a VST3 plug-in. It automatically binds the VST3 parameters to VSTGUI control tags and it includes an inline UI editor for rapid development.

# Setup

Add the following code to your Steinberg::Vst::EditController class:

IPlugView* PLUGIN_API MyEditController::createView (FIDString name)
{
if (strcmp (name, ViewType::kEditor) == 0)
{
return new VST3Editor (this, "view", "myEditor.uidesc");
}
return 0;
}

To activate the inline editor you need to define the preprocessor definition "VSTGUI_LIVE_EDITING=1". Rebuild your plug-in, start your prefered host, instanciate your plug-in, open the context menu inside your editor and choose "Enable Editing". Now you can define tags, colors, fonts, bitmaps and add views to your editor.

See Inline UI Editor for VST3 (WYSIWYG)

## Member Typedef Documentation

using ParameterChangeListenerMap = std::map<int32_t, ParameterChangeListener*>
| protected

## Constructor & Destructor Documentation

VST3Editor | ( | Steinberg::Vst::EditController * | controller,
|  | UTF8StringPtr | templateName,
|  | UTF8StringPtr | xmlFile
| ) |  |

VST3Editor | ( | UIDescription * | desc,
|  | Steinberg::Vst::EditController * | controller,
|  | UTF8StringPtr | templateName,
|  | UTF8StringPtr | xmlFile = `nullptr`
| ) |  |

~VST3Editor | ( |  | ) |
| overrideprotected

## Member Function Documentation

bool beforeSizeChange | ( | const CRect & | newSize,
|  | const CRect & | oldSize
| ) |  |
| overrideprotected

void beginEdit | ( | int32_t | index | ) |
| overrideprotected

Steinberg::tresult PLUGIN_API canResize | ( |  | ) |
| overrideprotected

Steinberg::tresult PLUGIN_API checkSizeConstraint | ( | Steinberg::ViewRect * | rect | ) |
| overrideprotected

void PLUGIN_API close | ( |  | ) |
| overrideprotected

void controlBeginEdit | ( | CControl * | pControl | ) |
| overrideprotectedvirtual

Reimplemented from IControlListener.

void controlEndEdit | ( | CControl * | pControl | ) |
| overrideprotectedvirtual

Reimplemented from IControlListener.

void controlTagDidChange | ( | CControl * | pControl | ) |
| overrideprotectedvirtual

Reimplemented from IControlListener.

void controlTagWillChange | ( | CControl * | pControl | ) |
| overrideprotectedvirtual

Reimplemented from IControlListener.

IController* createSubController | ( | UTF8StringPtr | name,
|  | const IUIDescription * | description
| ) |  |
| overrideprotectedvirtual

Reimplemented from IController.

CView* createView | ( | const UIAttributes & | attributes,
|  | const IUIDescription * | description
| ) |  |
| overrideprotectedvirtual

Reimplemented from IController.

bool enableEditing | ( | bool | state | ) |
| protected

bool enableShowEditButton | ( |  | ) | const
| protected

void enableShowEditButton | ( | bool | state | ) |
| protected

void enableTooltips | ( | bool | state | ) |

void endEdit | ( | int32_t | index | ) |
| overrideprotected

bool exchangeView | ( | UTF8StringPtr | templateName | ) |

Steinberg::tresult PLUGIN_API findParameter | ( | Steinberg::int32 | xPos,
|  | Steinberg::int32 | yPos,
|  | Steinberg::Vst::ParamID & | resultTag
| ) |  |
| overrideprotected

double getAbsScaleFactor | ( |  | ) | const
| protected

IVST3EditorDelegate* getDelegate | ( |  | ) | const

void getEditorSizeConstrains | ( | CPoint & | minimumSize,
|  | CPoint & | maximumSize
| ) |  | const

ParameterChangeListener * getParameterChangeListener | ( | int32_t | tag | ) | const
| protected

UIDescription* getUIDescription | ( |  | ) | const

double getZoomFactor | ( |  | ) | const
| inline

void init | ( |  | ) |
| protected

bool onCommandMenuItemSelected | ( | CCommandMenuItem * | item | ) |
| overrideprotectedvirtual

called when the item was selected

Reimplemented from CommandMenuItemTargetAdapter.

void onMouseEntered | ( | CView * | view,
|  | CFrame * | frame
| ) |  |
| inlineoverrideprotectedvirtual

Implements IMouseObserver.

void onMouseEvent | ( | MouseEvent & | event,
|  | CFrame * | frame
| ) |  |
| overrideprotectedvirtual

Implements IMouseObserver.

void onMouseExited | ( | CView * | view,
|  | CFrame * | frame
| ) |  |
| inlineoverrideprotectedvirtual

Implements IMouseObserver.

Steinberg::tresult PLUGIN_API onSize | ( | Steinberg::ViewRect * | newSize | ) |
| overrideprotected

void onViewAdded | ( | CFrame * | frame,
|  | CView * | view
| ) |  |
| overrideprotectedvirtual

Implements IViewAddedRemovedObserver.

void onViewRemoved | ( | CFrame * | frame,
|  | CView * | view
| ) |  |
| overrideprotectedvirtual

Implements IViewAddedRemovedObserver.

bool PLUGIN_API open | ( | void * | parent,
|  | const PlatformType & | type
| ) |  |
| overrideprotected

Steinberg::tresult PLUGIN_API queryInterface | ( | const ::Steinberg::TUID | iid,
|  | void ** | obj
| ) |  |
| override

void recreateView | ( |  | ) |
| protected

void requestRecreateView | ( |  | ) |
| protected

bool requestResize | ( | const CPoint & | newSize | ) |

void save | ( | bool | saveAs = `false` | ) |
| protected

void saveScreenshot | ( |  | ) |
| protected

void setAllowedZoomFactors | ( | std::vector< double > | zoomFactors | ) |
| inline

void setDelegate | ( | IVST3EditorDelegate * | delegate | ) |

set the delegate of the editor.

no reference counting is happening here.

bool setEditorSizeConstrains | ( | const CPoint & | newMinimumSize,
|  | const CPoint & | newMaximumSize
| ) |  |

void setZoomFactor | ( | double | factor | ) |

void showEditButton | ( | bool | state | ) |
| protected

void syncParameterTags | ( |  | ) |
| protected

bool validateCommandMenuItem | ( | CCommandMenuItem * | item | ) |
| overrideprotectedvirtual

called before the item is shown to validate its state

Reimplemented from CommandMenuItemTargetAdapter.

void valueChanged | ( | CControl * | pControl | ) |
| overrideprotectedvirtual

Implements IControlListener.

CView* verifyView | ( | CView * | view,
|  | const UIAttributes & | attributes,
|  | const IUIDescription * | description
| ) |  |
| overrideprotectedvirtual

Reimplemented from IController.

## Member Data Documentation

std::vector<double> allowedZoomFactors
| protected

double contentScaleFactor {1.}
| protected

IVST3EditorDelegate* delegate {nullptr}
| protected

UIDescription* description {nullptr}
| protected

bool doCreateView {false}
| protected

bool editingEnabled {false}
| protected

KeyboardHook* keyboardHook {nullptr}
| protected

CPoint maxSize
| protected

CPoint minSize
| protected

CRect nonEditRect
| protected

IControlListener* openUIEditorController {nullptr}
| protected

IController* originalController {nullptr}
| protected

ParameterChangeListenerMap paramChangeListeners
| protected

Optional<CPoint> sizeRequest
| protected

bool tooltipsEnabled {true}
| protected

std::string viewName
| protected

std::string xmlFile
| protected

double zoomFactor {1.}
| protected

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

- vst3editor.h
- vst3editor.cpp