ASPiK SDK
VSTGUI::PluginGUI Class Reference

The PluginGUI object that maintains the entire GUI operation and has #defines to use with AAX, AU, VST3 and RAFX2 plugins. Note the multiple inheritance inolved with this very complex object. The IGUIView interface is the only non-VSTGUI4 base class. It allows for GUI resizing and manipulation, if and only if the host DAW allows and provides the mechanism for it. More...

#include <plugingui.h>

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

Public Member Functions

 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...
 

Static Public Member Functions

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

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...
 

Protected Attributes

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.
 

Detailed Description

The PluginGUI object that maintains the entire GUI operation and has #defines to use with AAX, AU, VST3 and RAFX2 plugins. Note the multiple inheritance inolved with this very complex object. The IGUIView interface is the only non-VSTGUI4 base class. It allows for GUI resizing and manipulation, if and only if the host DAW allows and provides the mechanism for it.

Features:

  • fully self-contained and stand-alone object
  • uses interfaces for proper and safe communication with plugin shell (NEVER communicates with core or any other kernel object)
  • has built-in zooming option for changing GUI size
  • includes all necessary code to maintain host requirements (e.g. AU Event Listener system for AU)
  • includes a built-in drag-and-drop GUI designer that works in any DAW/API/OS
  • the GUI object is set to decode a single XML file that represents the GUI; you can extend this to load multiple, different XML files
  • uses the VSTGUI4 XML parser object, UIDescription, and UIEditController objects; there is no hack-code and it uses VSTGUI4-approved mechanisms
  • allows for custom views
  • allows for custom sub-controllers
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

◆ PluginGUI() [1/2]

VSTGUI::PluginGUI::PluginGUI ( UTF8StringPtr  _xmlFile)

construction with XML file

◆ ~PluginGUI() [1/2]

virtual VSTGUI::PluginGUI::~PluginGUI ( )
virtual

destruction

◆ PluginGUI() [2/2]

PluginGUI::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.

construction with XML file

Operation:

  • creates UIDescription from the XML file; stores both the file and the description object (they get used or written later)
  • calls description->parse() to convert XML into objects
  • initializes main attributes
  • sets up the GUI timer for a 50 millisecond repaint interval

◆ ~PluginGUI() [2/2]

PluginGUI::~PluginGUI ( )
virtual

PluginGUI destructor.

destruction

Operation:

  • destroys UIDescription
  • destroys timer

Member Function Documentation

◆ checkAddWriteableControl() [1/2]

void VSTGUI::PluginGUI::checkAddWriteableControl ( PluginParameter piParam,
CControl *  control 
)
inline

check to see if we already store this meter control and add it if we don't

Parameters
controlthe control object
piParamthe parameter object associated with the control

◆ checkAddWriteableControl() [2/2]

void VSTGUI::PluginGUI::checkAddWriteableControl ( PluginParameter piParam,
CControl *  control 
)
inline

check to see if we already store this meter control and add it if we don't

Parameters
controlthe control object
piParamthe parameter object associated with the control

◆ checkRemoveWriteableControl() [1/2]

void VSTGUI::PluginGUI::checkRemoveWriteableControl ( CControl *  control)
inline

check to see if we already store this meter control and remove it if we do

Parameters
controlthe control object

◆ checkRemoveWriteableControl() [2/2]

void VSTGUI::PluginGUI::checkRemoveWriteableControl ( CControl *  control)
inline

check to see if we already store this meter control and remove it if we do

Parameters
controlthe control object

◆ close() [1/2]

void PluginGUI::close ( )

prepares the GUI control objects for destruction, cleans up

destroy the GUI guts before frame is destoyed

Operation:

  • guiPluginConnector->guiWillClose() to notify the shell that the GUI is getting ready to shut down
  • clear control receiver list
  • stop the timer
  • null the frame pointer
  • final frame forget

◆ close() [2/2]

void VSTGUI::PluginGUI::close ( )

destroy the GUI guts before frame is destoyed

◆ controlBeginEdit() [1/2]

virtual void VSTGUI::PluginGUI::controlBeginEdit ( VSTGUI::CControl *  pControl)
overridevirtual

the user has started to change the GUI control

◆ controlBeginEdit() [2/2]

virtual void VSTGUI::PluginGUI::controlBeginEdit ( VSTGUI::CControl *  pControl)
overridevirtual

the user has started to change the GUI control

