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

A specialized slider-like component allowing selection of modulation sources or destinations from a popup menu. More...

#include <modulation_matrix.h>

Inheritance diagram for ModulationSelector:
OpenGlSlider

Public Member Functions

 ModulationSelector (String name, const std::vector< String > *selections, PopupItems *popup_items, bool dual_menu)
 Constructs a ModulationSelector.
 
String getTextFromValue (double value) override
 Converts a numeric value to a display text representing the currently selected modulation.
 
String getSelection ()
 Gets the currently selected modulation string.
 
bool connected () const
 Checks if the selector is currently connected (not at default/off selection).
 
void setValueFromName (const String &name, NotificationType notification_type)
 Sets the current value based on a given name.
 
void mouseDown (const juce::MouseEvent &e) override
 Handles mouse down events, showing the popup selection menu.
 
- Public Member Functions inherited from OpenGlSlider
 OpenGlSlider (String name)
 
virtual void resized () override
 Called when the component is resized. Updates colors and display values.
 
virtual void valueChanged () override
 Called when the slider value changes. Redraws the image to reflect the new value.
 
void parentHierarchyChanged () override
 Called when the parent hierarchy changes. Used for retrieving parent sections.
 
void paintToImage (bool paint)
 
bool isText () const
 
bool isTextOrCurve () const
 
bool isModulationKnob () const
 
bool isRotaryQuad () const
 
bool isHorizontalQuad () const
 
bool isVerticalQuad () const
 
OpenGlComponentgetImageComponent ()
 
OpenGlComponentgetQuadComponent ()
 
void setMaxArc (float arc)
 
void setModulationKnob ()
 Marks this slider as a modulation knob.
 
void setModulationAmount (float modulation)
 
float getModulationAmount () const
 
virtual float getKnobSizeScale () const
 
bool isBipolar () const
 
bool isActive () const
 
void setBipolar (bool bipolar=true)
 
void setActive (bool active=true)
 
virtual Colour getModColor () const
 
virtual Colour getBackgroundColor () const
 
virtual Colour getUnselectedColor () const
 
virtual Colour getSelectedColor () const
 
virtual Colour getThumbColor () const
 
int getLinearSliderWidth ()
 
void setSliderDisplayValues ()
 Sets the slider display values (positions, sizes) based on current style.
 
void redoImage (bool skip_image=false)
 
void setColors ()
 Updates internal colors based on the current skin and state.
 
virtual float findValue (Skin::ValueId value_id) const
 
void setAlpha (float alpha, bool reset=false)
 
void setDrawWhenNotVisible (bool draw)
 
SynthSectiongetSectionParent ()
 

Static Public Member Functions

static void modulationSelectionCallback (int result, ModulationSelector *selector)
 Callback for modulation popup menu selections.
 

Additional Inherited Members

- Static Public Attributes inherited from OpenGlSlider
static constexpr float kRotaryAngle = 0.8f * vital::kPi
 The default rotary arc angle used for rotary sliders.
 
- Protected Attributes inherited from OpenGlSlider
SynthSectionparent_
 The parent SynthSection.
 

Detailed Description

A specialized slider-like component allowing selection of modulation sources or destinations from a popup menu.

Constructor & Destructor Documentation

◆ ModulationSelector()

ModulationSelector::ModulationSelector ( String name,
const std::vector< String > * selections,
PopupItems * popup_items,
bool dual_menu )
inline

Constructs a ModulationSelector.

Parameters
nameThe name for the selector.
selectionsA pointer to a vector of selection strings.
popup_itemsA pointer to a PopupItems structure for building menus.
dual_menuWhether the selector uses dual-level menus.

Member Function Documentation

◆ connected()

bool ModulationSelector::connected ( ) const
inline

Checks if the selector is currently connected (not at default/off selection).

Returns
True if connected, false otherwise.

◆ getSelection()

String ModulationSelector::getSelection ( )
inline

Gets the currently selected modulation string.

Returns
The selected modulation string.

◆ getTextFromValue()

String ModulationSelector::getTextFromValue ( double value)
override

Converts a numeric value to a display text representing the currently selected modulation.

Parameters
valueThe numeric value representing the selection index.
Returns
The display text.

◆ modulationSelectionCallback()

static void ModulationSelector::modulationSelectionCallback ( int result,
ModulationSelector * selector )
inlinestatic

Callback for modulation popup menu selections.

Parameters
resultThe menu item index selected.
selectorThe ModulationSelector instance.

◆ mouseDown()

void ModulationSelector::mouseDown ( const juce::MouseEvent & e)
override

Handles mouse down events, showing the popup selection menu.

Parameters
eThe mouse event.

◆ setValueFromName()

void ModulationSelector::setValueFromName ( const String & name,
NotificationType notification_type )

Sets the current value based on a given name.

Parameters
nameThe name to match.
notification_typeThe notification type for value changes.

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