Vital
Loading...
Searching...
No Matches
SynthSection Class Reference

Base class for all synthesizer sections, providing UI layout, painting, and interaction logic. More...

#include <synth_section.h>

Inheritance diagram for SynthSection:
SynthButton::ButtonListener AudioFileViewer BankExporter BendSection ChorusSection CompressorSection ContentList DelaySection DisplaySettings DistortionSection DragDropEffectOrder DraggableEffect DualPopupSelector EffectsContainer EffectsInterface EnvelopeSection EqualizerSection ExtraModSection FilterSection FlangerSection FullInterface HeaderSection HelpPanel KeyboardInterface LfoSection LogoSection MacroKnobSection MasterControlsInterface ModulationInterface ModulationManager ModulationMatrix ModulationMatrixRow ModulationTabSelector OscillatorAdvancedSection OscillatorOptions OscillatorSection OscillatorUnison OutputDisplays Overlay OversampleSettings PhaserSection PopupBrowser PopupDisplay PopupList PortamentoSection PresetBrowser PresetList PresetSelector RandomSection ReverbSection SampleSection SelectionList SingleMacroSection SinglePopupSelector SynthPresetSelector SynthesisInterface TransposeQuantizeCallOut VoiceSection VoiceSettings VolumeSection WavetableComponentList WavetableComponentOverlay WavetableComponentOverlay::ControlsBackground WavetableEditSection WavetableOrganizer WavetablePlayhead

Classes

class  OffOverlay
 A semi-transparent overlay shown when the section is inactive. More...
 

Public Member Functions

 SynthSection (const String &name)
 Constructs a SynthSection with a given name.
 
virtual ~SynthSection ()=default
 
void setParent (const SynthSection *parent)
 Sets the parent SynthSection.
 
float findValue (Skin::ValueId value_id) const
 Finds a value in the skin overrides or from the parent if not found locally.
 
virtual void reset ()
 Resets the section and all sub-sections.
 
virtual void resized () override
 Called when the component is resized. Arranges layout of child components.
 
virtual void paint (Graphics &g) override
 Called when the component should paint itself.
 
virtual void paintSidewaysHeadingText (Graphics &g)
 Paints the section name heading text vertically if sideways_heading_ is true.
 
virtual void paintHeadingText (Graphics &g)
 Paints the heading text for this section, either sideways or horizontally.
 
virtual void paintBackground (Graphics &g)
 Paints the background of the section. Calls paintContainer, heading, knobs, children.
 
virtual void setSkinValues (const Skin &skin, bool top_level)
 Sets skin values (colors, sizes) and applies them to sub-sections.
 
void setSkinOverride (Skin::SectionOverride skin_override)
 
virtual void repaintBackground ()
 Requests a repaint of the background.
 
void showPopupBrowser (SynthSection *owner, Rectangle< int > bounds, std::vector< File > directories, String extensions, std::string passthrough_name, std::string additional_folders_name)
 Shows a file browser popup (e.g., for loading samples or wavetables).
 
void updatePopupBrowser (SynthSection *owner)
 Updates the currently visible popup browser if any.
 
void showPopupSelector (Component *source, Point< int > position, const PopupItems &options, std::function< void(int)> callback, std::function< void()> cancel={ })
 Shows a popup selector with options.
 
void showDualPopupSelector (Component *source, Point< int > position, int width, const PopupItems &options, std::function< void(int)> callback)
 Shows a dual popup selector for hierarchical selection.
 
void showPopupDisplay (Component *source, const std::string &text, BubbleComponent::BubblePlacement placement, bool primary)
 Shows a brief popup display (like a tooltip).
 
void hidePopupDisplay (bool primary)
 Hides the currently shown popup display.
 
virtual void loadFile (const File &file)
 Loads a file (e.g., a sample or wavetable). Overridden by subclasses.
 
virtual File getCurrentFile ()
 Gets the currently loaded file. Overridden by subclasses.
 
virtual std::string getFileName ()
 Gets the name of the currently loaded file. Overridden by subclasses.
 
virtual std::string getFileAuthor ()
 Gets the author metadata of the currently loaded file. Overridden by subclasses.
 
virtual void paintContainer (Graphics &g)
 Paints the container background, body, heading, etc.
 
virtual void paintBody (Graphics &g, Rectangle< int > bounds)
 Paints the body background within given bounds.
 
virtual void paintBorder (Graphics &g, Rectangle< int > bounds)
 Paints the border around given bounds.
 
virtual void paintBody (Graphics &g)
 Paints the section body background using the entire component area.
 
virtual void paintBorder (Graphics &g)
 Paints the border around the entire component.
 
int getComponentShadowWidth ()
 Gets the width of shadow around components.
 
virtual void paintTabShadow (Graphics &g)
 Paints a tab-like shadow effect around the component.
 
void paintTabShadow (Graphics &g, Rectangle< int > bounds)
 Paints a tab shadow effect within specified bounds.
 
virtual void paintBackgroundShadow (Graphics &g)
 Stub for painting background shadows. Overridden by subclasses if needed.
 
virtual void setSizeRatio (float ratio)
 Sets the size ratio for scaling UI elements.
 
void paintKnobShadows (Graphics &g)
 Paints knob shadows for all sliders.
 
Font getLabelFont ()
 Gets a suitable font for label text.
 
void setLabelFont (Graphics &g)
 Sets the Graphics context font and color for labels.
 
void drawLabelConnectionForComponents (Graphics &g, Component *left, Component *right)
 Draws a rectangular connection between labels of two components.
 