◆ controlEndEdit() [1/2]

virtual void VSTGUI::PluginGUI::controlEndEdit ( VSTGUI::CControl *  pControl)
overridevirtual

the user has finished changing the GUI control

◆ controlEndEdit() [2/2]

virtual void VSTGUI::PluginGUI::controlEndEdit ( VSTGUI::CControl *  pControl)
overridevirtual

the user has finished changing the GUI control

◆ controlModifierClicked() [1/2]

virtual int32_t VSTGUI::PluginGUI::controlModifierClicked ( VSTGUI::CControl *  pControl,
VSTGUI::CButtonState  button 
)
inlineoverridevirtual

return 1 if you want the control to not handle it, otherwise 0

unused override

◆ controlModifierClicked() [2/2]

virtual int32_t VSTGUI::PluginGUI::controlModifierClicked ( VSTGUI::CControl *  pControl,
VSTGUI::CButtonState  button 
)
inlineoverridevirtual

return 1 if you want the control to not handle it, otherwise 0

unused override

◆ controlTagDidChange() [1/2]

virtual void VSTGUI::PluginGUI::controlTagDidChange ( VSTGUI::CControl *  pControl)
overridevirtual

the GUI control's tag did change (end of creation)

◆ controlTagDidChange() [2/2]

virtual void VSTGUI::PluginGUI::controlTagDidChange ( VSTGUI::CControl *  pControl)
overridevirtual

the GUI control's tag did change (end of creation)

◆ controlTagWillChange() [1/2]

virtual void VSTGUI::PluginGUI::controlTagWillChange ( VSTGUI::CControl *  pControl)
overridevirtual

the GUI control's tag will change (start of creation)

◆ controlTagWillChange() [2/2]

virtual void VSTGUI::PluginGUI::controlTagWillChange ( VSTGUI::CControl *  pControl)
overridevirtual

the GUI control's tag will change (start of creation)

◆ createGUI() [1/2]

bool PluginGUI::createGUI ( bool  bShowGUIEditor)
protected

creates either the GUI or the GUI Designer

create the GUI, or the GUI Designer if user is launching it

Operation:

  • create the GUI Designer if the boolean flag is set
  • otherwise create the normal GUI
  • note that this is all handled with the description that we cahched in the constructor
  • for the GUI designer, we create a new UIEditController
  • for the normal GUI, we create a new View
Parameters
bShowGUIEditorcreate the drag-and-drop GUI designer
Returns
true if GUI is created, false if critical failure

◆ createGUI() [2/2]

bool VSTGUI::PluginGUI::createGUI ( bool  bShowGUIEditor)
protected

create the GUI, or the GUI Designer if user is launching it

◆ createSubController() [1/2]

IController* VSTGUI::PluginGUI::createSubController ( UTF8StringPtr  name,
const IUIDescription *  description 
)
override

create a custom sub-controller

◆ createSubController() [2/2]

IController* VSTGUI::PluginGUI::createSubController ( UTF8StringPtr  name,
const IUIDescription *  description 
)
override

create a custom sub-controller

◆ createUserCustomView() [1/2]

CView * PluginGUI::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.

first chance is for you to create and register a custom view

Operation:

  • decode the view name string
  • use the new operator to create an instance of your custom view here.
Parameters
viewnamecustomm view name string (as defined in XML file)
rectsize of control
listenerparent listener
tagthe control ID value

◆ createUserCustomView() [2/2]

CView* VSTGUI::PluginGUI::createUserCustomView ( std::string  viewname,
const CRect  rect,
IControlListener *  listener,
int32_t  tag 
)

first chance is for you to create and register a custom view

◆ createView() [1/2]

CView* VSTGUI::PluginGUI::createView ( const UIAttributes &  attributes,
const IUIDescription *  description 
)
override

create a custom view

◆ createView() [2/2]

CView* VSTGUI::PluginGUI::createView ( const UIAttributes &  attributes,
const IUIDescription *  description 
)
override

create a custom view

◆ deleteGUIControlList() [1/2]

void VSTGUI::PluginGUI::deleteGUIControlList ( )
inlineprotected

destroy the parameter list

◆ deleteGUIControlList() [2/2]

void VSTGUI::PluginGUI::deleteGUIControlList ( )
inlineprotected

destroy the parameter list

◆ dispatchAUControlChange()

void PluginGUI::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.

AU ONLY:au event dispatcher to GUI (see FX book)

