ASPiK SDK
Loading...
Searching...
No Matches
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 Steinberg::Vst::ASPiK::PluginEditor

Public Member Functions

 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.
 
virtual ~PluginGUI ()
 PluginGUI destructor.
 
bool open (UTF8StringPtr _viewName, void *parent, const std::vector< PluginParameter * > *pluginParameterPtr, const PlatformType &platformType=PlatformType::kDefaultNative, IGUIPluginConnector *_guiPluginConnector=nullptr, void *data=nullptr)
 creates the GUI control objects, creates outer frame, inserts contents into window
 
void close ()
 prepares the GUI control objects for destruction, cleans up
 
void syncGUIControl (uint32_t controlID)
 safely sets the GUI control value based on the plugin parameter value
 
void getSize (float &width, float &height)
 returns the size into the pass-by-reference variables
 
void scaleGUISize (uint32_t controlValue)
 scales the GUI; this is the handler for the special scaling GUI control
 
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.
 
void clearGUIPluginConnector ()
 
void setAAXViewContainer (AAX_IViewContainer *_aaxViewContainer)
 AAX ONLY: plugin shell GUI object sets this after creation.
 
void setAAXParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the plugin shelll parameter from GUI control using thread-safe mechanism
 
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)
 
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.
 
void setAU (AudioUnit inAU)
 
CMessageResult notify (CBaseObject *sender, IdStringPtr message) override
 incoming VSTGUI4 message handler
 
virtual void valueChanged (VSTGUI::CControl *pControl) override
 THE function that all controls pour their control changes into. The result of this function is to push the GUI control change safely into the plugin shell owner.
 
virtual int32_t controlModifierClicked (VSTGUI::CControl *pControl, VSTGUI::CButtonState button) override
 return 1 if you want the control to not handle it, otherwise 0
 
virtual void controlBeginEdit (VSTGUI::CControl *pControl) override
 start of control/auomation notification
 
virtual void controlEndEdit (VSTGUI::CControl *pControl) override
 end of control/auomation notification
 
virtual void controlTagWillChange (VSTGUI::CControl *pControl) override
 called when a control is being removed from the GUI, or when it is being created (step 1)
 
virtual void controlTagDidChange (VSTGUI::CControl *pControl) override
 called when a control is being created on the GUI (step 2)
 
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.
 
CView * createView (const UIAttributes &attributes, const IUIDescription *description) override
 this is called for every view obeject in the XML file that will be visible to check and see if you want to supply your own object, that you create with the new operator; that object takes the place of the stock GUI object, allowing you to customize the view behavior. This is called the "Custom View" paradigm and along with the sub-controller make VSTGUI4 extremely powerful.
 
IController * createSubController (UTF8StringPtr name, const IUIDescription *description) override
 for advanced users: you can create and even register sub-controllers here
 
ControlUpdateReceivergetControlUpdateReceiver (int32_t tag) const
 find the receiver for a given tag; there can be only one receiver for any tag
 
void onViewAdded (CFrame *frame, CView *view) override
 
void onViewRemoved (CFrame *frame, CView *view) override
 called before GUI control is removed from the view
 
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
 message handler for mouse down event
 
CMouseEventResult onMouseMoved (CFrame *frame, const CPoint &where, const CButtonState &buttons) override
 message handler for mouse move event
 
virtual bool validateCommandMenuItem (CCommandMenuItem *item) override
 validates menu item selections to prevent crashing
 
virtual bool onCommandMenuItemSelected (CCommandMenuItem *item) override
 message handler for GUI Designer menu
 
virtual void setGUIWindowFrame (IGUIWindowFrame *frame) override
 set the interface pointer for resizing from the GUI
 
bool hasWriteableControl (CControl *control)
 check to see if we already store this meter control
 
void checkAddWriteableControl (PluginParameter *piParam, CControl *control)
 check to see if we already store this meter control and add it if we don't
 
void checkRemoveWriteableControl (CControl *control)
 check to see if we already store this meter control and remove it if we do
 
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
 
bool hasICustomView (IController *subController)
 simple helper function to test sub-controller for ICustomView
 
virtual void setGUIWindowFrame (IGUIWindowFrame *frame)=0
 

Static Public Member Functions

static void initVSTGUILib (void *hInstance)
 VSTGUI4 Library Initializer for AAX/Windows only.
 
static void exitVSTGUILib ()
 
static bool parseSize (const std::string &str, CPoint &point)
 simple helper function to get size from string
 

Protected Member Functions