void drawLabelBackground (Graphics &g, Rectangle< int > bounds, bool text_component=false)
 Draws a background for a label area.
 
void drawLabelBackgroundForComponent (Graphics &g, Component *component)
 Draws label background for a specific component.
 
Rectangle< int > getDividedAreaBuffered (Rectangle< int > full_area, int num_sections, int section, int buffer)
 Divides an area into equal sections with buffering, returns the specified section.
 
Rectangle< int > getDividedAreaUnbuffered (Rectangle< int > full_area, int num_sections, int section, int buffer)
 Divides an area into equal sections without extra buffering, returns the specified section.
 
Rectangle< int > getLabelBackgroundBounds (Rectangle< int > bounds, bool text_component=false)
 Gets the background bounds for a label.
 
Rectangle< int > getLabelBackgroundBounds (Component *component, bool text_component=false)
 Gets the label background bounds for a component.
 
void drawLabel (Graphics &g, String text, Rectangle< int > component_bounds, bool text_component=false)
 Draws a label text below a component.
 
void drawLabelForComponent (Graphics &g, String text, Component *component, bool text_component=false)
 Draws a label for a given component.
 
void drawTextBelowComponent (Graphics &g, String text, Component *component, int space, int padding=0)
 Draws text below a component with optional padding.
 
virtual void paintChildrenShadows (Graphics &g)
 Paints shadows for child sections.
 
void paintChildrenBackgrounds (Graphics &g)
 Paints the backgrounds for all child sections.
 
void paintOpenGlChildrenBackgrounds (Graphics &g)
 Paints the backgrounds for all OpenGL child components.
 
void paintChildBackground (Graphics &g, SynthSection *child)
 Paints a child's background specifically.
 
void paintChildShadow (Graphics &g, SynthSection *child)
 Paints a child's shadow specifically.
 
void paintOpenGlBackground (Graphics &g, OpenGlComponent *child)
 Paints the background of an OpenGlComponent child.
 
void drawTextComponentBackground (Graphics &g, Rectangle< int > bounds, bool extend_to_label)
 Draws a background for a text component area.
 
void drawTempoDivider (Graphics &g, Component *sync)
 Draws a divider line for tempo-related controls.
 
virtual void initOpenGlComponents (OpenGlWrapper &open_gl)
 Initializes all OpenGL components in this section and sub-sections.
 
virtual void renderOpenGlComponents (OpenGlWrapper &open_gl, bool animate)
 Renders all OpenGL components in this section and sub-sections.
 
virtual void destroyOpenGlComponents (OpenGlWrapper &open_gl)
 Destroys all OpenGL components in this section and sub-sections.
 
virtual void sliderValueChanged (Slider *moved_slider) override
 Called when a slider value changes. Updates the synth parameter accordingly.
 
virtual void buttonClicked (Button *clicked_button) override
 Called when a button is clicked. Updates the synth parameter accordingly.
 
virtual void guiChanged (SynthButton *button) override
 Called when a SynthButton state changes (GUI interaction).
 
std::map< std::string, SynthSlider * > getAllSliders ()
 Gets all sliders registered in this section.
 
std::map< std::string, ToggleButton * > getAllButtons ()
 Gets all toggle buttons registered in this section.
 
std::map< std::string, ModulationButton * > getAllModulationButtons ()
 Gets all modulation buttons registered in this section.
 
virtual void setActive (bool active)
 Sets the active state of this section and sub-sections.
 
bool isActive () const
 Checks if the section is currently active.
 
virtual void animate (bool animate)
 Triggers animation state change in sub-sections if needed.
 
virtual void setAllValues (vital::control_map &controls)
 Sets values for all known parameters from a control map.
 
virtual void setValue (const std::string &name, vital::mono_float value, NotificationType notification)
 Sets a single parameter value for a known control.
 
void addModulationButton (ModulationButton *button, bool show=true)
 Adds a modulation button to this section.
 
void addSubSection (SynthSection *section, bool show=true)
 Adds a subsection (another SynthSection) as a child.
 
void removeSubSection (SynthSection *section)
 Removes a previously added subsection.
 
virtual void setScrollWheelEnabled (bool enabled)
 Enables or disables scroll wheel support for this section and sub-sections.
 
ToggleButton * activator () const
 Gets the activator toggle button if any.
 
void setSkinValues (std::map< Skin::ValueId, float > values)
 Sets custom skin values for this section.
 
void setSkinValue (Skin::ValueId id, float value)
 Sets a single skin value override.
 
float getTitleWidth ()
 
float getPadding ()
 
float getPowerButtonOffset () const
 
float getKnobSectionHeight ()
 
float getSliderWidth ()
 
float getSliderOverlap ()
 
float getSliderOverlapWithSpace ()
 
float getTextComponentHeight ()
 
float getStandardKnobSize ()
 
float getTotalKnobHeight ()
 
float getTextSectionYOffset ()
 
float getModButtonWidth ()
 
float getModFontSize ()
 
float getWidgetMargin ()
 
float getWidgetRounding ()
 
float getSizeRatio () const
 
int getPopupWidth () const
 
int getDualPopupWidth () const
 
- Public Member Functions inherited from SynthButton::ButtonListener
virtual ~ButtonListener ()
 Virtual destructor.
 

Static Public Attributes

static constexpr int kDefaultPowerButtonOffset = 0
 
static constexpr float kPowerButtonPaddingPercent = 0.29f
 
static constexpr float kTransposeHeightPercent = 0.5f
 
static constexpr float kTuneHeightPercent = 0.4f
 
static constexpr float kJointModulationRadiusPercent = 0.1f
 