Parameters
tagthe control ID
actualPluginValueparameter value in actual (plain) form
messagenot used
fromEventListenernot used

◆ getControl_WithMouseCoords() [1/2]

CControl * PluginGUI::getControl_WithMouseCoords ( const CPoint &  where)
protected

control finder, for AAX only, part of Pro Tools automation keyboard shortcut

get the control pointer value using current mouse location

Parameters
wheremouse coordinates
Returns
pointer to control under the mouse

◆ getControl_WithMouseCoords() [2/2]

CControl* VSTGUI::PluginGUI::getControl_WithMouseCoords ( const CPoint &  where)
protected

get the control pointer value using current mouse location

◆ getControlID_WithMouseCoords() [1/2]

int PluginGUI::getControlID_WithMouseCoords ( const CPoint &  where)
protected

control finder, for AAX only, part of Pro Tools automation keyboard shortcut

get the control ID value using current mouse location

Parameters
wheremouse coordinates
Returns
control ID value of control under the mouse pointer

◆ getControlID_WithMouseCoords() [2/2]

int VSTGUI::PluginGUI::getControlID_WithMouseCoords ( const CPoint &  where)
protected

get the control ID value using current mouse location

◆ getControlUpdateReceiver() [1/2]

ControlUpdateReceiver * PluginGUI::getControlUpdateReceiver ( int32_t  tag) const

find the receiver for a given tag; there can be only one receiver for any tag

  • get the receiver info
Parameters
tagthe control ID value
Returns
a const naked pointer to the receiver object

◆ getControlUpdateReceiver() [2/2]

ControlUpdateReceiver* VSTGUI::PluginGUI::getControlUpdateReceiver ( int32_t  tag) const
  • get the receiver info

◆ getGuiControlWithTag() [1/2]

PluginParameter* VSTGUI::PluginGUI::getGuiControlWithTag ( int  tag)
inlineprotected

find the local PluginParameter that is connected to the same control ID

Parameters
tagthe control ID
Returns
the connected PluginParameter* or nullptr if not found

◆ getGuiControlWithTag() [2/2]

PluginParameter* VSTGUI::PluginGUI::getGuiControlWithTag ( int  tag)
inlineprotected

find the local PluginParameter that is connected to the same control ID

Parameters
tagthe control ID
Returns
the connected PluginParameter* or nullptr if not found

◆ getGUIDesignerSize() [1/2]

std::string PluginGUI::getGUIDesignerSize ( )
protected

get size string

get size as string

Returns
GUI Designer size as a string for XML

◆ getGUIDesignerSize() [2/2]

std::string VSTGUI::PluginGUI::getGUIDesignerSize ( )
protected

get size as string

◆ getKnobMode() [1/2]

virtual int32_t VSTGUI::PluginGUI::getKnobMode ( ) const
overrideprotectedvirtual

get the current knob behavior (important - users are very aware of this)

◆ getKnobMode() [2/2]

virtual int32_t VSTGUI::PluginGUI::getKnobMode ( ) const
overrideprotectedvirtual

get the current knob behavior (important - users are very aware of this)

◆ getSize() [1/2]

void PluginGUI::getSize ( float &  width,
float &  height 
)

returns the size into the pass-by-reference variables

get current GUI size

Parameters
widthreturn value of width
heightreturn value of height

◆ getSize() [2/2]

void VSTGUI::PluginGUI::getSize ( float &  width,
float &  height 
)

get current GUI size

◆ hasICustomView() [1/4]

bool VSTGUI::PluginGUI::hasICustomView ( CView *  view)
inline

simple helper function to test view for ICustomView

Parameters
viewthe view to test
Returns
true if view exposes a custom view

◆ hasICustomView() [2/4]

bool VSTGUI::PluginGUI::hasICustomView ( CView *  view)
inline

simple helper function to test view for ICustomView

Parameters
viewthe view to test
Returns
true if view exposes a custom view

◆ hasICustomView() [3/4]

bool VSTGUI::PluginGUI::hasICustomView ( IController *  subController)
inline

simple helper function to test sub-controller for ICustomView

Parameters
viewthe view to test
Returns
true if view exposes a custom view

◆ hasICustomView() [4/4]

bool VSTGUI::PluginGUI::hasICustomView ( IController *  subController)
inline

simple helper function to test sub-controller for ICustomView

Parameters
viewthe view to test
Returns
true if view exposes a custom view