virtual void idle ()
 perform idling operation; called directly from timer thread
 
void preCreateGUI ()
 one-time pre-create init, currently used for AU only
 
bool createGUI (bool bShowGUIEditor)
 creates either the GUI or the GUI Designer
 
void save (bool saveAs=false)
 save GUI state in XML file
 
virtual int32_t getKnobMode () const override
 returns mode
 
void deleteGUIControlList ()
 
PluginParametergetGuiControlWithTag (int tag)
 find the local PluginParameter that is connected to the same control ID
 
std::string getGUIDesignerSize ()
 get size string
 
int getControlID_WithMouseCoords (const CPoint &where)
 control finder, for AAX only, part of Pro Tools automation keyboard shortcut
 
CControl * getControl_WithMouseCoords (const CPoint &where)
 control finder, for AAX only, part of Pro Tools automation keyboard shortcut
 
CMouseEventResult sendAAXMouseDown (int controlID, const CButtonState &buttons)
 mouse down handler for Pro Tools keyboard shortcuts
 
CMouseEventResult sendAAXMouseMoved (int controlID, const CButtonState &buttons, const CPoint &where)
 mouse moved handler for Pro Tools keyboard shortcuts
 
CMouseEventResult sendAUMouseDown (CControl *control, const CButtonState &buttons)
 mouse down handler for AU automation
 
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
 
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.
 
void setVSTParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the VST parameter from the GUI control
 
void updateGUIControlVST (int tag, float normalizedValue)
 set the GUI control from the VST parameter
 
void setRAFXParameterFromGUIControl (CControl *control, int tag, float actualValue, float normalizedValue)
 set the RAFX2 parameter from the GUI control
 
void updateGUIControlRAFX (int tag, float normalizedValue)
 set the GUI control from the RAFX2 parameter
 

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()

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()

PluginGUI::~PluginGUI ( )
virtual

PluginGUI destructor.

destruction

Operation:

  • destroys UIDescription
  • destroys timer

Member Function Documentation

◆ checkAddWriteableControl()

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()

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

◆ clearGUIPluginConnector()

void VSTGUI::PluginGUI::clearGUIPluginConnector ( )
inline

clear the interface prior to shutdown; AU only

◆ close()

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

◆ controlBeginEdit()

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

start of control/auomation notification

the user has started to change the GUI control

NOTE:

  • this function implementation is different for each API
  • the begin-autamation commmand is issued to the varisou APIs that require it
Parameters
pControlcontrol that has started the edit

◆ controlEndEdit()

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

end of control/auomation notification

the user has finished changing the GUI control

NOTE:

  • this function implementation is different for each API
  • the end-autamation commmand is issued to the varisou APIs that require it
Parameters
pControlcontrol that has started the edit

◆ controlModifierClicked()

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()

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

called when a control is being created on the GUI (step 2)

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

NOTE:

  • add the control to our receiver list
  • deal with XY pads that have two parameters
Parameters
pControlcontrol whose tag has changed

◆ controlTagWillChange()

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

called when a control is being removed from the GUI, or when it is being created (step 1)

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

NOTE:

  • remove the control from receiver list
  • check and remove from writeable (meter) controls
Parameters
pControlcontrol whose tag will change

◆ createGUI()

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

◆ createSubController()

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

for advanced users: you can create and even register sub-controllers here

create a custom sub-controller

Operation:

  • the example here is for a set of knobs that are linked together
  • see www.willpirkle.com for more information
Parameters
namesub-controller name string as defined in the XML file
descriptionUIDescription of object
Returns
an IController* to sub-controller (all sub-controllers must expose this interface)

◆ createUserCustomView()

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

◆ createView()

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

this is called for every view obeject in the XML file that will be visible to check and see if you want to supply your own object, that you create with the new operator; that object takes the place of the stock GUI object, allowing you to customize the view behavior. This is called the "Custom View" paradigm and along with the sub-controller make VSTGUI4 extremely powerful.

create a custom view

Operation:

  • decode the view name string
  • use the new operator to create an instance of the custom view
  • the views here are all built-in to ASPiK plugins!
Parameters
viewnamecustomm view name string (as defined in XML file)
rectsize of control
listenerparent listener
tagthe control ID value

◆ deleteGUIControlList()

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

◆ exitVSTGUILib()

void PluginGUI::exitVSTGUILib ( )
static

Exit VSTGUI Lib (new in VSTGUI4.10) AAX/Windows only

◆ getControl_WithMouseCoords()

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

◆ getControlID_WithMouseCoords()

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