static constexpr float kJointModulationExtensionPercent = 0.6666f
 
static constexpr float kPitchLabelPercent = 0.33f
 
static constexpr float kJointLabelHeightPercent = 0.4f
 
static constexpr double kTransposeMouseSensitivity = 0.2
 
static constexpr float kJointLabelBorderRatioX = 0.05f
 
static constexpr int kDefaultBodyRounding = 4
 
static constexpr int kDefaultLabelHeight = 10
 
static constexpr int kDefaultLabelBackgroundHeight = 16
 
static constexpr int kDefaultLabelBackgroundWidth = 56
 
static constexpr int kDefaultLabelBackgroundRounding = 4
 
static constexpr int kDefaultPadding = 2
 
static constexpr int kDefaultPopupMenuWidth = 150
 
static constexpr int kDefaultDualPopupMenuWidth = 340
 
static constexpr int kDefaultStandardKnobSize = 32
 
static constexpr int kDefaultKnobThickness = 2
 
static constexpr float kDefaultKnobModulationAmountThickness = 2.0f
 
static constexpr int kDefaultKnobModulationMeterSize = 43
 
static constexpr int kDefaultKnobModulationMeterThickness = 4
 
static constexpr int kDefaultModulationButtonWidth = 64
 
static constexpr int kDefaultModFontSize = 10
 
static constexpr int kDefaultKnobSectionHeight = 64
 
static constexpr int kDefaultSliderWidth = 24
 
static constexpr int kDefaultTextWidth = 80
 
static constexpr int kDefaultTextHeight = 24
 
static constexpr int kDefaultWidgetMargin = 6
 
static constexpr float kDefaultWidgetFillFade = 0.3f
 
static constexpr float kDefaultWidgetLineWidth = 4.0f
 
static constexpr float kDefaultWidgetFillCenter = 0.0f
 

Protected Member Functions

void setSliderHasHzAlternateDisplay (SynthSlider *slider)
 
void setSidewaysHeading (bool sideways)
 
void addToggleButton (ToggleButton *button, bool show)
 
void addButton (OpenGlToggleButton *button, bool show=true)
 
void addButton (OpenGlShapeButton *button, bool show=true)
 
void addSlider (SynthSlider *slider, bool show=true, bool listen=true)
 
void addOpenGlComponent (OpenGlComponent *open_gl_component, bool to_beginning=false)
 
void setActivator (SynthButton *activator)
 
void createOffOverlay ()
 
void setPresetSelector (PresetSelector *preset_selector, bool half=false)
 
void paintJointControlSliderBackground (Graphics &g, int x, int y, int width, int height)
 
void paintJointControlBackground (Graphics &g, int x, int y, int width, int height)
 
void paintJointControl (Graphics &g, int x, int y, int width, int height, const std::string &name)
 
void placeJointControls (int x, int y, int width, int height, SynthSlider *left, SynthSlider *right, Component *widget=nullptr)
 
void placeTempoControls (int x, int y, int width, int height, SynthSlider *tempo, SynthSlider *sync)
 
void placeRotaryOption (Component *option, SynthSlider *rotary)
 
void placeKnobsInArea (Rectangle< int > area, std::vector< Component * > knobs)
 
void lockCriticalSection ()
 
void unlockCriticalSection ()
 
Rectangle< int > getPresetBrowserBounds ()
 
int getTitleTextRight ()
 
Rectangle< int > getPowerButtonBounds ()
 
Rectangle< int > getTitleBounds ()
 
float getDisplayScale () const
 
virtual int getPixelMultiple () const
 

Protected Attributes

std::map< Skin::ValueId, float > value_lookup_
 
std::vector< SynthSection * > sub_sections_
 
std::vector< OpenGlComponent * > open_gl_components_
 
std::map< std::string, SynthSlider * > slider_lookup_
 
std::map< std::string, Button * > button_lookup_
 
std::map< std::string, ModulationButton * > modulation_buttons_
 
std::map< std::string, SynthSlider * > all_sliders_
 
std::map< std::string, ToggleButton * > all_buttons_
 
std::map< std::string, ModulationButton * > all_modulation_buttons_
 
const SynthSectionparent_
 
SynthButtonactivator_
 
PresetSelectorpreset_selector_
 
bool preset_selector_half_width_
 
std::unique_ptr< OffOverlayoff_overlay_
 
Skin::SectionOverride skin_override_
 
float size_ratio_
 
bool active_
 
bool sideways_heading_
 

Detailed Description

Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.

SynthSection serves as a container for UI elements in Vital. It supports nested sections, OpenGL components, sliders, buttons, and modulations. It handles painting backgrounds, labels, shadows, and complex UI layouts like joint controls and tempo controls.

Constructor & Destructor Documentation

◆ SynthSection()

SynthSection::SynthSection ( const String & name)

Constructs a SynthSection with a given name.

Parameters
nameThe name of the section.

◆ ~SynthSection()

virtual SynthSection::~SynthSection ( )
virtualdefault

Member Function Documentation

◆ activator()

ToggleButton * SynthSection::activator ( ) const
inline

Gets the activator toggle button if any.

Returns
Pointer to the activator ToggleButton.

◆ addButton() [1/2]

void SynthSection::addButton ( OpenGlShapeButton * button,
bool show = true )
protected

◆ addButton() [2/2]

void SynthSection::addButton ( OpenGlToggleButton * button,
bool show = true )
protected

◆ addModulationButton()

void SynthSection::addModulationButton ( ModulationButton * button,
bool show = true )

Adds a modulation button to this section.