◆ hasWriteableControl() [1/2]

bool VSTGUI::PluginGUI::hasWriteableControl ( CControl *  control)
inline

check to see if we already store this meter control

Parameters
controlthe control object
Returns
true if we have control, false otherwise

◆ hasWriteableControl() [2/2]

bool VSTGUI::PluginGUI::hasWriteableControl ( CControl *  control)
inline

check to see if we already store this meter control

Parameters
controlthe control object
Returns
true if we have control, false otherwise

◆ idle() [1/2]

void PluginGUI::idle ( )
protectedvirtual

perform idling operation; called directly from timer thread

the udpate and repaint function

Operation:

  • send the timer ping message
  • send process loop output data to any output-only receivers (meters)
  • issue the repaint message to the outer frame

◆ idle() [2/2]

virtual void VSTGUI::PluginGUI::idle ( )
protectedvirtual

the udpate and repaint function

◆ notify() [1/2]

CMessageResult VSTGUI::PluginGUI::notify ( CBaseObject *  sender,
IdStringPtr  message 
)
override

VSTGUI4 message notification

◆ notify() [2/2]

CMessageResult VSTGUI::PluginGUI::notify ( CBaseObject *  sender,
IdStringPtr  message 
)
override

VSTGUI4 message notification

◆ onCommandMenuItemSelected() [1/2]

bool PluginGUI::onCommandMenuItemSelected ( CCommandMenuItem *  item)
virtual

message handler for GUI Designer menu

ICommandMenuItemTarget called when the item was selected

Operation:

  • decode menu item and set flags as needed
Parameters
itemthe menu item to decode
Returns
true if menu item command was exceuted, false otherwise

◆ onCommandMenuItemSelected() [2/2]

virtual bool VSTGUI::PluginGUI::onCommandMenuItemSelected ( CCommandMenuItem *  item)
virtual

ICommandMenuItemTarget called when the item was selected

◆ onKeyDown() [1/2]

int32_t VSTGUI::PluginGUI::onKeyDown ( const VstKeyCode &  code,
CFrame *  frame 
)
inlineoverride

IKeyboardHook key down handler, not used

◆ onKeyDown() [2/2]

int32_t VSTGUI::PluginGUI::onKeyDown ( const VstKeyCode &  code,
CFrame *  frame 
)
inlineoverride

IKeyboardHook key down handler, not used

◆ onKeyUp() [1/2]

int32_t VSTGUI::PluginGUI::onKeyUp ( const VstKeyCode &  code,
CFrame *  frame 
)
inlineoverride

IKeyboardHook key up handler, not used

◆ onKeyUp() [2/2]

int32_t VSTGUI::PluginGUI::onKeyUp ( const VstKeyCode &  code,
CFrame *  frame 
)
inlineoverride

IKeyboardHook key up handler, not used

◆ onMouseDown() [1/2]

CMouseEventResult VSTGUI::PluginGUI::onMouseDown ( CFrame *  frame,
const CPoint &  where,
const CButtonState &  buttons 
)
override

IMouseObserver mouse moved handler

◆ onMouseDown() [2/2]

CMouseEventResult VSTGUI::PluginGUI::onMouseDown ( CFrame *  frame,
const CPoint &  where,
const CButtonState &  buttons 
)
override

IMouseObserver mouse moved handler

◆ onMouseEntered() [1/2]

void VSTGUI::PluginGUI::onMouseEntered ( CView *  view,
CFrame *  frame 
)
inlineoverride

IMouseObserver override not used

◆ onMouseEntered() [2/2]

void VSTGUI::PluginGUI::onMouseEntered ( CView *  view,
CFrame *  frame 
)
inlineoverride

IMouseObserver override not used

◆ onMouseExited() [1/2]

void VSTGUI::PluginGUI::onMouseExited ( CView *  view,
CFrame *  frame 
)
inlineoverride

IMouseObserver override not used

◆ onMouseExited() [2/2]

void VSTGUI::PluginGUI::onMouseExited ( CView *  view,
CFrame *  frame 
)
inlineoverride

IMouseObserver override not used

◆ onMouseMoved() [1/2]

CMouseEventResult VSTGUI::PluginGUI::onMouseMoved ( CFrame *  frame,
const CPoint &  where,
const CButtonState &  buttons 
)
override

IMouseObserver mouse moved handler

◆ onMouseMoved() [2/2]