◆ getControlUpdateReceiver()

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

◆ getGuiControlWithTag()

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()

std::string PluginGUI::getGUIDesignerSize ( )
protected

get size string

get size as string

Returns
GUI Designer size as a string for XML

◆ getKnobMode()

int32_t PluginGUI::getKnobMode ( ) const
overrideprotectedvirtual

returns mode

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

Modes:

  • kLinearMode: mouse moves vertically
  • kRelativCircularMode: mouse moves in circle relative to control, as long as in control rect
  • kCircularMode: mouse traces circular outline of knob
Returns
the knob mode

◆ getSize()

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

◆ hasICustomView() [1/2]

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/2]

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()

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()

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

◆ initVSTGUILib()

void PluginGUI::initVSTGUILib ( void *  hInstance)
static

VSTGUI4 Library Initializer for AAX/Windows only.

Init VSTGUI Lib (new in VSTGUI4.10) AAX/Windows only

Operation:

  • see VSTGUI4 library docs
  • note that this varies between AAX, AU and VST for Mac and Windows
Parameters
hInstancethe HINSTANCE of the DLL

◆ notify()

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

incoming VSTGUI4 message handler

VSTGUI4 message notification

Parameters
senderpointer to sending object
messagemessage as a string
Returns
notified or not

◆ onCommandMenuItemSelected()

bool PluginGUI::onCommandMenuItemSelected ( CCommandMenuItem *  item)
overridevirtual

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

◆ onMouseDown()

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

message handler for mouse down event

IMouseObserver mouse moved handler

Operation:

  • for right mouse button, open the "Edit UI Description" menu item
  • for AU and AAX, call their handlers for all other messages
Parameters
frameowning frame
wherecurrent location of mouse coordinates
buttonsbutton state
Returns
handled or not handled

◆ onMouseEntered()

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

IMouseObserver override not used

◆ onMouseExited()

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

IMouseObserver override not used

◆ onMouseMoved()

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

message handler for mouse move event

IMouseObserver mouse moved handler

Operation:

  • for AU and AAX, call their specialized handlers
Parameters
frameowning frame
wherecurrent location of mouse coordinates
buttonsbutton state
Returns
handled or not handled

◆ onViewAdded()

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

IViewAddedRemovedObserver view added: unused

◆ onViewRemoved()

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

called before GUI control is removed from the view

IViewAddedRemovedObserver view removed

Operation:

  • de-register custom views
  • remove control from our lists
Parameters
frameowner frame
viewpointer to view being removed

◆ open()

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

creates the GUI control objects, creates outer frame, inserts contents into window

create the GUI inside of a host-supplied window frame

Operation:

  • make a copy of the parameter control list for local use
  • pick up key attribute values from XML file
  • create the frame
  • create and embed the controls
  • initialize controls to match current state of underlying parameters
  • start the timer
Parameters
_viewNamename for window title
parentthe window pointer: for Windows it is HWND and for MacOS it is NSView*
pluginParameterPtra list of the plugin parameters; this object makes a COPY of that information and does NOT hold a pointer to it
platformTypethe window type (Windows or MacOS)
_guiPluginConnectoran interface pointer on the plugin shell that creates, maintains, and destroys this object
dataoptional OS-specific data (for AU it is the AU reference, etc...)

◆ parseSize()

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()

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)

◆ save()

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

save GUI state in XML file

save the current state in XML

Operation:

  • shows the platform dependent File Save dialog box
  • stores the current XML data in the user's .uidesc file
  • NOTE: first time through the user ALWAYS must supply the path to the .uidesc file via Save As
Parameters
saveAsshow the save-as dialog box

◆ scaleGUISize()

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

◆ sendAAXMouseDown()

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

◆ sendAAXMouseMoved()

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

◆ sendAUMouseDown()

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

◆ sendAUMouseMoved()

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()

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()

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()

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

◆ 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()

bool PluginGUI::validateCommandMenuItem ( CCommandMenuItem *  item)
overridevirtual

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

◆ valueChanged()

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

THE function that all controls pour their control changes into. The result of this function is to push the GUI control change safely into the plugin shell owner.

IControlListener:: required override

Operation:

  • check control for a built-in feature: GUI scaling or Preset File writing
  • check xy-pad as these are double-parameter objects
  • find the control reciever: update all connected controls (controls with same ID tag)
  • issue the control change message to the shell (threa-safe and API-specific)
Parameters
pControlcontrol that issues change notification

◆ writeToPresetFile()

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


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