Parameters
buttonThe ModulationButton pointer.
showTrue to add to visible layout.

◆ addOpenGlComponent()

void SynthSection::addOpenGlComponent ( OpenGlComponent * open_gl_component,
bool to_beginning = false )
protected

◆ addSlider()

void SynthSection::addSlider ( SynthSlider * slider,
bool show = true,
bool listen = true )
protected

◆ addSubSection()

void SynthSection::addSubSection ( SynthSection * section,
bool show = true )

Adds a subsection (another SynthSection) as a child.

Parameters
sectionThe sub-section to add.
showTrue to make it visible.

◆ addToggleButton()

void SynthSection::addToggleButton ( ToggleButton * button,
bool show )
protected

◆ animate()

void SynthSection::animate ( bool animate)
virtual

Triggers animation state change in sub-sections if needed.

Parameters
animateTrue if animation is desired.

Reimplemented in FullInterface.

◆ buttonClicked()

◆ createOffOverlay()

void SynthSection::createOffOverlay ( )
protected

◆ destroyOpenGlComponents()

void SynthSection::destroyOpenGlComponents ( OpenGlWrapper & open_gl)
virtual

Destroys all OpenGL components in this section and sub-sections.

Parameters
open_glThe OpenGlWrapper context.

Reimplemented in ContentList, EffectsInterface, ModulationManager, ModulationMatrix, PopupList, PresetList, and SelectionList.

◆ drawLabel()

void SynthSection::drawLabel ( Graphics & g,
String text,
Rectangle< int > component_bounds,
bool text_component = false )

Draws a label text below a component.

Parameters
gThe Graphics context.
textThe label text.
componentThe reference component.
text_componentTrue if for a text component.

◆ drawLabelBackground()

void SynthSection::drawLabelBackground ( Graphics & g,
Rectangle< int > bounds,
bool text_component = false )

Draws a background for a label area.

Parameters
gThe Graphics context.
boundsThe rectangle area for the label.
text_componentTrue if drawing for a text component.

◆ drawLabelBackgroundForComponent()

void SynthSection::drawLabelBackgroundForComponent ( Graphics & g,
Component * component )

Draws label background for a specific component.

Parameters
gThe Graphics context.
componentThe component needing label background.

◆ drawLabelConnectionForComponents()

void SynthSection::drawLabelConnectionForComponents ( Graphics & g,
Component * left,
Component * right )

Draws a rectangular connection between labels of two components.

Parameters
gThe Graphics context.
leftThe left component.
rightThe right component.

◆ drawLabelForComponent()

void SynthSection::drawLabelForComponent ( Graphics & g,
String text,
Component * component,
bool text_component = false )
inline

Draws a label for a given component.

Parameters
gThe Graphics context.
textThe label text.
componentThe component to label.
text_componentTrue if for a text component.

◆ drawTempoDivider()

void SynthSection::drawTempoDivider ( Graphics & g,
Component * sync )

Draws a divider line for tempo-related controls.

Parameters
gThe Graphics context.
syncThe tempo sync component.

◆ drawTextBelowComponent()

void SynthSection::drawTextBelowComponent ( Graphics & g,
String text,
Component * component,
int space,
int padding = 0 )

Draws text below a component with optional padding.

Parameters
gThe Graphics context.
textThe text to draw.
componentThe reference component.
spaceVertical space below the component.
paddingHorizontal padding.

◆ drawTextComponentBackground()

void SynthSection::drawTextComponentBackground ( Graphics & g,
Rectangle< int > bounds,
bool extend_to_label )

Draws a background for a text component area.

Parameters
gThe Graphics context.
boundsThe area to draw.
extend_to_labelTrue to extend background up to label area.

◆ findValue()

float SynthSection::findValue ( Skin::ValueId value_id) const

Finds a value in the skin overrides or from the parent if not found locally.

Parameters
value_idThe Skin value ID to lookup.
Returns
The found value or 0.0f if not found.

◆ getAllButtons()

std::map< std::string, ToggleButton * > SynthSection::getAllButtons ( )
inline

Gets all toggle buttons registered in this section.

Returns
A map of button name to pointer.

◆ getAllModulationButtons()

std::map< std::string, ModulationButton * > SynthSection::getAllModulationButtons ( )
inline

Gets all modulation buttons registered in this section.

Returns
A map of modulation button name to pointer.

◆ getAllSliders()

std::map< std::string, SynthSlider * > SynthSection::getAllSliders ( )
inline

Gets all sliders registered in this section.

Returns
A map of slider name to pointer.

◆ getComponentShadowWidth()

int SynthSection::getComponentShadowWidth ( )

Gets the width of shadow around components.

Returns
The shadow width in pixels.

◆ getCurrentFile()

virtual File SynthSection::getCurrentFile ( )
inlinevirtual

Gets the currently loaded file. Overridden by subclasses.

Returns
The currently loaded file.

Reimplemented in LfoSection, ModulationMatrix, OscillatorSection, SampleSection, and WavetableEditSection.

◆ getDisplayScale()

float SynthSection::getDisplayScale ( ) const
protected

◆ getDividedAreaBuffered()

Rectangle< int > SynthSection::getDividedAreaBuffered ( Rectangle< int > full_area,
int num_sections,
int section,
int buffer )

Divides an area into equal sections with buffering, returns the specified section.

Parameters
full_areaThe full rectangle area.
num_sectionsTotal number of sections.
sectionThe index of the section to retrieve.
bufferThe spacing between sections.
Returns
The rectangle for the specified section.

◆ getDividedAreaUnbuffered()

