ASPiK SDK
Steinberg::Vst::ASPiK::PluginEditor Class Reference

The VST GUI for the plugin. This is needed because VST3 requires an IPlugView GUI, which is VST3 specific (involves VST3 SDK files) More...

#include <vst3plugin.h>

Inheritance diagram for Steinberg::Vst::ASPiK::PluginEditor:
VSTGUI::PluginGUI IGUIWindowFrame VSTGUI::PluginGUI IGUIWindowFrame IGUIView IGUIView IGUIView IGUIView

Public Types

typedef std::map< int32_t, VST3UpdateHandler * > UpdaterHandlerMap
 
typedef std::map< int32_t, VST3UpdateHandler * > UpdaterHandlerMap
 

Public Member Functions

 PluginEditor (VSTGUI::UTF8StringPtr _xmlFile, PluginCore *_pluginCore, GUIPluginConnector *_guiPluginConnector, PluginHostConnector *_pluginHostConnector, VST3Plugin *editController)
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual ~PluginEditor ()
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
const ViewRect & getRect () const
 
void setRect (const ViewRect &r)
 
bool isAttached () const
 
virtual void attachedToParent () override
 
virtual void removedFromParent () override
 
virtual tresult PLUGIN_API attached (void *parent, FIDString type) override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API removed () override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API onWheel (float distance) override
 
virtual tresult PLUGIN_API isPlatformTypeSupported (FIDString type) override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API onSize (ViewRect *newSize) override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API getSize (ViewRect *size) override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API onFocus (TBool) override
 
virtual tresult PLUGIN_API setFrame (IPlugFrame *frame) override
 ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface. More...
 
virtual tresult PLUGIN_API canResize () override
 
virtual tresult PLUGIN_API checkSizeConstraint (ViewRect *rect) override
 
virtual bool setWindowFrameSize (double left=0, double top=0, double right=0, double bottom=0) override
 
virtual bool getWindowFrameSize (double &left, double &top, double &right, double &bottom) override
 
 PluginEditor (VSTGUI::UTF8StringPtr _xmlFile, PluginCore *_pluginCore, GUIPluginConnector *_guiPluginConnector, PluginHostConnector *_pluginHostConnector, VST3Plugin *editController)
 
const ViewRect & getRect () const
 
void setRect (const ViewRect &r)
 
bool isAttached () const
 
virtual void attachedToParent () override
 
virtual void removedFromParent () override
 
virtual tresult PLUGIN_API attached (void *parent, FIDString type) override
 
virtual tresult PLUGIN_API removed () override
 
virtual tresult PLUGIN_API onWheel (float distance) override
 
virtual tresult PLUGIN_API isPlatformTypeSupported (FIDString type) override
 
virtual tresult PLUGIN_API onSize (ViewRect *newSize) override
 
virtual tresult PLUGIN_API getSize (ViewRect *size) override
 
virtual tresult PLUGIN_API onFocus (TBool) override
 
virtual tresult PLUGIN_API setFrame (IPlugFrame *frame) override
 
virtual tresult PLUGIN_API canResize () override
 
virtual tresult PLUGIN_API checkSizeConstraint (ViewRect *rect) override
 
virtual bool setWindowFrameSize (double left=0, double top=0, double right=0, double bottom=0) override
 
virtual bool getWindowFrameSize (double &left, double &top, double &right, double &bottom) override
 
- Public Member Functions inherited from VSTGUI::PluginGUI
 PluginGUI (UTF8StringPtr _xmlFile)
 
virtual ~PluginGUI ()
 
bool open (UTF8StringPtr _viewName, void *parent, const std::vector< PluginParameter *> *pluginParameterPtr, const PlatformType &platformType=kDefaultNative, IGUIPluginConnector *_guiPluginConnector=nullptr, void *data=nullptr)
 
void close ()
 
void syncGUIControl (uint32_t controlID)
 
void getSize (float &width, float &height)
 
void scaleGUISize (uint32_t controlValue)
 
void writeToPresetFile ()
 
void setAAXViewContainer (AAX_IViewContainer *_aaxViewContainer)
 AAX ONLY: plugin shell GUI object sets this after creation. More...
 
void setAAXParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the plugin shelll parameter from GUI control using thread-safe mechanism More...
 
void updateGUIControlAAX (int tag, float actualPluginValue, float normalizedValue=0.f, bool useNormalized=false)
 set the GUI control from the plugin shell GUI object (thread-safe) More...
 
void dispatchAUControlChange (int tag, float actualPluginValue, int message=-1, bool fromEventListener=false)
 set the GUI control from the AU event generator; this is part of the thread-safe event system. This gets called when automation is running. More...
 
void setAU (AudioUnit inAU)
 
CMessageResult notify (CBaseObject *sender, IdStringPtr message) override
 
