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

A specialized slider with extended functionality for modulation, parameter control, popup menus, and text entry. More...

#include <synth_slider.h>

Inheritance diagram for SynthSlider:
OpenGlSlider ControlWheel InvisibleSlider ModulationAmountKnob TempoSelector TextSelector VolumeSlider ModWheel PitchWheel PaintPatternSelector TuningSelector

Classes

class  SliderListener
 Listener interface for receiving slider events such as mouse interactions, modulation changes, and GUI changes. More...
 

Public Types

enum  MenuId {
  kCancel = 0 , kArmMidiLearn , kClearMidiLearn , kDefaultValue ,
  kManualEntry , kClearModulations , kModulationList
}
 Menu item IDs for the right-click popup menu. More...
 

Public Member Functions

 SynthSlider (String name)
 
virtual void mouseDown (const MouseEvent &e) override
 Mouse event overrides for custom behavior.
 
virtual void mouseDrag (const MouseEvent &e) override
 
virtual void mouseEnter (const MouseEvent &e) override
 
virtual void mouseExit (const MouseEvent &e) override
 
virtual void mouseUp (const MouseEvent &e) override
 
virtual void mouseDoubleClick (const MouseEvent &e) override
 
virtual void mouseWheelMove (const MouseEvent &e, const MouseWheelDetails &wheel) override
 
virtual void focusLost (FocusChangeType cause) override
 
virtual void valueChanged () override
 Called when the slider value changes. Notifies GUIs.
 
String getRawTextFromValue (double value)
 
String getSliderTextFromValue (double value)
 
String getTextFromValue (double value) override
 
double getValueFromText (const String &text) override
 
double getAdjustedValue (double value)
 
double getValueFromAdjusted (double value)
 
void setValueFromAdjusted (double value)
 
virtual void parentHierarchyChanged () override
 Called when the parent hierarchy changes, updates references to synthesizer.
 
virtual double snapValue (double attemptedValue, DragMode dragMode) override
 
void textEditorTextChanged (TextEditor &) override
 TextEditor::Listener overrides for handling text entry.
 
void textEditorReturnKeyPressed (TextEditor &editor) override
 
void textEditorFocusLost (TextEditor &editor) override
 
void setSliderPositionFromText ()
 Sets the slider position from the current text in the text editor.
 
void showTextEntry ()
 Shows the text entry box for manual value entry.
 
virtual bool shouldShowPopup ()
 
virtual void drawShadow (Graphics &g)
 
void drawRotaryShadow (Graphics &g)
 
void snapToValue (bool snap, float value=0.0)
 
void setScalingType (vital::ValueDetails::ValueScale scaling_type)
 
vital::ValueDetails::ValueScale getScalingType () const
 
void setStringLookup (const std::string *lookup)
 
void setScrollEnabled (bool enabled)
 
const std::string * getStringLookup () const
 
void setUnits (const String &units)
 
String getUnits () const
 
String formatValue (float value)
 
void setDefaultRange ()
 Sets the default parameter range based on the parameter details.
 
void addSliderListener (SliderListener *listener)
 
void showPopup (bool primary)
 
void hidePopup (bool primary)
 
void setPopupPlacement (BubbleComponent::BubblePlacement placement)
 
void setModulationPlacement (BubbleComponent::BubblePlacement placement)
 
BubbleComponent::BubblePlacement getPopupPlacement ()
 
BubbleComponent::BubblePlacement getModulationPlacement ()
 
void notifyGuis ()
 Notifies GUI listeners of a value change.
 
void handlePopupResult (int result)
 
void setSensitivity (double sensitivity)
 
double getSensitivity ()
 
Rectangle< int > getModulationMeterBounds () const
 
bool hasModulationArea () const
 
Rectangle< int > getModulationArea () const
 
void setModulationArea (Rectangle< int > area)
 
bool isModulationBipolar () const
 
bool isModulationStereo () const
 
bool isModulationBypassed () const
 
void setTextHeightPercentage (float percentage)
 
float getTextHeightPercentage ()
 
float mouseHovering () const
 
std::vector< vital::ModulationConnection * > getConnections ()
 
void setMouseWheelMovement (double movement)
 
void setMaxDisplayCharacters (int characters)
 
void setMaxDecimalPlaces (int decimal_places)
 
void setTextEntrySizePercent (float width_percent, float height_percent)
 
void setTextEntryWidthPercent (float percent)
 
