This object demonstrates how to create a sub-controller. In this object, you can link multiple knob controls together so that moving one control moves all of them. There is an associated button used to enable/disable the linking operation.
More...
#include <customviews.h>
|
typedef std::vector< CAnimKnob * > | KnobList |
| list of knobs
|
|
|
IController * | parentController = nullptr |
| pointer to owning listener
|
|
CTextButton * | linkControl = nullptr |
| the link button is defined as a CTextButton (by me)
|
|
KnobList | linkedKnobs |
|
bool | linkControls = false |
| enable linking
|
|
This object demonstrates how to create a sub-controller. In this object, you can link multiple knob controls together so that moving one control moves all of them. There is an associated button used to enable/disable the linking operation.
- Subcontroller that links some number of CAnimKnobs so that when linked turning one knobs turns all of the rest of the linked knobs regardless of their control tags
- use the sub-controller string "KnobLinkController" for the view view container that holds the knobs to link; there can only be one KnobLinkController for each view container
- To hard-wire the linkage, set the flag in the constructor
- To make linkage variable, a CTextButton must be used as the switcher; you can easily change that by changing the code involving the linkControl variable
- the verifyView( ) function gets called once per child view of the outer continer; this is where we save the linker control (button) and push the CAnimKnob controls onto our vector
- the valueChanged( ) function gets called when any of the view containers sub controls are moved; we only stash and control the CAnimKnobs so you can mix other controls in the same view container that won't be affected
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2018 / 09 / 7
◆ KnobLinkController()
VSTGUI::KnobLinkController::KnobLinkController |
( |
IController * |
_parentController | ) |
|
|
inline |
KnobLinkController constructor
- Parameters
-
_parentController | - pointer to the parent controller so we can forward messages to it |
◆ controlBeginEdit()
virtual void VSTGUI::KnobLinkController::controlBeginEdit |
( |
CControl * |
pControl | ) |
|
|
inlineoverridevirtual |
called when the user begins to edit a control (mouse click) - we simply forward the call to the parent listener
- Parameters
-
◆ controlEndEdit()
virtual void VSTGUI::KnobLinkController::controlEndEdit |
( |
CControl * |
pControl | ) |
|
|
inlineoverridevirtual |
called when the user ends editing a control (mouse released) - we simply forward the call to the parent listener
- Parameters
-
◆ controlTagDidChange()
virtual void VSTGUI::KnobLinkController::controlTagDidChange |
( |
CControl * |
pControl | ) |
|
|
inlineoverridevirtual |
register the control update receiver objects that allow us to ultimately bind GUI controls to plugin variables (thread-safe of course)
- Parameters
-
◆ controlTagWillChange()
virtual void VSTGUI::KnobLinkController::controlTagWillChange |
( |
CControl * |
pControl | ) |
|
|
inlineoverridevirtual |
register the control update receiver objects that allow us to ultimately bind GUI controls to plugin variables (thread-safe of course)
- Parameters
-
◆ createView()
virtual CView * VSTGUI::KnobLinkController::createView |
( |
const UIAttributes & |
attributes, |
|
|
const IUIDescription * |
description |
|
) |
| |
|
inlineoverridevirtual |
called once per child view of the container - we simply forward the call to the parent listener
- Parameters
-
attributes | - UIAttributes of control |
IUIDescription | - IUIDescription of control |
- Returns
- the verified view
◆ isLinkedControl()
bool VSTGUI::KnobLinkController::isLinkedControl |
( |
CControl * |
control | ) |
|
|
inline |
test to see if control is in the list of linked controls
- Parameters
-
- Returns
- true if control is in list, false otherwise
◆ valueChanged()
virtual void VSTGUI::KnobLinkController::valueChanged |
( |
CControl * |
control | ) |
|
|
inlineoverridevirtual |
called when any control in the view container changes; we only care about the link button and the knobs, we ignore the others view objects that we want to link
- Parameters
-
control | - the control whose value changed |
◆ verifyView()
virtual CView * VSTGUI::KnobLinkController::verifyView |
( |
CView * |
view, |
|
|
const UIAttributes & |
attributes, |
|
|
const IUIDescription * |
description |
|
) |
| |
|
inlineoverridevirtual |
called once per child view of the container that owns the sub-controller this is where we grab and store the view objects that we want to link
- Parameters
-
view | - the newly created view to use |
attributes | - UIAttributes of control |
IUIDescription | - IUIDescription of control |
- Returns
- the verified view
The documentation for this class was generated from the following file:
- C:/RackAFX_v7/ASPIK_Doxygen/PluginTemplate/project_source/source/CustomControls/customviews.h