Rectangle< int > SynthSection::getDividedAreaUnbuffered ( Rectangle< int > full_area,
int num_sections,
int section,
int buffer )

Divides an area into equal sections without extra buffering, returns the specified section.

Parameters
full_areaThe full rectangle area.
num_sectionsTotal number of sections.
sectionThe index of the section to retrieve.
bufferThe spacing between sections.
Returns
The rectangle for the specified section.

◆ getDualPopupWidth()

int SynthSection::getDualPopupWidth ( ) const
inline

◆ getFileAuthor()

virtual std::string SynthSection::getFileAuthor ( )
inlinevirtual

Gets the author metadata of the currently loaded file. Overridden by subclasses.

Returns
The author string.

Reimplemented in OscillatorSection.

◆ getFileName()

virtual std::string SynthSection::getFileName ( )
inlinevirtual

Gets the name of the currently loaded file. Overridden by subclasses.

Returns
The file name string.

Reimplemented in OscillatorSection.

◆ getKnobSectionHeight()

float SynthSection::getKnobSectionHeight ( )

◆ getLabelBackgroundBounds() [1/2]

Rectangle< int > SynthSection::getLabelBackgroundBounds ( Component * component,
bool text_component = false )
inline

Gets the label background bounds for a component.

Parameters
componentThe component.
text_componentTrue if for a text component.
Returns
The label background rectangle.

◆ getLabelBackgroundBounds() [2/2]

Rectangle< int > SynthSection::getLabelBackgroundBounds ( Rectangle< int > bounds,
bool text_component = false )

Gets the background bounds for a label.

Parameters
boundsThe component bounds.
text_componentTrue if for a text component.
Returns
The label background rectangle.

◆ getLabelFont()

Font SynthSection::getLabelFont ( )

Gets a suitable font for label text.

Returns
The label font.

◆ getModButtonWidth()

float SynthSection::getModButtonWidth ( )

◆ getModFontSize()

float SynthSection::getModFontSize ( )

◆ getPadding()

float SynthSection::getPadding ( )

◆ getPixelMultiple()

int SynthSection::getPixelMultiple ( ) const
protectedvirtual

Reimplemented in FullInterface.

◆ getPopupWidth()

int SynthSection::getPopupWidth ( ) const
inline

◆ getPowerButtonBounds()

Rectangle< int > SynthSection::getPowerButtonBounds ( )
protected

◆ getPowerButtonOffset()

float SynthSection::getPowerButtonOffset ( ) const
inline

◆ getPresetBrowserBounds()

Rectangle< int > SynthSection::getPresetBrowserBounds ( )
protected

◆ getSizeRatio()

float SynthSection::getSizeRatio ( ) const
inline

◆ getSliderOverlap()

float SynthSection::getSliderOverlap ( )

◆ getSliderOverlapWithSpace()

float SynthSection::getSliderOverlapWithSpace ( )

◆ getSliderWidth()

float SynthSection::getSliderWidth ( )

◆ getStandardKnobSize()

float SynthSection::getStandardKnobSize ( )

◆ getTextComponentHeight()

float SynthSection::getTextComponentHeight ( )

◆ getTextSectionYOffset()

float SynthSection::getTextSectionYOffset ( )

◆ getTitleBounds()

Rectangle< int > SynthSection::getTitleBounds ( )
protected

◆ getTitleTextRight()

int SynthSection::getTitleTextRight ( )
protected

◆ getTitleWidth()

float SynthSection::getTitleWidth ( )

◆ getTotalKnobHeight()

float SynthSection::getTotalKnobHeight ( )
inline

◆ getWidgetMargin()

float SynthSection::getWidgetMargin ( )

◆ getWidgetRounding()

float SynthSection::getWidgetRounding ( )

◆ guiChanged()

void SynthSection::guiChanged ( SynthButton * button)
overridevirtual

Called when a SynthButton state changes (GUI interaction).

Parameters
buttonThe SynthButton changed.

Reimplemented from SynthButton::ButtonListener.

◆ hidePopupDisplay()

void SynthSection::hidePopupDisplay ( bool primary)

Hides the currently shown popup display.

Parameters
primaryTrue if hiding the primary popup display.

◆ initOpenGlComponents()

void SynthSection::initOpenGlComponents ( OpenGlWrapper & open_gl)
virtual

Initializes all OpenGL components in this section and sub-sections.

Parameters
open_glThe OpenGlWrapper context.

Reimplemented in ContentList, EffectsInterface, ModulationManager, ModulationMatrix, PopupList, PresetList, SelectionList, and WavetableComponentOverlay.

◆ isActive()

bool SynthSection::isActive ( ) const
inline

Checks if the section is currently active.

Returns
True if active, false if not.

◆ loadFile()

virtual void SynthSection::loadFile ( const File & file)
inlinevirtual

Loads a file (e.g., a sample or wavetable). Overridden by subclasses.

Parameters
fileThe file to load.

Reimplemented in FileSourceOverlay, LfoSection, ModulationMatrix, OscillatorSection, SampleSection, and WavetableEditSection.

◆ lockCriticalSection()

void SynthSection::lockCriticalSection ( )
protected

◆ paint()

void SynthSection::paint ( Graphics & g)
overridevirtual

Called when the component should paint itself.

Parameters
gThe Graphics context.

Reimplemented in DraggableEffect, and TransposeQuantizeCallOut.

◆ paintBackground()

◆ paintBackgroundShadow()

◆ paintBody() [1/2]

void SynthSection::paintBody ( Graphics & g)
virtual

Paints the section body background using the entire component area.

Parameters
gThe Graphics context.

