ASPiK SDK
Loading...
Searching...
No Matches
VSTGUI::ControlUpdateReceiver Class Reference

The ControlUpdateReceiver object is the connection mechanism between PluginParameter objects and their connected GUI control objects. It was originally designed almost identically to the example code in the VSTGUI4 SDK for the VST3 version. However, once the AU, AAX, VST3 and RAFX2 APIs were consolidated, this object changed significantly. If you are interested in creating your own version, check out the VST3 files that are included with the vstgui SDK. More...

#include <plugingui.h>

Public Member Functions

 ControlUpdateReceiver (CControl *control, PluginParameter *pluginParameterPtr, bool _isControlListener)
 
 ~ControlUpdateReceiver ()
 
bool hasControl (CControl *control)
 
void addControl (CControl *control)
 
void removeControl (CControl *control)
 
bool controlInRxGroupIsEditing ()
 
float getActualValueWithNormalizedValue (float normalizedValue)
 
float getNormalizedValueWithActualValue (float actualValue)
 
void updateControlsWithControl (CControl *control)
 
void updateControlsWithNormalizedValue (float normalizedValue, CControl *control=nullptr)
 
void initControl (CControl *control)
 
void updateControlsWithActualValue (float actualValue, CControl *control=nullptr)
 
const PluginParameter getGuiControl ()
 
int32_t getControlID ()
 
bool controlAndContainerVisible (CControl *ctrl)
 
int getControlID_WithMouseCoords (const CPoint &where)
 
CControl * getControl_WithMouseCoords (const CPoint &where)
 

Protected Attributes

PluginParameter refGuiControl
 single parameter with this control tag
 
std::vector< CControl * > guiControls
 list of controls that share the control tag with this one
 
bool hasRefGuiControl = false
 internal flag
 
bool isControlListener = false
 internal flag
 

Detailed Description

The ControlUpdateReceiver object is the connection mechanism between PluginParameter objects and their connected GUI control objects. It was originally designed almost identically to the example code in the VSTGUI4 SDK for the VST3 version. However, once the AU, AAX, VST3 and RAFX2 APIs were consolidated, this object changed significantly. If you are interested in creating your own version, check out the VST3 files that are included with the vstgui SDK.

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

◆ ControlUpdateReceiver()

VSTGUI::ControlUpdateReceiver::ControlUpdateReceiver ( CControl *  control,
PluginParameter pluginParameterPtr,
bool  _isControlListener 
)
inline

constructs a receiver object with the control and parameter pointers

◆ ~ControlUpdateReceiver()

VSTGUI::ControlUpdateReceiver::~ControlUpdateReceiver ( )
inline

forgets the stored control pointers so that they self-destruct properly

Member Function Documentation

◆ addControl()

void VSTGUI::ControlUpdateReceiver::addControl ( CControl *  control)
inline

add a control to our list of GUI controls

Parameters
controlpointer to control to add

◆ controlAndContainerVisible()

bool VSTGUI::ControlUpdateReceiver::controlAndContainerVisible ( CControl *  ctrl)
inline

test to see if control and its container are both visible, for AAX only as part of the modifier buttons exclusive to Pro Tools

Returns
true if control and container are visible

◆ controlInRxGroupIsEditing()

bool VSTGUI::ControlUpdateReceiver::controlInRxGroupIsEditing ( )
inline

check to see if a control is currently editing; this is part of the system that prevents a control from receiving multiple edit commands from our loop

Returns
true if the control is editing (being adjusted by the user - does not include automation)

◆ getActualValueWithNormalizedValue()

float VSTGUI::ControlUpdateReceiver::getActualValueWithNormalizedValue ( float  normalizedValue)
inline

get actual parameter value using a normalized version

Parameters
normalizedValueinput value
Returns
the actual value calculated from the normalized version

◆ getControl_WithMouseCoords()

CControl * VSTGUI::ControlUpdateReceiver::getControl_WithMouseCoords ( const CPoint &  where)
inline

get a pointer to a control based on its mouse coordinates, for AAX only as part of the modifier buttons exclusive to Pro Tools

Parameters
wherethe mouse coordinates
Returns
a pointer of the located control, or nullptr if not located

◆ getControlID()

int32_t VSTGUI::ControlUpdateReceiver::getControlID ( )
inline

get the control ID of the underlying parameter

Returns
underlying control ID

◆ getControlID_WithMouseCoords()

int VSTGUI::ControlUpdateReceiver::getControlID_WithMouseCoords ( const CPoint &  where)
inline

get the ID of a control based on its mouse coordinates, for AAX only as part of the modifier buttons exclusive to Pro Tools

Parameters
wherethe mouse coordinates
Returns
the control ID of the located control, or -1 if not located

◆ getGuiControl()

const PluginParameter VSTGUI::ControlUpdateReceiver::getGuiControl ( )
inline

get a PluginParameter that corresponds to a GUI control NOTE: this is a constant reference that is unmutable

Returns
underlying const PluginParameter

◆ getNormalizedValueWithActualValue()

float VSTGUI::ControlUpdateReceiver::getNormalizedValueWithActualValue ( float  actualValue)
inline

get normalized parameter value using an actual version

Parameters
actualValueinput value
Returns
the nromalized value calculated from the actual version

◆ hasControl()

bool VSTGUI::ControlUpdateReceiver::hasControl ( CControl *  control)
inline

check to see if a control exists in our list of GUI controls

Parameters
controlpointer to control to check
Returns
true if we already store it, false otherwise

◆ initControl()

void VSTGUI::ControlUpdateReceiver::initControl ( CControl *  control)
inline

initialize the control with the current plugin value (initialization routine)

Parameters
controlinput control

◆ removeControl()

void VSTGUI::ControlUpdateReceiver::removeControl ( CControl *  control)
inline

remove a contro from our list of GUI controls

Parameters
controlpointer to control to check

◆ updateControlsWithActualValue()

void VSTGUI::ControlUpdateReceiver::updateControlsWithActualValue ( float  actualValue,
CControl *  control = nullptr 
)
inline

update the control with an acutal value (e.g. from automation)

Parameters
actualValueinput value
controlinput control

ignore meters; this is handled in idle() for consistency

◆ updateControlsWithControl()

void VSTGUI::ControlUpdateReceiver::updateControlsWithControl ( CControl *  control)
inline

update all controls that share a commmon tag (control ID) with the input control

Parameters
controlinput control

◆ updateControlsWithNormalizedValue()

void VSTGUI::ControlUpdateReceiver::updateControlsWithNormalizedValue ( float  normalizedValue,
CControl *  control = nullptr 
)
inline

update all controls that share a commmon tag (control ID) with the input value

Parameters
normalizedValuenormalized input value
controlinput control

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