CMouseEventResult VSTGUI::PluginGUI::onMouseMoved ( CFrame *  frame,
const CPoint &  where,
const CButtonState &  buttons 
)
override

IMouseObserver mouse moved handler

◆ onViewAdded() [1/2]

void VSTGUI::PluginGUI::onViewAdded ( CFrame *  frame,
CView *  view 
)
inlineoverride

IViewAddedRemovedObserver view added: unused

◆ onViewAdded() [2/2]

void VSTGUI::PluginGUI::onViewAdded ( CFrame *  frame,
CView *  view 
)
inlineoverride

IViewAddedRemovedObserver view added: unused

◆ onViewRemoved() [1/2]

void VSTGUI::PluginGUI::onViewRemoved ( CFrame *  frame,
CView *  view 
)
override

IViewAddedRemovedObserver view removed

◆ onViewRemoved() [2/2]

void VSTGUI::PluginGUI::onViewRemoved ( CFrame *  frame,
CView *  view 
)
override

IViewAddedRemovedObserver view removed

◆ open() [1/2]

bool VSTGUI::PluginGUI::open ( UTF8StringPtr  _viewName,
void *  parent,
const std::vector< PluginParameter *> *  pluginParameterPtr,
const PlatformType &  platformType = kDefaultNative,
IGUIPluginConnector _guiPluginConnector = nullptr,
void *  data = nullptr 
)

create the GUI inside of a host-supplied window frame

◆ open() [2/2]

bool VSTGUI::PluginGUI::open ( UTF8StringPtr  _viewName,
void *  parent,
const std::vector< PluginParameter *> *  pluginParameterPtr,
const PlatformType &  platformType = kDefaultNative,
IGUIPluginConnector _guiPluginConnector = nullptr,
void *  data = nullptr 
)

create the GUI inside of a host-supplied window frame

◆ parseSize() [1/2]

static bool VSTGUI::PluginGUI::parseSize ( const std::string &  str,
CPoint &  point 
)
inlinestatic

simple helper function to get size from string

Parameters
strthe string
pointthe CPoint version of the string data

◆ parseSize() [2/2]

static bool VSTGUI::PluginGUI::parseSize ( const std::string &  str,
CPoint &  point 
)
inlinestatic

simple helper function to get size from string

Parameters
strthe string
pointthe CPoint version of the string data

◆ preCreateGUI() [1/2]

void PluginGUI::preCreateGUI ( )
protected

one-time pre-create init, currently used for AU only

do any API specific stuff that is required prior to the GUI creation

Operation:

  • AU: setup the event listener system (see FX book for details)

◆ preCreateGUI() [2/2]

void VSTGUI::PluginGUI::preCreateGUI ( )
protected

do any API specific stuff that is required prior to the GUI creation

◆ save() [1/2]

void VSTGUI::PluginGUI::save ( bool  saveAs = false)
protected

save the current state in XML

◆ save() [2/2]

void VSTGUI::PluginGUI::save ( bool  saveAs = false)
protected

save the current state in XML

◆ scaleGUISize() [1/2]

void PluginGUI::scaleGUISize ( uint32_t  controlValue)

scales the GUI; this is the handler for the special scaling GUI control

scale the GUI

Parameters
controlValuethe scaling value from the secret control

◆ scaleGUISize() [2/2]

void VSTGUI::PluginGUI::scaleGUISize ( uint32_t  controlValue)

scale the GUI

◆ sendAAXMouseDown() [1/2]

CMouseEventResult PluginGUI::sendAAXMouseDown ( int  controlID,
const CButtonState &  buttons 
)
protected

mouse down handler for Pro Tools keyboard shortcuts

Pro Tools: mouse down

Operation:

  • This handles several ProTools-specific mouse events
  • ctrl-alt-cmd: enable automation
  • alt: set control to default value (VSTGUI uses ctrl and this overrides it)
Parameters
controlIDID tag for control that will receive mouse down message
buttonsbutton state flags
Returns
handled or not handled

◆ sendAAXMouseDown() [2/2]

CMouseEventResult VSTGUI::PluginGUI::sendAAXMouseDown ( int  controlID,
const CButtonState &  buttons 
)
protected

Pro Tools: mouse down

◆ sendAAXMouseMoved() [1/2]

CMouseEventResult PluginGUI::sendAAXMouseMoved ( int  controlID,
const CButtonState &  buttons,
const CPoint &  where 
)
protected