◆ paintBody() [2/2]

void SynthSection::paintBody ( Graphics & g,
Rectangle< int > bounds )
virtual

Paints the body background within given bounds.

Parameters
gThe Graphics context.
boundsThe area to paint.

◆ paintBorder() [1/2]

void SynthSection::paintBorder ( Graphics & g)
virtual

Paints the border around the entire component.

Parameters
gThe Graphics context.

◆ paintBorder() [2/2]

void SynthSection::paintBorder ( Graphics & g,
Rectangle< int > bounds )
virtual

Paints the border around given bounds.

Parameters
gThe Graphics context.
boundsThe rectangle area.

◆ paintChildBackground()

void SynthSection::paintChildBackground ( Graphics & g,
SynthSection * child )

Paints a child's background specifically.

Parameters
gThe Graphics context.
childThe child SynthSection.

◆ paintChildrenBackgrounds()

void SynthSection::paintChildrenBackgrounds ( Graphics & g)

Paints the backgrounds for all child sections.

Parameters
gThe Graphics context.

◆ paintChildrenShadows()

void SynthSection::paintChildrenShadows ( Graphics & g)
virtual

Paints shadows for child sections.

Parameters
gThe Graphics context.

Reimplemented in EffectsInterface.

◆ paintChildShadow()

void SynthSection::paintChildShadow ( Graphics & g,
SynthSection * child )

Paints a child's shadow specifically.

Parameters
gThe Graphics context.
childThe child SynthSection.

◆ paintContainer()

void SynthSection::paintContainer ( Graphics & g)
virtual

Paints the container background, body, heading, etc.

Parameters
gThe Graphics context.

◆ paintHeadingText()

void SynthSection::paintHeadingText ( Graphics & g)
virtual

Paints the heading text for this section, either sideways or horizontally.

Parameters
gThe Graphics context.

◆ paintJointControl()

void SynthSection::paintJointControl ( Graphics & g,
int x,
int y,
int width,
int height,
const std::string & name )
protected

◆ paintJointControlBackground()

void SynthSection::paintJointControlBackground ( Graphics & g,
int x,
int y,
int width,
int height )
protected

◆ paintJointControlSliderBackground()

void SynthSection::paintJointControlSliderBackground ( Graphics & g,
int x,
int y,
int width,
int height )
protected

◆ paintKnobShadows()

void SynthSection::paintKnobShadows ( Graphics & g)

Paints knob shadows for all sliders.

Parameters
gThe Graphics context.

◆ paintOpenGlBackground()

void SynthSection::paintOpenGlBackground ( Graphics & g,
OpenGlComponent * child )

Paints the background of an OpenGlComponent child.

Parameters
gThe Graphics context.
childThe OpenGlComponent child.

◆ paintOpenGlChildrenBackgrounds()

void SynthSection::paintOpenGlChildrenBackgrounds ( Graphics & g)

Paints the backgrounds for all OpenGL child components.

Parameters
gThe Graphics context.

◆ paintSidewaysHeadingText()

void SynthSection::paintSidewaysHeadingText ( Graphics & g)
virtual

Paints the section name heading text vertically if sideways_heading_ is true.

Parameters
gThe Graphics context.

◆ paintTabShadow() [1/2]

void SynthSection::paintTabShadow ( Graphics & g)
virtual

Paints a tab-like shadow effect around the component.

Parameters
gThe Graphics context.

Reimplemented in ModulationTabSelector.

◆ paintTabShadow() [2/2]

void SynthSection::paintTabShadow ( Graphics & g,
Rectangle< int > bounds )

Paints a tab shadow effect within specified bounds.

Parameters
gThe Graphics context.
boundsThe area to apply the shadow.

◆ placeJointControls()

void SynthSection::placeJointControls ( int x,
int y,
int width,
int height,
SynthSlider * left,
SynthSlider * right,
Component * widget = nullptr )
protected

◆ placeKnobsInArea()

void SynthSection::placeKnobsInArea ( Rectangle< int > area,
std::vector< Component * > knobs )
protected

◆ placeRotaryOption()

void SynthSection::placeRotaryOption ( Component * option,
SynthSlider * rotary )
protected

◆ placeTempoControls()

void SynthSection::placeTempoControls ( int x,
int y,
int width,
int height,
SynthSlider * tempo,
SynthSlider * sync )
protected

◆ removeSubSection()

void SynthSection::removeSubSection ( SynthSection * section)

Removes a previously added subsection.

Parameters
sectionThe sub-section to remove.

◆ renderOpenGlComponents()

void SynthSection::renderOpenGlComponents ( OpenGlWrapper & open_gl,
bool animate )
virtual

Renders all OpenGL components in this section and sub-sections.

Parameters
open_glThe OpenGlWrapper context.
animateTrue if animation is desired.

Reimplemented in AboutSection, ContentList, DownloadSection, DragDropEffectOrder, DraggableEffect, EffectsInterface, EqualizerSection, ModulationManager, ModulationMatrix, PopupList, PresetList, SelectionList, WaveLineSourceOverlay, and WavetableEditSection.

◆ repaintBackground()

void SynthSection::repaintBackground ( )
virtual

Requests a repaint of the background.

Reimplemented in ModulationMatrixRow.

◆ reset()

void SynthSection::reset ( )
virtual

◆ resized()

◆ setActivator()

void SynthSection::setActivator ( SynthButton * activator)
protected

◆ setActive()

void SynthSection::setActive ( bool active)
virtual

Sets the active state of this section and sub-sections.

Parameters
activeTrue to activate, false to deactivate.