virtual void valueChanged (VSTGUI::CControl *pControl) override
 
virtual int32_t controlModifierClicked (VSTGUI::CControl *pControl, VSTGUI::CButtonState button) override
 return 1 if you want the control to not handle it, otherwise 0 More...
 
virtual void controlBeginEdit (VSTGUI::CControl *pControl) override
 
virtual void controlEndEdit (VSTGUI::CControl *pControl) override
 
virtual void controlTagWillChange (VSTGUI::CControl *pControl) override
 
virtual void controlTagDidChange (VSTGUI::CControl *pControl) override
 
CView * createUserCustomView (std::string viewname, const CRect rect, IControlListener *listener, int32_t tag)
 
CView * createView (const UIAttributes &attributes, const IUIDescription *description) override
 
IController * createSubController (UTF8StringPtr name, const IUIDescription *description) override
 
ControlUpdateReceivergetControlUpdateReceiver (int32_t tag) const
 
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
 
CMouseEventResult onMouseDown (CFrame *frame, const CPoint &where, const CButtonState &buttons) override
 
CMouseEventResult onMouseMoved (CFrame *frame, const CPoint &where, const CButtonState &buttons) override
 
int32_t onKeyDown (const VstKeyCode &code, CFrame *frame) override
 
int32_t onKeyUp (const VstKeyCode &code, CFrame *frame) override
 
virtual bool validateCommandMenuItem (CCommandMenuItem *item)
 
virtual bool onCommandMenuItemSelected (CCommandMenuItem *item)
 
virtual void setGUIWindowFrame (IGUIWindowFrame *frame) override
 set the interface pointer for resizing from the GUI More...
 
bool hasWriteableControl (CControl *control)
 check to see if we already store this meter control More...
 
void checkAddWriteableControl (PluginParameter *piParam, CControl *control)
 check to see if we already store this meter control and add it if we don't More...
 
void checkRemoveWriteableControl (CControl *control)
 check to see if we already store this meter control and remove it if we do More...
 
void deleteControlUpdateReceivers ()
 delete all reciever objects
 
void forgetWriteableControls ()
 forget all writeable (neter) controls
 
bool hasICustomView (CView *view)
 simple helper function to test view for ICustomView More...
 
bool hasICustomView (IController *subController)
 simple helper function to test sub-controller for ICustomView More...
 
 PluginGUI (UTF8StringPtr _xmlFile)
 PluginGUI constructor; note that this maintains both Mac and Windows contexts, the bundle ref for Mac and the external void* for Windows. More...
 
virtual ~PluginGUI ()
 PluginGUI destructor. More...
 
bool open (UTF8StringPtr _viewName, void *parent, const std::vector< PluginParameter *> *pluginParameterPtr, const PlatformType &platformType=kDefaultNative, IGUIPluginConnector *_guiPluginConnector=nullptr, void *data=nullptr)
 
void close ()
 prepares the GUI control objects for destruction, cleans up More...
 
void syncGUIControl (uint32_t controlID)
 safely sets the GUI control value based on the plugin parameter value More...
 
void getSize (float &width, float &height)
 returns the size into the pass-by-reference variables More...
 
void scaleGUISize (uint32_t controlValue)
 scales the GUI; this is the handler for the special scaling GUI control More...
 
void writeToPresetFile ()
 writes the current state of all GUI controls into a text file so that yuu can simply cut and paste the C++ code into the core object file. More...
 
CMessageResult notify (CBaseObject *sender, IdStringPtr message) override
 
virtual void valueChanged (VSTGUI::CControl *pControl) override
 
virtual int32_t controlModifierClicked (VSTGUI::CControl *pControl, VSTGUI::CButtonState button) override
 return 1 if you want the control to not handle it, otherwise 0 More...
 
virtual void controlBeginEdit (VSTGUI::CControl *pControl) override
 
virtual void controlEndEdit (VSTGUI::CControl *pControl) override
 
virtual void controlTagWillChange (VSTGUI::CControl *pControl) override
 
virtual void controlTagDidChange (VSTGUI::CControl *pControl) override
 
CView * createUserCustomView (std::string viewname, const CRect rect, IControlListener *listener, int32_t tag)
 add your custom views here; this is where you can create and register the views outside of the createView( ) method below. More...
 
CView * createView (const UIAttributes &attributes, const IUIDescription *description) override
 
IController * createSubController (UTF8StringPtr name, const IUIDescription *description) override
 
ControlUpdateReceivergetControlUpdateReceiver (int32_t tag) const
 find the receiver for a given tag; there can be only one receiver for any tag More...
 
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
 
CMouseEventResult onMouseDown (CFrame *frame, const CPoint &where, const CButtonState &buttons) override
 
CMouseEventResult onMouseMoved (CFrame *frame, const CPoint &where, const CButtonState &buttons) override
 