void setShiftIndexAmount (int shift_amount)
 
void setShowPopupOnHover (bool show)
 
void setPopupPrefix (String prefix)
 
void setPopupSuffix (const juce::String &suffix)
 
void setKnobSizeScale (float scale)
 
float getKnobSizeScale () const override
 
void useSuffix (bool use)
 
void setExtraModulationTarget (Component *component)
 
Component * getExtraModulationTarget ()
 
void setModulationBarRight (bool right)
 
bool isModulationBarRight ()
 
void setDisplayMultiply (float multiply)
 
void setDisplayExponentialBase (float base)
 
void overrideValue (Skin::ValueId value_id, float value)
 
float findValue (Skin::ValueId value_id) const override
 
void setAlternateDisplay (Skin::ValueId id, float value, vital::ValueDetails details)
 
vital::ValueDetailsgetDisplayDetails ()
 
OpenGlComponentgetTextEditorComponent ()
 
- Public Member Functions inherited from OpenGlSlider
 OpenGlSlider (String name)
 
virtual void resized () override
 Called when the component is resized. Updates colors and display values.
 
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
 
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.
 
void setAlpha (float alpha, bool reset=false)
 
void setDrawWhenNotVisible (bool draw)
 
SynthSectiongetSectionParent ()
 

Static Public Attributes

static constexpr int kDefaultFormatLength = 5
 
static constexpr int kDefaultFormatDecimalPlaces = 5
 
static constexpr float kDefaultTextEntryWidthPercent = 0.9f
 
static constexpr float kDefaultTextEntryHeightPercent = 0.35f
 
static constexpr float kModulationSensitivity = 0.003f
 
static constexpr float kTextEntryHeightPercent = 0.6f
 
static constexpr float kSlowDragMultiplier = 0.1f
 
static constexpr float kDefaultSensitivity = 1.0f
 
static constexpr float kDefaultTextHeightPercentage = 0.7f
 
static constexpr float kDefaultRotaryDragLength = 200.0f
 
static constexpr float kRotaryModulationControlPercent = 0.26f
 
static constexpr float kLinearWidthPercent = 0.26f
 
static constexpr float kLinearHandlePercent = 1.2f
 
static constexpr float kLinearModulationPercent = 0.1f
 
- Static Public Attributes inherited from OpenGlSlider
static constexpr float kRotaryAngle = 0.8f * vital::kPi
 The default rotary arc angle used for rotary sliders.
 

Protected Member Functions

PopupItems createPopupMenu ()
 
void setRotaryTextEntryBounds ()
 Sets bounds for text entry in rotary mode.
 
void setLinearTextEntryBounds ()
 Sets bounds for text entry in linear mode.
 
void notifyModulationAmountChanged ()
 Notifies listeners that modulation amount has changed.
 
void notifyModulationRemoved ()
 Notifies listeners that a modulation was removed.
 
void notifyModulationsChanged ()
 Notifies listeners that modulations changed.
 

Protected Attributes

bool show_popup_on_hover_
 
String popup_prefix_
 
String popupSuffix_
 
bool scroll_enabled_
 
bool bipolar_modulation_
 
bool stereo_modulation_
 
bool bypass_modulation_
 
bool modulation_bar_right_
 
Rectangle< int > modulation_area_
 
bool sensitive_mode_
 
bool snap_to_value_
 
bool hovering_
 
bool has_parameter_assignment_
 
bool use_suffix_
 
float snap_value_
 
float text_height_percentage_
 
float knob_size_scale_
 
double sensitivity_
 
BubbleComponent::BubblePlacement popup_placement_
 
BubbleComponent::BubblePlacement modulation_control_placement_
 
int max_display_characters_
 
int max_decimal_places_
 
int shift_index_amount_
 
bool shift_is_multiplicative_
 
double mouse_wheel_index_movement_
 
float text_entry_width_percent_
 
float text_entry_height_percent_
 
std::map< Skin::ValueId, float > value_lookup_
 
Point< int > last_modulation_edit_position_
 
Point< int > mouse_down_position_
 
vital::ValueDetails details_
 
float display_multiply_
 
float display_exponential_base_
 
std::pair< Skin::ValueId, float > alternate_display_setting_
 
vital::ValueDetails alternate_details_
 
const std::string * string_lookup_
 
Component * extra_modulation_target_
 
SynthGuiInterfacesynth_interface_
 
