|
iPlug2 - C++ Audio Plug-in Framework
|
Builds an IGraphics user interface from the UI description of an IPlugFaust DSP, like Faust's own generic GUIs. More...
#include <IGraphicsFaustUI.h>
Classes | |
| class | BoxControl |
| class | ButtonControl |
| A momentary button, for Faust's button() More... | |
| class | ValueDisplayControl |
| Displays a bargraph's value as text, for [style:numerical]. More... | |
Public Types | |
| using | Item = FaustUIItem |
| using | EType = FaustUIItem::EType |
| using | CreateControlFunc = std::function< IControl *(const Item &item, int paramIdx, const IVStyle &style)> |
| Creates the control for a widget. More... | |
| using | ControlBoundsFunc = std::function< IRECT(const Item &item, const IRECT &cell)> |
| Returns the bounds of a widget's control, given the cell that the layout allocated for it. More... | |
Public Member Functions | |
| IGraphicsFaustUI (IPlugFaust &faust, const IVStyle &style=DEFAULT_STYLE) | |
| IControl * | CreateControl (const IRECT &bounds) |
| Create a control containing the whole Faust UI. More... | |
| void | SetCreateControlFunc (EType type, CreateControlFunc func) |
| Replace the function that creates the controls for a widget type. More... | |
| void | SetControlBoundsFunc (ControlBoundsFunc func) |
| Replace the function that sizes the controls within their layout cells. More... | |
| void | SetPadding (float padding) |
| Set the padding between controls and around boxes. More... | |
| void | SetTabBarHeight (float height) |
| Set the height of the tab bar for tab boxes. More... | |
Static Public Member Functions | |
| static IControl * | DefaultCreateControl (const Item &item, int paramIdx, const IVStyle &style) |
| The default control for each widget type. More... | |
| static IRECT | DefaultControlBounds (const Item &item, const IRECT &cell) |
| Default control sizing: stops controls from stretching too much in large cells. More... | |
Builds an IGraphics user interface from the UI description of an IPlugFaust DSP, like Faust's own generic GUIs.
Faust boxes become panels (hgroup/vgroup) or tabbed pages (tgroup), widgets become IVControls linked to the IPlug parameters created by IPlugFaust::CreateIPlugParameters() and bargraphs become meters/LEDs/value displays updated via their control tags. Widget metadata such as [style:knob], [style:menu{...}], [style:radio{...}], [style:led], [style:numerical], [unit:dB], [tooltip:...] and [hidden:1] is respected.
Basic usage, in the plug-in's layout function:
The control keeps a copy of the UI description, so the IGraphicsFaustUI object doesn't need to outlive it. If the DSP is recompiled (see FaustGen::SetOnCompileFunc), remove the control and create a new one. The functions used to create the controls for each widget type and to size them can be replaced to customise the UI.
Definition at line 45 of file IGraphicsFaustUI.h.
| using IGraphicsFaustUI::ControlBoundsFunc = std::function<IRECT(const Item& item, const IRECT& cell)> |
Returns the bounds of a widget's control, given the cell that the layout allocated for it.
Definition at line 59 of file IGraphicsFaustUI.h.
| using IGraphicsFaustUI::CreateControlFunc = std::function<IControl*(const Item& item, int paramIdx, const IVStyle& style)> |
Creates the control for a widget.
| item | The widget's description |
| paramIdx | The IPlug parameter linked to the widget, or kNoParameter |
| style | The style to use |
Definition at line 56 of file IGraphicsFaustUI.h.
| using IGraphicsFaustUI::EType = FaustUIItem::EType |
Definition at line 49 of file IGraphicsFaustUI.h.
| using IGraphicsFaustUI::Item = FaustUIItem |
Definition at line 48 of file IGraphicsFaustUI.h.
|
inline |
| faust | The Faust DSP, which must have been initialized. Call IPlugFaust::CreateIPlugParameters() first to link the controls to parameters. |
| style | The style for the controls |
Definition at line 123 of file IGraphicsFaustUI.h.
References DefaultControlBounds(), and DefaultCreateControl().
Create a control containing the whole Faust UI.
Attach it with IGraphics::AttachControl()
| bounds | The bounds of the UI |
Definition at line 455 of file IGraphicsFaustUI.h.
References IPlugFaust::GetPlugParamIdx(), IPlugFaust::GetUIRoot(), and IPlugFaust::NParams().
|
inlinestatic |
Default control sizing: stops controls from stretching too much in large cells.
Definition at line 211 of file IGraphicsFaustUI.h.
References IRECT::GetCentredInside(), IRECT::H(), and IRECT::W().
Referenced by IGraphicsFaustUI().
|
inlinestatic |
The default control for each widget type.
Definition at line 153 of file IGraphicsFaustUI.h.
References IControl::SetTooltip().
Referenced by IGraphicsFaustUI().
|
inline |
Replace the function that sizes the controls within their layout cells.
Definition at line 144 of file IGraphicsFaustUI.h.
|
inline |
Replace the function that creates the controls for a widget type.
Definition at line 141 of file IGraphicsFaustUI.h.
|
inline |
Set the padding between controls and around boxes.
Definition at line 147 of file IGraphicsFaustUI.h.
|
inline |
Set the height of the tab bar for tab boxes.
Definition at line 150 of file IGraphicsFaustUI.h.