mouse moved handler for Pro Tools keyboard shortcuts

Pro Tools: mouse moved

Operation:

  • This handles ProTools mouse move event for automation
Parameters
controlIDID tag for control that will receive mouse move message
buttonsbutton state flags
wherethe mouse coordinates
Returns
handled or not handled

◆ sendAAXMouseMoved() [2/2]

CMouseEventResult VSTGUI::PluginGUI::sendAAXMouseMoved ( int  controlID,
const CButtonState &  buttons,
const CPoint &  where 
)
protected

Pro Tools: mouse moved

◆ sendAUMouseDown() [1/2]

CMouseEventResult PluginGUI::sendAUMouseDown ( CControl *  control,
const CButtonState &  buttons 
)
protected

mouse down handler for AU automation

AU: mouse down

Operation:

  • This handles AU mouse events
  • option: go to default value
Parameters
controlcontrol that receives message
buttonsbutton state flags
Returns
handled or not handled

◆ sendAUMouseDown() [2/2]

CMouseEventResult VSTGUI::PluginGUI::sendAUMouseDown ( CControl *  control,
const CButtonState &  buttons 
)
protected

AU: mouse down

◆ sendAUMouseMoved() [1/2]

CMouseEventResult VSTGUI::PluginGUI::sendAUMouseMoved ( CControl *  control,
const CButtonState &  buttons,
const CPoint &  where 
)
inlineprotected

AU: mouse moved (not used)

◆ sendAUMouseMoved() [2/2]

CMouseEventResult VSTGUI::PluginGUI::sendAUMouseMoved ( CControl *  control,
const CButtonState &  buttons,
const CPoint &  where 
)
inlineprotected

AU: mouse moved (not used)

◆ setAAXParameterFromGUIControl()

void PluginGUI::setAAXParameterFromGUIControl ( CControl *  control,
int  tag,
float  actualValue,
float  normalizedValue 
)

set the plugin shelll parameter from GUI control using thread-safe mechanism

AAX ONLY: thread-safe parameter set for AAX

Parameters
controlthe GUI control issuing the change
tagthe control ID
actualValueparameter value in actual (plain) form
normalizedValueparameter value in normalized form

◆ setAAXViewContainer()

void VSTGUI::PluginGUI::setAAXViewContainer ( AAX_IViewContainer *  _aaxViewContainer)
inline

AAX ONLY: plugin shell GUI object sets this after creation.

Parameters
_aaxViewContainerthe AAX_IViewContainer* that the parent object exposes

◆ setAU()

void VSTGUI::PluginGUI::setAU ( AudioUnit  inAU)
inline

AU ONLY: store the parent AU reference; part of AU event lisener system

Parameters
inAUreference to the AU plugin (can not be used to call functions)

◆ setAUEventFromGUIControl()

void PluginGUI::setAUEventFromGUIControl ( CControl *  control,
int  tag,
float  actualValue 
)
protected

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.

AU ONLY: GUI to au event listener (see FX book)

Parameters
controlthe control issuing the change
tagthe control ID
actualValueactual control value (AU is always actual value)

◆ setGUIWindowFrame() [1/2]

virtual void VSTGUI::PluginGUI::setGUIWindowFrame ( IGUIWindowFrame frame)
inlineoverridevirtual

set the interface pointer for resizing from the GUI

  • this must happen AFTER the open( ) function creates the frame
Parameters
framethe interface pointer

Implements IGUIView.

◆ setGUIWindowFrame() [2/2]

virtual void VSTGUI::PluginGUI::setGUIWindowFrame ( IGUIWindowFrame frame)
inlineoverridevirtual

set the interface pointer for resizing from the GUI

  • this must happen AFTER the open( ) function creates the frame
Parameters
framethe interface pointer

Implements IGUIView.

◆ setPluginParameterFromGUIControl() [1/2]

void VSTGUI::PluginGUI::setPluginParameterFromGUIControl ( CControl *  control,
int  tag,
float  actualValue,
float  normalizedValue 
)
inlineprotected

safely set a plugin shell parameter with a GUI control

NOTE:

  • uses the API-specific and approved thread-safe mechanism to set a plugin parameter
Parameters
controlpointer to the control that generated the notification
tagthe control ID
actualValuethe actual (aka plain) parameter value
normalizedValuethe normalied version of the parameter value

◆ setPluginParameterFromGUIControl() [2/2]