Reimplemented in ChorusSection, CompressorSection, DelaySection, DistortionSection, EqualizerSection, FilterSection, FlangerSection, OscillatorSection, PhaserSection, ReverbSection, and SampleSection.

◆ setAllValues()

void SynthSection::setAllValues ( vital::control_map & controls)
virtual

Sets values for all known parameters from a control map.

Parameters
controlsThe map of parameter names to control objects.

Reimplemented in CompressorSection, DelaySection, DistortionSection, DragDropEffectOrder, FilterSection, FullInterface, HeaderSection, LfoSection, ModulationMatrix, OscillatorOptions, OscillatorSection, OscillatorUnison, OversampleSettings, PortamentoSection, RandomSection, SampleSection, VoiceSection, and VoiceSettings.

◆ setLabelFont()

void SynthSection::setLabelFont ( Graphics & g)

Sets the Graphics context font and color for labels.

Parameters
gThe Graphics context.

◆ setParent()

void SynthSection::setParent ( const SynthSection * parent)
inline

Sets the parent SynthSection.

Parameters
parentThe parent section.

◆ setPresetSelector()

void SynthSection::setPresetSelector ( PresetSelector * preset_selector,
bool half = false )
inlineprotected

◆ setScrollWheelEnabled()

void SynthSection::setScrollWheelEnabled ( bool enabled)
virtual

Enables or disables scroll wheel support for this section and sub-sections.

Parameters
enabledTrue to enable scroll wheel changes, false to disable.

Reimplemented in EqualizerSection.

◆ setSidewaysHeading()

void SynthSection::setSidewaysHeading ( bool sideways)
inlineprotected

◆ setSizeRatio()

void SynthSection::setSizeRatio ( float ratio)
virtual

Sets the size ratio for scaling UI elements.

Parameters
ratioThe scaling ratio.

Reimplemented in Overlay.

◆ setSkinOverride()

void SynthSection::setSkinOverride ( Skin::SectionOverride skin_override)
inline

◆ setSkinValue()

void SynthSection::setSkinValue ( Skin::ValueId id,
float value )
inline

Sets a single skin value override.

Parameters
idThe Skin::ValueId enum.
valueThe value to set.

◆ setSkinValues() [1/2]

void SynthSection::setSkinValues ( const Skin & skin,
bool top_level )
virtual

Sets skin values (colors, sizes) and applies them to sub-sections.

Parameters
skinThe Skin object.
top_levelTrue if this is the top-level call.

Reimplemented in OscillatorSection.

◆ setSkinValues() [2/2]

void SynthSection::setSkinValues ( std::map< Skin::ValueId, float > values)
inline

Sets custom skin values for this section.

Parameters
valuesA map of Skin::ValueId to float values.

◆ setSliderHasHzAlternateDisplay()

void SynthSection::setSliderHasHzAlternateDisplay ( SynthSlider * slider)
protected

◆ setValue()

void SynthSection::setValue ( const std::string & name,
vital::mono_float value,
NotificationType notification )
virtual

Sets a single parameter value for a known control.

Parameters
nameThe parameter name.
valueThe new value.
notificationWhether to send notifications to listeners.

◆ showDualPopupSelector()

void SynthSection::showDualPopupSelector ( Component * source,
Point< int > position,
int width,
const PopupItems & options,
std::function< void(int)> callback )

Shows a dual popup selector for hierarchical selection.

Parameters
sourceThe component launching the selector.
positionThe position relative to source for the popup.
widthDesired width of the popup.
optionsThe PopupItems to display.
callbackCallback when selection is made.

◆ showPopupBrowser()

void SynthSection::showPopupBrowser ( SynthSection * owner,
Rectangle< int > bounds,
std::vector< File > directories,
String extensions,
std::string passthrough_name,
std::string additional_folders_name )

Shows a file browser popup (e.g., for loading samples or wavetables).

Parameters
ownerThe SynthSection requesting the browser.
boundsThe area where the browser should appear.
directoriesA list of directories to browse.
extensionsThe file extensions allowed.
passthrough_nameA name for a passthrough folder.
additional_folders_nameA name for additional folders category.

◆ showPopupDisplay()

void SynthSection::showPopupDisplay ( Component * source,
const std::string & text,
BubbleComponent::BubblePlacement placement,
bool primary )

Shows a brief popup display (like a tooltip).

Parameters
sourceThe component requesting the display.
textThe text to show.
placementThe bubble placement relative to the source.
primaryTrue if using the primary popup display slot.

◆ showPopupSelector()

void SynthSection::showPopupSelector ( Component * source,
Point< int > position,
const PopupItems & options,
std::function< void(int)> callback,
std::function< void()> cancel = { } )

Shows a popup selector with options.

Parameters
sourceThe component launching the selector.
positionThe position relative to source to show the popup.
optionsThe PopupItems to display.
callbackCallback when selection is made.
cancelOptional callback if cancelled.

◆ sliderValueChanged()

void SynthSection::sliderValueChanged ( Slider * moved_slider)
overridevirtual

◆ unlockCriticalSection()

void SynthSection::unlockCriticalSection ( )
protected

◆ updatePopupBrowser()

void SynthSection::updatePopupBrowser ( SynthSection * owner)

Updates the currently visible popup browser if any.

Parameters
ownerThe SynthSection that owns the browser.

Member Data Documentation

◆ activator_

SynthButton* SynthSection::activator_
protected

◆ active_

bool SynthSection::active_
protected

◆ all_buttons_

std::map<std::string, ToggleButton*> SynthSection::all_buttons_
protected

