Vital
|
An extended JUCE Slider that leverages OpenGL for rendering. More...
#include <synth_slider.h>
Public Member Functions | |
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 |
OpenGlComponent * | getImageComponent () |
OpenGlComponent * | getQuadComponent () |
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) |
SynthSection * | getSectionParent () |
Static Public Attributes | |
static constexpr float | kRotaryAngle = 0.8f * vital::kPi |
The default rotary arc angle used for rotary sliders. | |
Protected Attributes | |
SynthSection * | parent_ |
The parent SynthSection. | |
An extended JUCE Slider that leverages OpenGL for rendering.
This slider can be rendered as a rotary knob, a horizontal bar, a vertical bar, or a modulation knob. It integrates with the Vital skin system to determine colors, dimensions, and other style parameters. It can also display an OpenGL-based image component or quad for custom appearances.
|
inline |
Constructor.
name | The name of the slider. |
|
inlinevirtual |
Finds a skin value from the parent component.
value_id | The skin value ID. |
Reimplemented in SynthSlider.
|
inlinevirtual |
Gets the background color.
|
inline |
Gets the image component (if used).
|
inlinevirtual |
Provides a scaling factor for the knob size.
Reimplemented in SynthSlider.
int OpenGlSlider::getLinearSliderWidth | ( | ) |
Computes the width of the slider track for linear sliders.
|
inlinevirtual |
Gets the color used for modulation displays.
|
inline |
Gets the current modulation amount.
|
inline |
Gets the quad component used for rendering the slider (if used).
|
inline |
Gets the parent SynthSection if available.
|
inlinevirtual |
Gets the color for the selected portion of the slider.
Reimplemented in ModulationAmountKnob.
|
inlinevirtual |
|
inlinevirtual |
Gets the color for the unselected portion of the slider.
Reimplemented in ModulationAmountKnob.
|
inline |
Checks if the slider is active.
|
inline |
Checks if the slider is bipolar (centered at zero).
|
inline |
Checks if the slider should use a horizontal quad OpenGL rendering.
|
inline |
Checks if the slider is a modulation knob type.
|
inline |
Checks if the slider should use a rotary quad OpenGL rendering.
|
inline |
Checks if the slider uses text-based rendering.
|
inline |
Checks if the slider uses either text or curve look-and-feel.
|
inline |
Checks if the slider should use a vertical quad OpenGL rendering.
|
inline |
Toggles whether the slider should paint into an image before rendering.
paint | If true, paints to an offscreen image; otherwise paints directly. |
|
inlineoverride |
Called when the parent hierarchy changes. Used for retrieving parent sections.
void OpenGlSlider::redoImage | ( | bool | skip_image = false | ) |
Redraws the slider image or quad.
skip_image | If true, skips redrawing the image component. |
|
inlineoverridevirtual |
Called when the component is resized. Updates colors and display values.
|
inline |
Sets the slider as active or inactive.
active | True if active, false otherwise. |
|
inline |
Sets an alpha value for the slider quad rendering.
alpha | The alpha value. |
reset | If true, resets alpha animations. |
|
inline |
Sets the slider to be bipolar.
bipolar | True if the slider should be bipolar. |
void OpenGlSlider::setColors | ( | ) |
Updates internal colors based on the current skin and state.
|
inline |
Forces the quad to draw even when not visible.
draw | True to always draw. |
|
inline |
Sets the maximum arc for a rotary slider.
arc | The maximum arc in radians. |
|
inline |
Sets the amount of modulation applied to the slider.
modulation | The modulation amount. |
|
inline |
Marks this slider as a modulation knob.
void OpenGlSlider::setSliderDisplayValues | ( | ) |
Sets the slider display values (positions, sizes) based on current style.
|
inlineoverridevirtual |
Called when the slider value changes. Redraws the image to reflect the new value.
Reimplemented in SynthSlider, TempoSelector, and TuningSelector.
|
staticconstexpr |
The default rotary arc angle used for rotary sliders.
|
protected |
The parent SynthSection.