void VSTGUI::PluginGUI::setPluginParameterFromGUIControl ( CControl *  control,
int  tag,
float  actualValue,
float  normalizedValue 
)
inlineprotected

safely set a plugin shell parameter with a GUI control

NOTE:

  • uses the API-specific and approved thread-safe mechanism to set a plugin parameter
Parameters
controlpointer to the control that generated the notification
tagthe control ID
actualValuethe actual (aka plain) parameter value
normalizedValuethe normalied version of the parameter value

◆ setRAFXParameterFromGUIControl()

void PluginGUI::setRAFXParameterFromGUIControl ( CControl *  control,
int  tag,
float  actualValue,
float  normalizedValue 
)
protected

set the RAFX2 parameter from the GUI control

RAFX2 ONLY: GUI to RAFX2 shell (see FX book)

Parameters
controlthe control issuing the change
tagthe control ID
actualValueactual control value
normalizedValuenormalized control value

◆ setVSTParameterFromGUIControl()

void PluginGUI::setVSTParameterFromGUIControl ( CControl *  control,
int  tag,
float  actualValue,
float  normalizedValue 
)
protected

set the VST parameter from the GUI control

VST3 ONLY: GUI to VST3 shell (see FX book)

Parameters
controlthe control issuing the change
tagthe control ID
actualValueactual control value
normalizedValuenormalized control value

◆ syncGUIControl() [1/2]

void PluginGUI::syncGUIControl ( uint32_t  controlID)

safely sets the GUI control value based on the plugin parameter value

sync GUI control to current plugin value, thread-safe

Notes:

  • called when the control is created ( see ...TagDidChange() )
  • in the case of ui-view-switch views, this will be called NOT at startup, unless it is view 0 in the stack
  • uses the API-approved thread-safe mechanism for providing sync
Parameters
controlIDthe ID value of the control to sync

◆ syncGUIControl() [2/2]

void VSTGUI::PluginGUI::syncGUIControl ( uint32_t  controlID)

sync GUI control to current plugin value, thread-safe

◆ updateGUIControlAAX()

void PluginGUI::updateGUIControlAAX ( int  tag,
float  actualPluginValue,
float  normalizedValue = 0.f,
bool  useNormalized = false 
)

set the GUI control from the plugin shell GUI object (thread-safe)

AAX ONLY: update GUI control for AAX

Parameters
tagthe control ID
actualPluginValueparameter value in actual (plain) form
normalizedValueparameter value in normalized form
useNormalizedforce normalized value

◆ updateGUIControlRAFX()

void PluginGUI::updateGUIControlRAFX ( int  tag,
float  normalizedValue 
)
protected

set the GUI control from the RAFX2 parameter

RAFX2 ONLY: RAXF2 shell to GUI (see FX book)

Parameters
tagthe control ID
normalizedValuenormalized control value

◆ updateGUIControlVST()

void PluginGUI::updateGUIControlVST ( int  tag,
float  normalizedValue 
)
protected

set the GUI control from the VST parameter

VST3 ONLY: VST3 shell to GUI (see FX book)

Parameters
tagthe control ID
normalizedValuenormalized control value

◆ validateCommandMenuItem() [1/2]

bool PluginGUI::validateCommandMenuItem ( CCommandMenuItem *  item)
virtual

validates menu item selections to prevent crashing

ICommandMenuItemTarget called before the item is shown to validate its state

Operation:

  • test menu item; application specific
Parameters
itemthe menu item to test
Returns
true if item is valid, false otherwise

◆ validateCommandMenuItem() [2/2]

virtual bool VSTGUI::PluginGUI::validateCommandMenuItem ( CCommandMenuItem *  item)
virtual

ICommandMenuItemTarget called before the item is shown to validate its state

◆ valueChanged() [1/2]

virtual void VSTGUI::PluginGUI::valueChanged ( VSTGUI::CControl *  pControl)
overridevirtual

IControlListener:: required override

◆ valueChanged() [2/2]

virtual void VSTGUI::PluginGUI::valueChanged ( VSTGUI::CControl *  pControl)
overridevirtual

IControlListener:: required override

◆ writeToPresetFile() [1/2]

void PluginGUI::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.

for preset saving helper which writes preset code for you

◆ writeToPresetFile() [2/2]

void VSTGUI::PluginGUI::writeToPresetFile ( )

for preset saving helper which writes preset code for you


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