34 int total_width = isHorizontal() ? getHeight() : getWidth();
35 int extra = total_width % 2;
41 float radius = 1.0f - 1.0f / getWidth();
42 slider_quad_.
setQuad(0, -radius, -radius, 2.0f * radius, 2.0f * radius);
48 float radius_x = (size + 0.5f) / getWidth();
49 float center_y = 2.0f * offset / getHeight();
50 float radius_y = (size + 0.5f) / getHeight();
51 slider_quad_.
setQuad(0, -radius_x, -center_y - radius_y, 2.0f * radius_x, 2.0f * radius_y);
56 slider_quad_.
setQuad(0, -1.0f + margin, -1.0f, 2.0f - 2.0f * margin, 2.0f);
60 slider_quad_.
setQuad(0, -1.0f, -1.0f + margin, 2.0f, 2.0f - 2.0f * margin);
65 static constexpr float kRoundingMult = 0.4f;
66 static constexpr float kRotaryHoverBoost = 1.4f;
67 if (getWidth() <= 0 || getHeight() <= 0)
72 if (modulation_amount_) {
77 slider_quad_.
setModColor(Colours::transparentBlack);
88 slider_quad_.
setColor(unselected_color_);
93 slider_quad_.
setColor(selected_color_);
97 if (isMouseOverOrDragging())
105 float t = valueToProportionOfLength(getValue());
107 slider_quad_.
setColor(selected_color_);
113 if (isMouseOverOrDragging())
114 thickness *= kRotaryHoverBoost;
117 else if (horizontal || vertical) {
119 float t = valueToProportionOfLength(getValue());
121 slider_quad_.
setColor(selected_color_);
126 int total_width = horizontal ? getHeight() : getWidth();
129 if (isMouseOverOrDragging()) {
130 int boost = std::round(slider_width / 8.0f) + 1.0f;
135 slider_quad_.
setRounding(slider_width * kRoundingMult);
138 else if (!skip_image) {
156 bipolar_modulation_(false), stereo_modulation_(false),
157 bypass_modulation_(false), modulation_bar_right_(true),
158 snap_to_value_(false), hovering_(false),
159 has_parameter_assignment_(false),
160 use_suffix_(true), snap_value_(0.0),
161 text_height_percentage_(0.0f), knob_size_scale_(1.0f),
162 sensitivity_(kDefaultSensitivity),
163 popup_placement_(BubbleComponent::below),
164 modulation_control_placement_(BubbleComponent::below),
165 max_display_characters_(kDefaultFormatLength),
166 max_decimal_places_(kDefaultFormatDecimalPlaces), shift_index_amount_(0),
167 shift_is_multiplicative_(false), mouse_wheel_index_movement_(1.0),
168 text_entry_width_percent_(kDefaultTextEntryWidthPercent),
169 text_entry_height_percent_(kDefaultTextEntryHeightPercent),
170 display_multiply_(0.0f), display_exponential_base_(2.0f),
171 string_lookup_(nullptr), extra_modulation_target_(nullptr),
172 synth_interface_(nullptr) {
173 text_entry_ = std::make_unique<OpenGlTextEditor>(
"text_entry");
179 text_entry_->setKeyboardType(TextEditor::numericKeyboard);
180 text_entry_->setJustification(Justification::centred);
182 text_entry_->getImageComponent()->setAlwaysOnTop(
true);
185 setWantsKeyboardFocus(
true);
186 setTextBoxStyle(Slider::NoTextBox,
true, 0, 0);
200 setVelocityBasedMode(
false);
201 setVelocityModeParameters(1.0, 0, 0.0,
false, ModifierKeys::ctrlAltCommandModifiers);
207 if (isDoubleClickReturnEnabled())
218 std::vector<vital::ModulationConnection*> connections =
getConnections();
219 if (!connections.empty())
222 std::string disconnect =
"Disconnect from ";
223 for (
int i = 0; i < connections.size(); ++i) {
228 if (connections.size() > 1)
237 if (e.mods.isAltDown()) {
242 if (e.mods.isPopupMenu()) {
250 setSliderSnapsToMousePosition(
false);
251 setMouseDragSensitivity(std::max(getWidth(), getHeight()) /
sensitivity_);
254 OpenGlSlider::mouseDown(e);
258 listener->mouseDown(
this);
265 if (e.mods.isAltDown())
268 float multiply = 1.0f;
270 double value = getValue();
277 if (value < min || value > max)
292 setSliderSnapsToMousePosition(
false);
293 setMouseDragSensitivity(std::max(getWidth(), getHeight()) / (
sensitivity_ * multiply));
296 OpenGlSlider::mouseDrag(e);
298 if (!e.mods.isPopupMenu())
303 if (e.mods.isPopupMenu() || e.mods.isAltDown())
307 OpenGlSlider::mouseUp(e);
310 listener->mouseUp(
this);
316 OpenGlSlider::mouseEnter(e);
318 listener->hoverStarted(
this);
328 OpenGlSlider::mouseExit(e);
330 listener->hoverEnded(
this);
338 OpenGlSlider::mouseDoubleClick(e);
339 if (!e.mods.isPopupMenu()) {
341 listener->doubleClick(
this);
347 double interval = getInterval();
352 if (wheel.deltaY > 0.0f)
359 if (wheel.deltaY > 0.0f)
365 OpenGlSlider::mouseWheelMove(e, wheel);
372 listener->focusLost(
this);
382 return OpenGlSlider::getTextFromValue(value);
394 return OpenGlSlider::getTextFromValue(value);
416 String cleaned = text.removeCharacters(
" ").toLowerCase();
418 for (
int i = 0; i <= getMaximum(); ++i) {
424 float t = 0.01f * cleaned.removeCharacters(
"%").getDoubleValue();
425 return (getMaximum() - getMinimum()) * t + getMinimum();
433 double adjusted_value = value;
436 adjusted_value *= adjusted_value;
439 adjusted_value *= adjusted_value * adjusted_value;
442 adjusted_value *= adjusted_value;
443 adjusted_value *= adjusted_value;
449 adjusted_value = sqrtf(std::max(adjusted_value, 0.0));
457 adjusted_value = 1.0 / adjusted_value;
463 return adjusted_value;
469 double readjusted_value = value;
476 readjusted_value = 1.0 / readjusted_value;
481 return sqrtf(std::max(readjusted_value, 0.0));
483 return powf(std::max(readjusted_value, 0.0), 1.0f / 3.0f);
485 return sqrtf(sqrtf(std::max(readjusted_value, 0.0)));
489 return readjusted_value * readjusted_value;
491 return readjusted_value;
505 const double percent = 0.05;
507 return attempted_value;
509 double range = getMaximum() - getMinimum();
510 double radius = percent * range;
513 return attempted_value;
530 listener->menuFinished(
this);
534#if !defined(NO_TEXT_ENTRY)
559 g.fillRoundedRectangle(getBounds().toFloat(), rounding);
566 float center_x = getWidth() / 2.0f;
567 float center_y = getHeight() / 2.0f;
574 PathStrokeType outer_stroke(stroke_width, PathStrokeType::beveled, PathStrokeType::rounded);
575 PathStrokeType shadow_stroke(stroke_width + 1, PathStrokeType::beveled, PathStrokeType::rounded);
578 g.setOrigin(getX(), getY());
582 if (body_radius >= 0.0f && body_radius < getWidth()) {
584 if (shadow_width > 0.0f) {
585 Colour transparent_shadow = shadow_color.withAlpha(0.0f);
586 float shadow_radius = body_radius + shadow_width;
587 ColourGradient shadow_gradient(shadow_color, center_x, center_y + shadow_offset,
588 transparent_shadow, center_x - shadow_radius, center_y + shadow_offset,
true);
589 float shadow_start = std::max(0.0f, (body_radius - std::abs(shadow_offset))) / shadow_radius;
590 shadow_gradient.addColour(shadow_start, shadow_color);
591 shadow_gradient.addColour(1.0f - (1.0f - shadow_start) * 0.75f, shadow_color.withMultipliedAlpha(0.5625f));
592 shadow_gradient.addColour(1.0f - (1.0f - shadow_start) * 0.5f, shadow_color.withMultipliedAlpha(0.25f));
593 shadow_gradient.addColour(1.0f - (1.0f - shadow_start) * 0.25f, shadow_color.withMultipliedAlpha(0.0625f));
594 g.setGradientFill(shadow_gradient);
595 g.fillRect(getLocalBounds());
599 Rectangle<float> ellipse(center_x - body_radius, center_y - body_radius, 2.0f * body_radius, 2.0f * body_radius);
600 g.fillEllipse(ellipse);
603 g.drawEllipse(ellipse.reduced(0.5f), 1.0f);
609 shadow_outline.addCentredArc(center_x, center_y, radius, radius,
611 shadow_stroke.createStrokedPath(shadow_path, shadow_outline);
614 g.setColour(shadow_color);
615 g.fillPath(shadow_path);
647 format = String(value);
650 format = String(std::roundf(value));
655 if (format[0] ==
'-')
656 display_characters += 1;
658 format = format.substring(0, display_characters);
659 if (format.getLastCharacter() ==
'.')
660 format = format.removeCharacters(
".");
670 listener->guiChanged(
this);
674 static constexpr int kTextBarSize = 2;
679 return mod_bounds.removeFromRight(kTextBarSize);
681 return mod_bounds.removeFromLeft(kTextBarSize);
684 return getLocalBounds();
687 if (getSliderStyle() == LinearBar) {
688 return Rectangle<int>(mod_bounds.getX() + buffer, mod_bounds.getY(),
689 mod_bounds.getWidth() - 2 * buffer, mod_bounds.getHeight());
691 return Rectangle<int>(mod_bounds.getX(), mod_bounds.getY() + buffer,
692 mod_bounds.getWidth(), mod_bounds.getHeight() - 2 * buffer);
697 return std::vector<vital::ModulationConnection*>();
705 std::vector<vital::ModulationConnection*> connections =
getConnections();
712 setValue(getDoubleClickReturnValue());
717 std::string source = connection->source_name;
724 std::string source = connections[connection_index]->source_name;
734 float y_offset = 0.0f;
738 text_entry_->setBounds((getWidth() - text_width) / 2, (getHeight() - text_height + 1) / 2 + y_offset,
739 text_width, text_height);
743 static constexpr float kTextEntryWidthRatio = 3.0f;
747 int text_width = text_height * kTextEntryWidthRatio;
749 text_entry_->setBounds((getWidth() - text_width) / 2, (getHeight() - text_height) / 2, text_width, text_height);
754 listener->modulationAmountChanged(
this);
759 listener->modulationRemoved(
this);
764 listener->modulationsChanged(getName().toStdString());
static CurveLookAndFeel * instance()
Gets the singleton instance of CurveLookAndFeel.
Definition curve_look_and_feel.h:52
static String getMenuSourceDisplayName(const String &original)
Returns a user-friendly display name for a given source string in menu context.
Definition modulation_matrix.cpp:513
void setBackgroundColor(const Colour &color)
Sets the background color of the component for painting operations.
Definition open_gl_component.h:242
virtual void init(OpenGlWrapper &open_gl)
Initializes any OpenGL-specific resources needed by the component.
Definition open_gl_component.cpp:148
void setActive(bool active)
Sets whether this component is active (rendered) or not.
Definition open_gl_image_component.h:113
virtual void redrawImage(bool force)
Redraws the image if necessary, creating or updating the internal Image.
Definition open_gl_image_component.cpp:16
void setThickness(float thickness, bool reset=false)
Sets the thickness used by some shaders and can reset to this thickness.
Definition open_gl_multi_quad.h:338
void setActive(bool active)
Activates or deactivates rendering of this component.
Definition open_gl_multi_quad.h:331
void setShaderValue(int i, float shader_value, int value_index=0)
Sets a shader value for all four vertices of a quad.
Definition open_gl_multi_quad.h:254
void setQuad(int i, float x, float y, float w, float h)
Sets the position and size of a quad in normalized device space.
Definition open_gl_multi_quad.h:313
force_inline void setAltColor(Colour color)
Sets an alternate color, often used by custom shaders.
Definition open_gl_multi_quad.h:118
void setFragmentShader(Shaders::FragmentShader shader)
Sets the fragment shader used to render the quads.
Definition open_gl_multi_quad.h:86
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
force_inline void setStartPos(float pos)
Sets a starting position used by some shaders (e.g., arc start).
Definition open_gl_multi_quad.h:150
force_inline void setThumbAmount(float amount)
Sets the amount of thumb exposure (used in certain shader effects).
Definition open_gl_multi_quad.h:142
force_inline float getMaxArc()
Gets the current maximum arc value.
Definition open_gl_multi_quad.h:166
force_inline void setThumbColor(Colour color)
Sets a "thumb" color, potentially for scroll bars or similar widgets.
Definition open_gl_multi_quad.h:134
void setRounding(float rounding)
Sets the rounding radius of the quads.
Definition open_gl_multi_quad.h:347
force_inline void setModColor(Colour color)
Sets a modulation color for custom effects in the shader.
Definition open_gl_multi_quad.h:126
An extended JUCE Slider that leverages OpenGL for rendering.
Definition synth_slider.h:52
bool isRotaryQuad() const
Definition synth_slider.h:117
bool isText() const
Definition synth_slider.h:99
virtual Colour getUnselectedColor() const
Definition synth_slider.h:209
virtual float findValue(Skin::ValueId value_id) const
Definition synth_slider.h:269
virtual float getKnobSizeScale() const
Definition synth_slider.h:164
virtual Colour getModColor() const
Definition synth_slider.h:197
bool isHorizontalQuad() const
Definition synth_slider.h:123
bool isTextOrCurve() const
Definition synth_slider.h:105
virtual Colour getBackgroundColor() const
Definition synth_slider.h:203
virtual void valueChanged() override
Called when the slider value changes. Redraws the image to reflect the new value.
Definition synth_slider.h:80
virtual Colour getThumbColor() const
Definition synth_slider.h:242
void parentHierarchyChanged() override
Called when the parent hierarchy changes. Used for retrieving parent sections.
Definition synth_slider.h:86
void setColors()
Updates internal colors based on the current skin and state.
Definition synth_slider.cpp:144
int getLinearSliderWidth()
Definition synth_slider.cpp:33
void setSliderDisplayValues()
Sets the slider display values (positions, sizes) based on current style.
Definition synth_slider.cpp:39
void redoImage(bool skip_image=false)
Definition synth_slider.cpp:64
virtual Colour getSelectedColor() const
Definition synth_slider.h:223
static constexpr float kRotaryAngle
The default rotary arc angle used for rotary sliders.
Definition synth_slider.h:55
bool isVerticalQuad() const
Definition synth_slider.h:129
bool isModulationKnob() const
Definition synth_slider.h:111
SynthSection * parent_
The parent SynthSection.
Definition synth_slider.h:289
bool isActive() const
Definition synth_slider.h:172
virtual void init(OpenGlWrapper &open_gl) override
Definition synth_slider.cpp:16
void paintBackground(Graphics &g) override
Definition synth_slider.cpp:29
@ kHorizontalSliderFragment
Definition shaders.h:73
@ kRotarySliderFragment
Definition shaders.h:71
@ kModulationKnobFragment
Definition shaders.h:76
@ kVerticalSliderFragment
Definition shaders.h:74
@ kWidgetMargin
Definition skin.h:103
@ kKnobBodySize
Definition skin.h:91
@ kTextComponentFontSize
Definition skin.h:86
@ kKnobArcSize
Definition skin.h:89
@ kTextComponentOffset
Definition skin.h:85
@ kKnobOffset
Definition skin.h:97
@ kKnobHandleLength
Definition skin.h:92
@ kKnobShadowOffset
Definition skin.h:100
@ kWidgetRoundedCorner
Definition skin.h:104
@ kKnobArcThickness
Definition skin.h:90
@ kKnobShadowWidth
Definition skin.h:99
@ kRotaryArcUnselectedDisabled
Definition skin.h:153
@ kRotaryBody
Definition skin.h:155
@ kRotaryBodyBorder
Definition skin.h:156
@ kWidgetBackground
Definition skin.h:173
@ kBodyText
Definition skin.h:133
@ kRotaryArcUnselected
Definition skin.h:152
@ kShadow
Definition skin.h:142
@ kTextEditorSelection
Definition skin.h:203
@ kTextEditorCaret
Definition skin.h:202
A base class providing foundational functionality for the Vital synthesizer’s engine,...
Definition synth_base.h:42
virtual void beginChangeGesture(const std::string &name)
Called when a parameter change gesture begins. Typically not implemented in this base class.
Definition synth_base.h:356
bool isMidiMapped(const std::string &name)
Checks if a given parameter name is MIDI mapped.
Definition synth_base.cpp:677
virtual void endChangeGesture(const std::string &name)
Called when a parameter change gesture ends. Typically not implemented in this base class.
Definition synth_base.h:363
void clearMidiLearn(const std::string &name)
Clears the MIDI mapping for a given parameter name.
Definition synth_base.cpp:673
std::vector< vital::ModulationConnection * > getDestinationConnections(const std::string &destination)
Returns all modulation connections targeting a given destination parameter.
Definition synth_base.cpp:253
void armMidiLearn(const std::string &name)
Arms the given parameter name for MIDI learn, associating the next received MIDI control with it.
Definition synth_base.cpp:665
SynthBase * getSynth()
Returns the SynthBase instance this interface is managing.
Definition synth_gui_interface.h:85
void disconnectModulation(std::string source, std::string destination)
Disconnects a modulation from the GUI layer.
Definition synth_gui_interface.cpp:146
void hidePopupDisplay(bool primary)
Hides the currently shown popup display.
Definition synth_section.cpp:140
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.
Definition synth_section.cpp:119
float findValue(Skin::ValueId value_id) const
Finds a value in the skin overrides or from the parent if not found locally.
Definition synth_section.cpp:18
void showPopupDisplay(Component *source, const std::string &text, BubbleComponent::BubblePlacement placement, bool primary)
Shows a brief popup display (like a tooltip).
Definition synth_section.cpp:133
Listener interface for receiving slider events such as mouse interactions, modulation changes,...
Definition synth_slider.h:347
float snap_value_
Definition synth_slider.h:738
float knob_size_scale_
Definition synth_slider.h:740
double getAdjustedValue(double value)
Definition synth_slider.cpp:430
void textEditorReturnKeyPressed(TextEditor &editor) override
Definition synth_slider.cpp:516
int shift_index_amount_
Definition synth_slider.h:746
virtual bool shouldShowPopup()
Definition synth_slider.h:440
double getValueFromAdjusted(double value)
Definition synth_slider.cpp:466
virtual void parentHierarchyChanged() override
Called when the parent hierarchy changes, updates references to synthesizer.
Definition synth_slider.cpp:499
void setStringLookup(const std::string *lookup)
Definition synth_slider.h:470
BubbleComponent::BubblePlacement popup_placement_
Definition synth_slider.h:742
bool has_parameter_assignment_
Definition synth_slider.h:736
virtual void focusLost(FocusChangeType cause) override
Definition synth_slider.cpp:370
void setLinearTextEntryBounds()
Sets bounds for text entry in linear mode.
Definition synth_slider.cpp:742
virtual void valueChanged() override
Called when the slider value changes. Notifies GUIs.
Definition synth_slider.cpp:375
virtual void mouseDrag(const MouseEvent &e) override
Definition synth_slider.cpp:264
String formatValue(float value)
Definition synth_slider.cpp:644
Rectangle< int > getModulationArea() const
Definition synth_slider.h:560
vital::ValueDetails * getDisplayDetails()
Definition synth_slider.cpp:767
String popup_prefix_
Definition synth_slider.h:725
PopupItems createPopupMenu()
Definition synth_slider.cpp:204
int max_display_characters_
Definition synth_slider.h:744
vital::ValueDetails alternate_details_
Definition synth_slider.h:761
String getRawTextFromValue(double value)
Definition synth_slider.cpp:380
void setRotaryTextEntryBounds()
Sets bounds for text entry in rotary mode.
Definition synth_slider.cpp:730
virtual void mouseDown(const MouseEvent &e) override
Mouse event overrides for custom behavior.
Definition synth_slider.cpp:234
bool shift_is_multiplicative_
Definition synth_slider.h:747
static constexpr float kSlowDragMultiplier
Definition synth_slider.h:334
void setDefaultRange()
Sets the default parameter range based on the parameter details.
Definition synth_slider.cpp:621
SynthSlider(String name)
Definition synth_slider.cpp:155
void textEditorFocusLost(TextEditor &editor) override
Definition synth_slider.cpp:520
float findValue(Skin::ValueId value_id) const override
Definition synth_slider.h:681
String getTextFromValue(double value) override
Definition synth_slider.cpp:404
Rectangle< int > getModulationMeterBounds() const
Definition synth_slider.cpp:673
std::vector< vital::ModulationConnection * > getConnections()
Definition synth_slider.cpp:695
void notifyModulationAmountChanged()
Notifies listeners that modulation amount has changed.
Definition synth_slider.cpp:752
static constexpr float kLinearWidthPercent
Definition synth_slider.h:341
String getSliderTextFromValue(double value)
Definition synth_slider.cpp:387
double mouse_wheel_index_movement_
Definition synth_slider.h:748
bool show_popup_on_hover_
Definition synth_slider.h:724
float text_entry_width_percent_
Definition synth_slider.h:749
void addSliderListener(SliderListener *listener)
Definition synth_slider.cpp:631
void notifyModulationRemoved()
Notifies listeners that a modulation was removed.
Definition synth_slider.cpp:757
float display_exponential_base_
Definition synth_slider.h:758
void hidePopup(bool primary)
Definition synth_slider.cpp:640
virtual void mouseExit(const MouseEvent &e) override
Definition synth_slider.cpp:327
void handlePopupResult(int result)
Definition synth_slider.cpp:703
double sensitivity_
Definition synth_slider.h:741
int max_decimal_places_
Definition synth_slider.h:745
virtual double snapValue(double attemptedValue, DragMode dragMode) override
Definition synth_slider.cpp:504
void showPopup(bool primary)
Definition synth_slider.cpp:635
virtual void mouseUp(const MouseEvent &e) override
Definition synth_slider.cpp:302
std::unique_ptr< OpenGlTextEditor > text_entry_
Definition synth_slider.h:767
static constexpr float kDefaultRotaryDragLength
Definition synth_slider.h:338
SynthGuiInterface * synth_interface_
Definition synth_slider.h:766
bool snap_to_value_
Definition synth_slider.h:734
bool scroll_enabled_
Definition synth_slider.h:727
virtual void mouseEnter(const MouseEvent &e) override
Definition synth_slider.cpp:315
virtual void mouseDoubleClick(const MouseEvent &e) override
Definition synth_slider.cpp:337
bool modulation_bar_right_
Definition synth_slider.h:731
float display_multiply_
Definition synth_slider.h:757
void showTextEntry()
Shows the text entry box for manual value entry.
Definition synth_slider.cpp:533
void notifyGuis()
Notifies GUI listeners of a value change.
Definition synth_slider.cpp:668
virtual void mouseWheelMove(const MouseEvent &e, const MouseWheelDetails &wheel) override
Definition synth_slider.cpp:346
String popupSuffix_
Definition synth_slider.h:726
bool hovering_
Definition synth_slider.h:735
void setSliderPositionFromText()
Sets the slider position from the current text in the text editor.
Definition synth_slider.cpp:524
std::vector< SliderListener * > slider_listeners_
Definition synth_slider.h:769
static constexpr float kTextEntryHeightPercent
Definition synth_slider.h:332
bool use_suffix_
Definition synth_slider.h:737
std::pair< Skin::ValueId, float > alternate_display_setting_
Definition synth_slider.h:760
@ kDefaultValue
Definition synth_slider.h:321
@ kClearModulations
Definition synth_slider.h:323
@ kModulationList
Definition synth_slider.h:324
@ kClearMidiLearn
Definition synth_slider.h:320
@ kManualEntry
Definition synth_slider.h:322
@ kArmMidiLearn
Definition synth_slider.h:319
void notifyModulationsChanged()
Notifies listeners that modulations changed.
Definition synth_slider.cpp:762
double getValueFromText(const String &text) override
Definition synth_slider.cpp:415
vital::ValueDetails details_
Definition synth_slider.h:756
bool sensitive_mode_
Definition synth_slider.h:733
virtual void drawShadow(Graphics &g)
Definition synth_slider.cpp:553
void setValueFromAdjusted(double value)
Definition synth_slider.cpp:495
void drawRotaryShadow(Graphics &g)
Definition synth_slider.cpp:563
const std::string * string_lookup_
Definition synth_slider.h:763
static constexpr float kLinearHandlePercent
Definition synth_slider.h:342
static const bool isParameter(const std::string &name)
Definition synth_parameters.h:220
static const ValueDetails & getDetails(const std::string &name)
Definition synth_parameters.h:200
#define VITAL_ASSERT(x)
Definition common.h:11
force_inline int iclamp(int value, int min_val, int max_val)
Clamps an integer between [min_val, max_val].
Definition utils.h:250
force_inline poly_float clamp(poly_float value, mono_float min, mono_float max)
Clamps each lane of a vector to [min, max].
Definition poly_utils.h:306
force_inline poly_float interpolate(poly_float from, poly_float to, mono_float t)
Performs a linear interpolation between two poly_floats using a scalar t in [0..1].
Definition poly_utils.h:182
constexpr mono_float kPi
Pi constant.
Definition common.h:36
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174
A structure representing a single modulation connection between a modulation source and a destination...
Definition synth_types.h:30
Holds metadata about a single parameter (control) in the Vital synthesizer.
Definition synth_parameters.h:23
mono_float max
Maximum parameter value.
Definition synth_parameters.h:41
mono_float display_multiply
Multiplier for converting internal values to display units.
Definition synth_parameters.h:44
bool display_invert
If true, invert the displayed value range.
Definition synth_parameters.h:46
mono_float post_offset
Offset applied after scaling (for certain scale types).
Definition synth_parameters.h:43
@ kQuartic
Parameter value transformed by a quartic curve.
Definition synth_parameters.h:33
@ kSquareRoot
Parameter value transformed by a square root function.
Definition synth_parameters.h:34
@ kCubic
Parameter value transformed by a cubic curve.
Definition synth_parameters.h:32
@ kExponential
Parameter value transformed by an exponential function.
Definition synth_parameters.h:35
@ kIndexed
Parameter steps through discrete indexed values.
Definition synth_parameters.h:29
@ kQuadratic
Parameter value transformed by a quadratic curve.
Definition synth_parameters.h:31
mono_float min
Minimum parameter value.
Definition synth_parameters.h:40
std::string display_name
Human-readable name for display in UI.
Definition synth_parameters.h:48
std::string local_description
Local description or additional metadata.
Definition synth_parameters.h:50
const std::string * string_lookup
Optional lookup table for indexed parameter names.
Definition synth_parameters.h:49
mono_float default_value
Default value for the parameter.
Definition synth_parameters.h:42
ValueScale value_scale
The scaling mode of the parameter value.
Definition synth_parameters.h:45
std::string display_units
Units to display next to the parameter (e.g., "Hz", "dB").
Definition synth_parameters.h:47
Declares the SynthSlider and related classes, providing various slider styles and functionality in th...