std::unique_ptr< OpenGlTextEditortext_entry_
 
std::vector< SliderListener * > slider_listeners_
 
- Protected Attributes inherited from OpenGlSlider
SynthSectionparent_
 The parent SynthSection.
 

Detailed Description

A specialized slider with extended functionality for modulation, parameter control, popup menus, and text entry.

This class supports various display scales, text entry, popup menus for MIDI learn or clearing modulations, and a wide range of customization. It integrates closely with the synthesizer's parameter architecture.

Member Enumeration Documentation

◆ MenuId

Menu item IDs for the right-click popup menu.

Enumerator
kCancel 
kArmMidiLearn 
kClearMidiLearn 
kDefaultValue 
kManualEntry 
kClearModulations 
kModulationList 

Constructor & Destructor Documentation

◆ SynthSlider()

SynthSlider::SynthSlider ( String name)

Constructor.

Parameters
nameThe name of the slider.

Member Function Documentation

◆ addSliderListener()

void SynthSlider::addSliderListener ( SynthSlider::SliderListener * listener)

Adds a slider listener to receive events.

Parameters
listenerThe listener to add.

◆ createPopupMenu()

PopupItems SynthSlider::createPopupMenu ( )
protected

Creates the popup menu items.

Returns
The popup menu items.

◆ drawRotaryShadow()

void SynthSlider::drawRotaryShadow ( Graphics & g)

Draws a shadow for rotary sliders.

Parameters
gThe graphics context.

◆ drawShadow()

void SynthSlider::drawShadow ( Graphics & g)
virtual

Draws a shadow behind the slider if needed.

Parameters
gThe graphics context.

Reimplemented in InvisibleSlider.

◆ findValue()

float SynthSlider::findValue ( Skin::ValueId value_id) const
inlineoverridevirtual

Gets a Skin value, considering overrides.

Parameters
value_idThe Skin Value ID.
Returns
The found or overridden value.

Reimplemented from OpenGlSlider.

◆ focusLost()

void SynthSlider::focusLost ( FocusChangeType cause)
overridevirtual

◆ formatValue()

String SynthSlider::formatValue ( float value)

Formats the value into a string.

Parameters
valueThe value to format.
Returns
The formatted string.

◆ getAdjustedValue()

double SynthSlider::getAdjustedValue ( double value)

Adjusts a raw slider value to its display scale.

Parameters
valueThe raw value.
Returns
The adjusted value.

◆ getConnections()

std::vector< vital::ModulationConnection * > SynthSlider::getConnections ( )

Gets the modulation connections for this parameter.

Returns
A vector of modulation connections.

◆ getDisplayDetails()

vital::ValueDetails * SynthSlider::getDisplayDetails ( )

Gets the appropriate ValueDetails for display (normal or alternate).

Returns
The ValueDetails currently active.

◆ getExtraModulationTarget()

Component * SynthSlider::getExtraModulationTarget ( )
inline

Gets the extra modulation target component.

Returns
The extra modulation target component.

◆ getKnobSizeScale()

float SynthSlider::getKnobSizeScale ( ) const
inlineoverridevirtual

Provides a scaling factor for the knob size.

Returns
The knob size scale factor.

Reimplemented from OpenGlSlider.

◆ getModulationArea()

Rectangle< int > SynthSlider::getModulationArea ( ) const
inline

Gets the modulation area.

Returns
The modulation area bounds.

◆ getModulationMeterBounds()

Rectangle< int > SynthSlider::getModulationMeterBounds ( ) const

Gets the modulation meter bounds if any.

Returns
The bounds for drawing modulation meters.

◆ getModulationPlacement()

BubbleComponent::BubblePlacement SynthSlider::getModulationPlacement ( )
inline

Gets the current modulation placement.

Returns
The bubble placement.

◆ getPopupPlacement()

BubbleComponent::BubblePlacement SynthSlider::getPopupPlacement ( )
inline

Gets the current popup placement.

Returns
The bubble placement.

◆ getRawTextFromValue()

String SynthSlider::getRawTextFromValue ( double value)

Retrieves the raw text from a value (no formatting).

Parameters
valueThe slider value.
Returns
The raw text representation of the value.

◆ getScalingType()

vital::ValueDetails::ValueScale SynthSlider::getScalingType ( ) const
inline

Gets the scaling type.

Returns
The scaling type.

◆ getSensitivity()

double SynthSlider::getSensitivity ( )
inline