◆ all_modulation_buttons_

std::map<std::string, ModulationButton*> SynthSection::all_modulation_buttons_
protected

◆ all_sliders_

std::map<std::string, SynthSlider*> SynthSection::all_sliders_
protected

◆ button_lookup_

std::map<std::string, Button*> SynthSection::button_lookup_
protected

◆ kDefaultBodyRounding

int SynthSection::kDefaultBodyRounding = 4
staticconstexpr

◆ kDefaultDualPopupMenuWidth

int SynthSection::kDefaultDualPopupMenuWidth = 340
staticconstexpr

◆ kDefaultKnobModulationAmountThickness

float SynthSection::kDefaultKnobModulationAmountThickness = 2.0f
staticconstexpr

◆ kDefaultKnobModulationMeterSize

int SynthSection::kDefaultKnobModulationMeterSize = 43
staticconstexpr

◆ kDefaultKnobModulationMeterThickness

int SynthSection::kDefaultKnobModulationMeterThickness = 4
staticconstexpr

◆ kDefaultKnobSectionHeight

int SynthSection::kDefaultKnobSectionHeight = 64
staticconstexpr

◆ kDefaultKnobThickness

int SynthSection::kDefaultKnobThickness = 2
staticconstexpr

◆ kDefaultLabelBackgroundHeight

int SynthSection::kDefaultLabelBackgroundHeight = 16
staticconstexpr

◆ kDefaultLabelBackgroundRounding

int SynthSection::kDefaultLabelBackgroundRounding = 4
staticconstexpr

◆ kDefaultLabelBackgroundWidth

int SynthSection::kDefaultLabelBackgroundWidth = 56
staticconstexpr

◆ kDefaultLabelHeight

int SynthSection::kDefaultLabelHeight = 10
staticconstexpr

◆ kDefaultModFontSize

int SynthSection::kDefaultModFontSize = 10
staticconstexpr

◆ kDefaultModulationButtonWidth

int SynthSection::kDefaultModulationButtonWidth = 64
staticconstexpr

◆ kDefaultPadding

int SynthSection::kDefaultPadding = 2
staticconstexpr

◆ kDefaultPopupMenuWidth

int SynthSection::kDefaultPopupMenuWidth = 150
staticconstexpr

◆ kDefaultPowerButtonOffset

int SynthSection::kDefaultPowerButtonOffset = 0
staticconstexpr

◆ kDefaultSliderWidth

int SynthSection::kDefaultSliderWidth = 24
staticconstexpr

◆ kDefaultStandardKnobSize

int SynthSection::kDefaultStandardKnobSize = 32
staticconstexpr

◆ kDefaultTextHeight

int SynthSection::kDefaultTextHeight = 24
staticconstexpr

◆ kDefaultTextWidth

int SynthSection::kDefaultTextWidth = 80
staticconstexpr

◆ kDefaultWidgetFillCenter

float SynthSection::kDefaultWidgetFillCenter = 0.0f
staticconstexpr

◆ kDefaultWidgetFillFade

float SynthSection::kDefaultWidgetFillFade = 0.3f
staticconstexpr

◆ kDefaultWidgetLineWidth

float SynthSection::kDefaultWidgetLineWidth = 4.0f
staticconstexpr

◆ kDefaultWidgetMargin

int SynthSection::kDefaultWidgetMargin = 6
staticconstexpr

◆ kJointLabelBorderRatioX

float SynthSection::kJointLabelBorderRatioX = 0.05f
staticconstexpr

◆ kJointLabelHeightPercent

float SynthSection::kJointLabelHeightPercent = 0.4f
staticconstexpr

◆ kJointModulationExtensionPercent

float SynthSection::kJointModulationExtensionPercent = 0.6666f
staticconstexpr

◆ kJointModulationRadiusPercent

float SynthSection::kJointModulationRadiusPercent = 0.1f
staticconstexpr

◆ kPitchLabelPercent

float SynthSection::kPitchLabelPercent = 0.33f
staticconstexpr

◆ kPowerButtonPaddingPercent

float SynthSection::kPowerButtonPaddingPercent = 0.29f
staticconstexpr

◆ kTransposeHeightPercent

float SynthSection::kTransposeHeightPercent = 0.5f
staticconstexpr

◆ kTransposeMouseSensitivity

double SynthSection::kTransposeMouseSensitivity = 0.2
staticconstexpr

◆ kTuneHeightPercent

float SynthSection::kTuneHeightPercent = 0.4f
staticconstexpr

◆ modulation_buttons_

std::map<std::string, ModulationButton*> SynthSection::modulation_buttons_
protected

◆ off_overlay_

std::unique_ptr<OffOverlay> SynthSection::off_overlay_
protected

◆ open_gl_components_

std::vector<OpenGlComponent*> SynthSection::open_gl_components_
protected

◆ parent_

const SynthSection* SynthSection::parent_
protected

◆ preset_selector_

PresetSelector* SynthSection::preset_selector_
protected

◆ preset_selector_half_width_

bool SynthSection::preset_selector_half_width_
protected

◆ sideways_heading_

bool SynthSection::sideways_heading_
protected

◆ size_ratio_

float SynthSection::size_ratio_
protected

◆ skin_override_

Skin::SectionOverride SynthSection::skin_override_
protected

◆ slider_lookup_

std::map<std::string, SynthSlider*> SynthSection::slider_lookup_
protected

◆ sub_sections_

std::vector<SynthSection*> SynthSection::sub_sections_
protected

◆ value_lookup_

std::map<Skin::ValueId, float> SynthSection::value_lookup_
protected

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