int32_t onKeyDown (const VstKeyCode &code, CFrame *frame) override
 
int32_t onKeyUp (const VstKeyCode &code, CFrame *frame) override
 
virtual bool validateCommandMenuItem (CCommandMenuItem *item)
 validates menu item selections to prevent crashing More...
 
virtual bool onCommandMenuItemSelected (CCommandMenuItem *item)
 message handler for GUI Designer menu More...
 
virtual void setGUIWindowFrame (IGUIWindowFrame *frame) override
 set the interface pointer for resizing from the GUI More...
 
bool hasWriteableControl (CControl *control)
 check to see if we already store this meter control More...
 
void checkAddWriteableControl (PluginParameter *piParam, CControl *control)
 check to see if we already store this meter control and add it if we don't More...
 
void checkRemoveWriteableControl (CControl *control)
 check to see if we already store this meter control and remove it if we do More...
 
void deleteControlUpdateReceivers ()
 delete all reciever objects
 
void forgetWriteableControls ()
 forget all writeable (neter) controls
 
bool hasICustomView (CView *view)
 simple helper function to test view for ICustomView More...
 
bool hasICustomView (IController *subController)
 simple helper function to test sub-controller for ICustomView More...
 
- Public Member Functions inherited from IGUIWindowFrame
virtual void enableGUIDesigner (bool enable)
 
virtual void enableGUIDesigner (bool enable)
 

Public Attributes

UpdaterHandlerMap updateHandlers
 
IPlugFrame * plugFrame
 

Protected Attributes

PluginCorepluginCore = nullptr
 the core
 
GUIPluginConnectorguiPluginConnector = nullptr
 GUI Plugin interface.
 
PluginHostConnectorpluginHostConnector = nullptr
 Plugin Host interface.
 
VST3PlugineditController = nullptr
 parent VST3
 
- Protected Attributes inherited from VSTGUI::PluginGUI
IGUIPluginConnectorguiPluginConnector = nullptr
 the plugin shell interface that arrives with the open( ) function; OK if NULL for standalone GUIs
 
UIDescription * description = nullptr
 the description version of the XML file
 
std::string viewName
 name
 
std::string xmlFile
 the XML file name
 
uint32_t numUIControls = 0
 control counter
 
double zoomFactor = 1.0
 scaling factor for built-in scaling
 
CVSTGUITimer * timer
 timer object (this is platform dependent)
 
CPoint minSize
 the min size of the GUI window
 
CPoint maxSize
 the max size of the GUI window
 
CRect nonEditRect
 non-edit area for GUI designer
 
bool showGUIEditor = false
 show the GUI designer
 
bool createNewView = true
 show the normal GUI
 
double guiDesignerWidth
 GUI Designer's frame size.
 
double guiDesignerHeight
 GUI Designer's frame size.
 
float guiWidth
 embedded GUI size
 
float guiHeight
 embedded GUI size
 
IGUIWindowFrameguiWindowFrame = nullptr
 interface to allow plugin shell to resize our window
 
CFrame * guiEditorFrame = nullptr
 pointer to our frame
 
uint32_t knobAction = kLinearMode
 knob mode
 
AudioUnit m_AU
 AU ONLY: the AU plugin reference.
 
AUEventListenerRef AUEventListener
 AU ONLY: the event listener token.
 

Additional Inherited Members

- Static Public Member Functions inherited from VSTGUI::PluginGUI
static bool parseSize (const std::string &str, CPoint &point)
 simple helper function to get size from string More...
 
static bool parseSize (const std::string &str, CPoint &point)
 simple helper function to get size from string More...
 
- Protected Member Functions inherited from VSTGUI::PluginGUI
virtual void idle ()
 
void preCreateGUI ()
 
bool createGUI (bool bShowGUIEditor)
 
void save (bool saveAs=false)
 
virtual int32_t getKnobMode () const override
 
void deleteGUIControlList ()
 
PluginParametergetGuiControlWithTag (int tag)
 find the local PluginParameter that is connected to the same control ID More...
 
std::string getGUIDesignerSize ()
 
int getControlID_WithMouseCoords (const CPoint &where)
 
CControl * getControl_WithMouseCoords (const CPoint &where)
 
CMouseEventResult sendAAXMouseDown (int controlID, const CButtonState &buttons)
 
CMouseEventResult sendAAXMouseMoved (int controlID, const CButtonState &buttons, const CPoint &where)
 
CMouseEventResult sendAUMouseDown (CControl *control, const CButtonState &buttons)
 
CMouseEventResult sendAUMouseMoved (CControl *control, const CButtonState &buttons, const CPoint &where)
 
void setPluginParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 safely set a plugin shell parameter with a GUI control More...
 