Gets the slider's drag sensitivity.

Returns
The current sensitivity.

◆ getSliderTextFromValue()

String SynthSlider::getSliderTextFromValue ( double value)

Retrieves the slider text from a value, applying formatting and prefix.

Parameters
valueThe slider value.
Returns
The formatted text representation of the value.

◆ getStringLookup()

const std::string * SynthSlider::getStringLookup ( ) const
inline

Gets the string lookup table.

Returns
The lookup table.

◆ getTextEditorComponent()

OpenGlComponent * SynthSlider::getTextEditorComponent ( )
inline

Gets the OpenGL component used for the text editor.

Returns
The text editor's OpenGlComponent.

◆ getTextFromValue()

String SynthSlider::getTextFromValue ( double value)
override

Converts a value to a string representation.

Parameters
valueThe value to convert.
Returns
The text representation of the value.

◆ getTextHeightPercentage()

float SynthSlider::getTextHeightPercentage ( )
inline

Gets the text height percentage.

Returns
The text height percentage.

◆ getUnits()

String SynthSlider::getUnits ( ) const
inline

Gets the display units.

Returns
The units string.

◆ getValueFromAdjusted()

double SynthSlider::getValueFromAdjusted ( double value)

Reverses the adjusted value back to the raw value.

Parameters
valueThe adjusted value.
Returns
The raw value.

◆ getValueFromText()

double SynthSlider::getValueFromText ( const String & text)
override

Converts a string to a slider value.

Parameters
textThe text to parse.
Returns
The value represented by the text.

◆ handlePopupResult()

void SynthSlider::handlePopupResult ( int result)

Handles the result of a popup menu action.

Parameters
resultThe selected menu item ID.

◆ hasModulationArea()

bool SynthSlider::hasModulationArea ( ) const
inline

Checks if the slider has a dedicated modulation area.

Returns
True if modulation area is defined.

◆ hidePopup()

void SynthSlider::hidePopup ( bool primary)

Hides the popup display.

Parameters
primaryIf true, hides primary popup.

◆ isModulationBarRight()

bool SynthSlider::isModulationBarRight ( )
inline

Checks if the modulation bar is on the right side.

Returns
True if modulation bar is on the right.

◆ isModulationBipolar()

bool SynthSlider::isModulationBipolar ( ) const
inline

Checks if the modulation is bipolar.

Returns
True if bipolar modulation.

◆ isModulationBypassed()

bool SynthSlider::isModulationBypassed ( ) const
inline

Checks if modulation is bypassed.

Returns
True if bypassed.

◆ isModulationStereo()

bool SynthSlider::isModulationStereo ( ) const
inline

Checks if the modulation is stereo.

Returns
True if stereo modulation.

◆ mouseDoubleClick()

void SynthSlider::mouseDoubleClick ( const MouseEvent & e)
overridevirtual

◆ mouseDown()

void SynthSlider::mouseDown ( const MouseEvent & e)
overridevirtual

Mouse event overrides for custom behavior.

Reimplemented in ModulationAmountKnob, TempoSelector, TextSelector, and TuningSelector.

◆ mouseDrag()

void SynthSlider::mouseDrag ( const MouseEvent & e)
overridevirtual

◆ mouseEnter()

void SynthSlider::mouseEnter ( const MouseEvent & e)
overridevirtual

◆ mouseExit()

void SynthSlider::mouseExit ( const MouseEvent & e)
overridevirtual

Reimplemented in ModulationAmountKnob.

◆ mouseHovering()

float SynthSlider::mouseHovering ( ) const
inline

Gets whether the mouse is hovering over the slider.

Returns
A value indicating hover state.

◆ mouseUp()

void SynthSlider::mouseUp ( const MouseEvent & e)
overridevirtual

◆ mouseWheelMove()

void SynthSlider::mouseWheelMove ( const MouseEvent & e,
const MouseWheelDetails & wheel )
overridevirtual

Reimplemented in TuningSelector.

◆ notifyGuis()

void SynthSlider::notifyGuis ( )

Notifies GUI listeners of a value change.

◆ notifyModulationAmountChanged()

void SynthSlider::notifyModulationAmountChanged ( )
protected

Notifies listeners that modulation amount has changed.

◆ notifyModulationRemoved()

void SynthSlider::notifyModulationRemoved ( )
protected

Notifies listeners that a modulation was removed.

◆ notifyModulationsChanged()

void SynthSlider::notifyModulationsChanged ( )
protected

Notifies listeners that modulations changed.

◆ overrideValue()

void SynthSlider::overrideValue ( Skin::ValueId value_id,
float value )
inline

Overrides a specific Skin value.

Parameters
value_idThe Skin Value ID.
valueThe overriding value.

◆ parentHierarchyChanged()

void SynthSlider::parentHierarchyChanged ( )
overridevirtual

Called when the parent hierarchy changes, updates references to synthesizer.

Reimplemented in ControlWheel, and TuningSelector.

◆ setAlternateDisplay()

void SynthSlider::setAlternateDisplay ( Skin::ValueId id,
float value,
vital::ValueDetails details )
inline

Sets alternate display settings.

Parameters
idThe Skin Value ID to check.
valueThe value that triggers alternate display.
detailsThe alternate ValueDetails.

◆ setDefaultRange()

void SynthSlider::setDefaultRange ( )

Sets the default parameter range based on the parameter details.

◆ setDisplayExponentialBase()

void SynthSlider::setDisplayExponentialBase ( float base)
inline

Sets the exponential base for display conversions.

Parameters
baseThe exponential base.

◆ setDisplayMultiply()

void SynthSlider::setDisplayMultiply ( float multiply)
inline

Sets a multiplier for display values.

Parameters
multiplyThe multiplier.

◆ setExtraModulationTarget()

void SynthSlider::setExtraModulationTarget ( Component * component)
inline

Sets an extra component to be used as a modulation target.

Parameters
componentThe extra modulation target component.

◆ setKnobSizeScale()

void SynthSlider::setKnobSizeScale ( float scale)
inline

Sets a scale factor for the knob size.

Parameters
scaleThe scale factor.

◆ setLinearTextEntryBounds()

void SynthSlider::setLinearTextEntryBounds ( )
protected

Sets bounds for text entry in linear mode.

◆ setMaxDecimalPlaces()

void SynthSlider::setMaxDecimalPlaces ( int decimal_places)
inline

Sets the maximum decimal places for display.

Parameters
decimal_placesThe max decimal places.

◆ setMaxDisplayCharacters()

void SynthSlider::setMaxDisplayCharacters ( int characters)
inline

Sets the maximum display characters for formatting.

Parameters
charactersThe max characters.

◆ setModulationArea()

void SynthSlider::setModulationArea ( Rectangle< int > area)
inline

Sets the modulation area.

Parameters
areaThe new modulation area.

◆ setModulationBarRight()

void SynthSlider::setModulationBarRight ( bool right)
inline

Sets whether the modulation bar is on the right side (for text/curve).

Parameters
rightTrue if modulation bar should be on the right side.

◆ setModulationPlacement()

void SynthSlider::setModulationPlacement ( BubbleComponent::BubblePlacement placement)
inline

Sets the modulation placement bubble direction.

Parameters
placementThe bubble placement.

◆ setMouseWheelMovement()

void SynthSlider::setMouseWheelMovement ( double movement)
inline

Sets the mouse wheel movement amount for value changes.

Parameters
movementThe new movement increment.

◆ setPopupPlacement()

void SynthSlider::setPopupPlacement ( BubbleComponent::BubblePlacement placement)
inline

Sets the popup placement relative to the slider.

Parameters
placementThe bubble placement.

◆ setPopupPrefix()

void SynthSlider::setPopupPrefix ( String prefix)
inline

Sets a prefix for displayed values in the popup.

Parameters
prefixThe popup prefix string.

◆ setPopupSuffix()

void SynthSlider::setPopupSuffix ( const juce::String & suffix)
inline

◆ setRotaryTextEntryBounds()

void SynthSlider::setRotaryTextEntryBounds ( )
protected

Sets bounds for text entry in rotary mode.

◆ setScalingType()

void SynthSlider::setScalingType ( vital::ValueDetails::ValueScale scaling_type)
inline

Sets the scaling type of the parameter value.

Parameters
scaling_typeThe scaling type (linear, quadratic, etc.).

◆ setScrollEnabled()

void SynthSlider::setScrollEnabled ( bool enabled)
inline

Enables or disables mouse wheel scrolling.

Parameters
enabledTrue to enable scrolling.

◆ setSensitivity()

void SynthSlider::setSensitivity ( double sensitivity)
inline

Sets the slider's drag sensitivity.

Parameters
sensitivityThe new sensitivity.