void setAUEventFromGUIControl (CControl *control, int tag, float normalizedValue)
 set the AU event from the GUI congrol; this is part of the thread-safe event system. This is called to safely set the GUI control value on the plugin shell's parameter list. More...
 
void setVSTParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the VST parameter from the GUI control More...
 
void updateGUIControlVST (int tag, float normalizedValue)
 set the GUI control from the VST parameter More...
 
void setRAFXParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the RAFX2 parameter from the GUI control More...
 
void updateGUIControlRAFX (int tag, float normalizedValue)
 set the GUI control from the RAFX2 parameter More...
 
virtual void idle ()
 perform idling operation; called directly from timer thread More...
 
void preCreateGUI ()
 one-time pre-create init, currently used for AU only More...
 
bool createGUI (bool bShowGUIEditor)
 creates either the GUI or the GUI Designer More...
 
void save (bool saveAs=false)
 
virtual int32_t getKnobMode () const override
 
void deleteGUIControlList ()
 
PluginParametergetGuiControlWithTag (int tag)
 find the local PluginParameter that is connected to the same control ID More...
 
std::string getGUIDesignerSize ()
 get size string More...
 
int getControlID_WithMouseCoords (const CPoint &where)
 control finder, for AAX only, part of Pro Tools automation keyboard shortcut More...
 
CControl * getControl_WithMouseCoords (const CPoint &where)
 control finder, for AAX only, part of Pro Tools automation keyboard shortcut More...
 
CMouseEventResult sendAAXMouseDown (int controlID, const CButtonState &buttons)
 mouse down handler for Pro Tools keyboard shortcuts More...
 
CMouseEventResult sendAAXMouseMoved (int controlID, const CButtonState &buttons, const CPoint &where)
 mouse moved handler for Pro Tools keyboard shortcuts More...
 
CMouseEventResult sendAUMouseDown (CControl *control, const CButtonState &buttons)
 mouse down handler for AU automation More...
 
CMouseEventResult sendAUMouseMoved (CControl *control, const CButtonState &buttons, const CPoint &where)
 
void setPluginParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 safely set a plugin shell parameter with a GUI control More...
 

Detailed Description

The VST GUI for the plugin. This is needed because VST3 requires an IPlugView GUI, which is VST3 specific (involves VST3 SDK files)

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Constructor & Destructor Documentation

◆ PluginEditor()

Steinberg::Vst::ASPiK::PluginEditor::PluginEditor ( VSTGUI::UTF8StringPtr  _xmlFile,
PluginCore _pluginCore,
GUIPluginConnector _guiPluginConnector,
PluginHostConnector _pluginHostConnector,
VST3Plugin _editController 
)

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ ~PluginEditor()

Steinberg::Vst::ASPiK::PluginEditor::~PluginEditor ( )
virtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

Member Function Documentation

◆ attached()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::attached ( void *  parent,
FIDString  type 
)
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getSize()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::getSize ( ViewRect *  size)
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ getWindowFrameSize() [1/2]

virtual bool Steinberg::Vst::ASPiK::PluginEditor::getWindowFrameSize ( double &  left,
double &  top,
double &  right,
double &  bottom 
)
inlineoverridevirtual

get the frame size

Implements IGUIWindowFrame.

◆ getWindowFrameSize() [2/2]

virtual bool Steinberg::Vst::ASPiK::PluginEditor::getWindowFrameSize ( double &  left,
double &  top,
double &  right,
double &  bottom 
)
inlineoverridevirtual

get the frame size

Implements IGUIWindowFrame.

◆ isPlatformTypeSupported()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::isPlatformTypeSupported ( FIDString  type)
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ onSize()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::onSize ( ViewRect *  newSize)
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ removed()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::removed ( )
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setFrame()

tresult PLUGIN_API Steinberg::Vst::ASPiK::PluginEditor::setFrame ( IPlugFrame *  frame)
overridevirtual

ASPiK support VST3 GUI - this wraps the ASPiK GUI so that it conforms to the IPlugView interface.

NOTES:

  • see Designing Audio Effects in C++ 2nd Ed. by Will Pirkle for more information and a VST3 Programming Guide
  • see VST3 SDK Documentation for more information on this function and its parameters

◆ setWindowFrameSize() [1/2]

virtual bool Steinberg::Vst::ASPiK::PluginEditor::setWindowFrameSize ( double  left = 0,
double  top = 0,
double  right = 0,
double  bottom = 0 
)
inlineoverridevirtual

set the frame size

Implements IGUIWindowFrame.

◆ setWindowFrameSize() [2/2]

virtual bool Steinberg::Vst::ASPiK::PluginEditor::setWindowFrameSize ( double  left = 0,
double  top = 0,
double  right = 0,
double  bottom = 0 
)
inlineoverridevirtual

set the frame size

Implements IGUIWindowFrame.


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