◆ setShiftIndexAmount()

void SynthSlider::setShiftIndexAmount ( int shift_amount)
inline

Sets an amount by which the index-based parameter changes when shift is held.

Parameters
shift_amountThe shift index amount.

◆ setShowPopupOnHover()

void SynthSlider::setShowPopupOnHover ( bool show)
inline

Sets whether to show a popup on hover.

Parameters
showTrue to show popup on hover.

◆ setSliderPositionFromText()

void SynthSlider::setSliderPositionFromText ( )

Sets the slider position from the current text in the text editor.

◆ setStringLookup()

void SynthSlider::setStringLookup ( const std::string * lookup)
inline

Sets a lookup table for indexed parameters.

Parameters
lookupThe lookup table.

◆ setTextEntrySizePercent()

void SynthSlider::setTextEntrySizePercent ( float width_percent,
float height_percent )
inline

Sets the size of the text entry in percentages of the component's size.

Parameters
width_percentThe width percentage.
height_percentThe height percentage.

◆ setTextEntryWidthPercent()

void SynthSlider::setTextEntryWidthPercent ( float percent)
inline

Sets the width percentage used for text entry height calculation.

Parameters
percentThe height percentage.

◆ setTextHeightPercentage()

void SynthSlider::setTextHeightPercentage ( float percentage)
inline

Sets the text height percentage.

Parameters
percentageThe text height percentage.

◆ setUnits()

void SynthSlider::setUnits ( const String & units)
inline

Sets the display units.

Parameters
unitsThe units string.

◆ setValueFromAdjusted()

void SynthSlider::setValueFromAdjusted ( double value)

Sets the slider value from an adjusted value.

Parameters
valueThe adjusted value.

◆ shouldShowPopup()

virtual bool SynthSlider::shouldShowPopup ( )
inlinevirtual

Determines if a popup should be shown (override for custom logic).

Returns
True if popup should be shown.

Reimplemented in TextSelector.

◆ showPopup()

void SynthSlider::showPopup ( bool primary)

Shows a popup display with the current value.

Parameters
primaryIf true, shows primary popup.

◆ showTextEntry()

void SynthSlider::showTextEntry ( )

Shows the text entry box for manual value entry.

◆ snapToValue()

void SynthSlider::snapToValue ( bool snap,
float value = 0.0 )
inline

Enables or disables snapping to a specific value.

Parameters
snapTrue to enable snapping.
valueThe value to snap to.

◆ snapValue()

double SynthSlider::snapValue ( double attemptedValue,
DragMode dragMode )
overridevirtual

Snaps the slider value to a special value if snap is enabled.

Parameters
attemptedValueThe attempted slider value.
dragModeThe drag mode.
Returns
The snapped value if applicable.

◆ textEditorFocusLost()

void SynthSlider::textEditorFocusLost ( TextEditor & editor)
override

◆ textEditorReturnKeyPressed()

void SynthSlider::textEditorReturnKeyPressed ( TextEditor & editor)
override

◆ textEditorTextChanged()

void SynthSlider::textEditorTextChanged ( TextEditor & )
inlineoverride

TextEditor::Listener overrides for handling text entry.

◆ useSuffix()

void SynthSlider::useSuffix ( bool use)
inline

Uses a suffix (units) in the displayed values.

Parameters
useTrue to use suffix.

◆ valueChanged()

void SynthSlider::valueChanged ( )
overridevirtual

Called when the slider value changes. Notifies GUIs.

Reimplemented from OpenGlSlider.

Reimplemented in TempoSelector, and TuningSelector.

Member Data Documentation

◆ alternate_details_

vital::ValueDetails SynthSlider::alternate_details_
protected

◆ alternate_display_setting_

std::pair<Skin::ValueId, float> SynthSlider::alternate_display_setting_
protected

◆ bipolar_modulation_

bool SynthSlider::bipolar_modulation_
protected

◆ bypass_modulation_

bool SynthSlider::bypass_modulation_
protected

◆ details_

vital::ValueDetails SynthSlider::details_
protected

◆ display_exponential_base_

float SynthSlider::display_exponential_base_
protected

◆ display_multiply_

float SynthSlider::display_multiply_
protected

◆ extra_modulation_target_

Component* SynthSlider::extra_modulation_target_
protected

◆ has_parameter_assignment_

bool SynthSlider::has_parameter_assignment_
protected

◆ hovering_

bool SynthSlider::hovering_
protected

◆ kDefaultFormatDecimalPlaces

int SynthSlider::kDefaultFormatDecimalPlaces = 5
staticconstexpr

◆ kDefaultFormatLength

int SynthSlider::kDefaultFormatLength = 5
staticconstexpr

◆ kDefaultRotaryDragLength

float SynthSlider::kDefaultRotaryDragLength = 200.0f
staticconstexpr

◆ kDefaultSensitivity

float SynthSlider::kDefaultSensitivity = 1.0f
staticconstexpr

◆ kDefaultTextEntryHeightPercent

float SynthSlider::kDefaultTextEntryHeightPercent = 0.35f
staticconstexpr

◆ kDefaultTextEntryWidthPercent

float SynthSlider::kDefaultTextEntryWidthPercent = 0.9f
staticconstexpr

◆ kDefaultTextHeightPercentage

float SynthSlider::kDefaultTextHeightPercentage = 0.7f
staticconstexpr

◆ kLinearHandlePercent

float SynthSlider::kLinearHandlePercent = 1.2f
staticconstexpr

◆ kLinearModulationPercent

float SynthSlider::kLinearModulationPercent = 0.1f
staticconstexpr

◆ kLinearWidthPercent

float SynthSlider::kLinearWidthPercent = 0.26f
staticconstexpr

◆ kModulationSensitivity

float SynthSlider::kModulationSensitivity = 0.003f
staticconstexpr

◆ knob_size_scale_

float SynthSlider::knob_size_scale_
protected

◆ kRotaryModulationControlPercent

float SynthSlider::kRotaryModulationControlPercent = 0.26f
staticconstexpr

◆ kSlowDragMultiplier

float SynthSlider::kSlowDragMultiplier = 0.1f
staticconstexpr

◆ kTextEntryHeightPercent

float SynthSlider::kTextEntryHeightPercent = 0.6f
staticconstexpr

◆ last_modulation_edit_position_

Point<int> SynthSlider::last_modulation_edit_position_
protected

◆ max_decimal_places_

int SynthSlider::max_decimal_places_
protected

◆ max_display_characters_

int SynthSlider::max_display_characters_
protected

◆ modulation_area_

Rectangle<int> SynthSlider::modulation_area_
protected

◆ modulation_bar_right_

bool SynthSlider::modulation_bar_right_
protected

◆ modulation_control_placement_

BubbleComponent::BubblePlacement SynthSlider::modulation_control_placement_
protected

◆ mouse_down_position_

Point<int> SynthSlider::mouse_down_position_
protected

◆ mouse_wheel_index_movement_

double SynthSlider::mouse_wheel_index_movement_
protected

◆ popup_placement_

BubbleComponent::BubblePlacement SynthSlider::popup_placement_
protected

◆ popup_prefix_

String SynthSlider::popup_prefix_
protected

◆ popupSuffix_

String SynthSlider::popupSuffix_
protected

◆ scroll_enabled_

bool SynthSlider::scroll_enabled_
protected

◆ sensitive_mode_

bool SynthSlider::sensitive_mode_
protected

◆ sensitivity_

double SynthSlider::sensitivity_
protected

◆ shift_index_amount_

int SynthSlider::shift_index_amount_
protected

◆ shift_is_multiplicative_

bool SynthSlider::shift_is_multiplicative_
protected

◆ show_popup_on_hover_

bool SynthSlider::show_popup_on_hover_
protected

◆ slider_listeners_

std::vector<SliderListener*> SynthSlider::slider_listeners_
protected

◆ snap_to_value_

bool SynthSlider::snap_to_value_
protected

◆ snap_value_

float SynthSlider::snap_value_
protected

◆ stereo_modulation_

bool SynthSlider::stereo_modulation_
protected

◆ string_lookup_

const std::string* SynthSlider::string_lookup_
protected

◆ synth_interface_

SynthGuiInterface* SynthSlider::synth_interface_
protected

◆ text_entry_

std::unique_ptr<OpenGlTextEditor> SynthSlider::text_entry_
protected

◆ text_entry_height_percent_

float SynthSlider::text_entry_height_percent_
protected

◆ text_entry_width_percent_

float SynthSlider::text_entry_width_percent_
protected

◆ text_height_percentage_

float SynthSlider::text_height_percentage_
protected

◆ use_suffix_

bool SynthSlider::use_suffix_
protected

◆ value_lookup_

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

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