28 static constexpr float kMinDb = -80.0f;
30 static constexpr float kMaxDb = 0.0f;
101 void mouseDown(
const MouseEvent& e)
override;
113 void mouseMove(
const MouseEvent& e)
override;
119 void mouseDrag(
const MouseEvent& e)
override;
125 void mouseUp(
const MouseEvent& e)
override;
131 void mouseExit(
const MouseEvent& e)
override;
221 bool isRatio(DragPoint drag_point) {
222 return drag_point == kLowLowerRatio || drag_point == kBandLowerRatio || drag_point == kHighLowerRatio ||
223 drag_point == kLowUpperRatio || drag_point == kBandUpperRatio || drag_point == kHighUpperRatio;
236 void setThresholdPositions(
int low_start,
int low_end,
int band_start,
int band_end,
237 int high_start,
int high_end,
float ratio_match);
249 void setRatioLines(
int start_index,
int start_x,
int end_x,
float threshold,
float ratio,
bool upper,
bool hover);
260 void setRatioLinePositions(
int low_start,
int low_end,
int band_start,
int band_end,
261 int high_start,
int high_end);
273 void renderHover(
OpenGlWrapper& open_gl,
int low_start,
int low_end,
274 int band_start,
int band_end,
int high_start,
int high_end);
281 void setLowUpperThreshold(
float db,
bool clamp);
282 void setBandUpperThreshold(
float db,
bool clamp);
283 void setHighUpperThreshold(
float db,
bool clamp);
284 void setLowLowerThreshold(
float db,
bool clamp);
285 void setBandLowerThreshold(
float db,
bool clamp);
286 void setHighLowerThreshold(
float db,
bool clamp);
292 void setLowUpperRatio(
float ratio);
293 void setBandUpperRatio(
float ratio);
294 void setHighUpperRatio(
float ratio);
295 void setLowLowerRatio(
float ratio);
296 void setBandLowerRatio(
float ratio);
297 void setHighLowerRatio(
float ratio);
304 String formatValue(
float value);
311 DragPoint getHoverPoint(
const MouseEvent& e);
318 float getYForDb(
float db);
329 float getCompressedDb(
float input_db,
float upper_threshold,
float upper_ratio,
330 float lower_threshold,
float lower_ratio);
337 Colour getColorForRatio(
float ratio);
343 Point<int> last_mouse_position_;
351 float low_upper_threshold_;
352 float band_upper_threshold_;
353 float high_upper_threshold_;
354 float low_lower_threshold_;
355 float band_lower_threshold_;
356 float high_lower_threshold_;
358 float low_upper_ratio_;
359 float band_upper_ratio_;
360 float high_upper_ratio_;
361 float low_lower_ratio_;
362 float band_lower_ratio_;
363 float high_lower_ratio_;
376 bool high_band_active_;
377 bool low_band_active_;
A graphical interface component for editing a multiband compressor's thresholds and ratios.
Definition compressor_editor.h:22
void mouseUp(const MouseEvent &e) override
Handles mouse up events.
Definition compressor_editor.cpp:269
static constexpr float kMouseMultiplier
General multiplier for mouse-drag edits.
Definition compressor_editor.h:60
static constexpr int kMaxBands
Maximum number of bands supported.
Definition compressor_editor.h:63
CompressorEditor()
Constructs a new CompressorEditor.
Definition compressor_editor.cpp:84
void destroy(OpenGlWrapper &open_gl) override
Destroys and cleans up OpenGL-related objects.
Definition compressor_editor.cpp:532
static constexpr float kMinLowerRatio
Minimum ratio value for the lower ratio segments.
Definition compressor_editor.h:40
void mouseDown(const MouseEvent &e) override
Handles mouse down events.
Definition compressor_editor.cpp:166
void mouseDrag(const MouseEvent &e) override
Handles mouse drag events.
Definition compressor_editor.cpp:207
static constexpr float kGrabRadius
Grab radius in pixels for clickable points (thresholds, ratio handles).
Definition compressor_editor.h:25
static constexpr float kMinUpperRatio
Minimum ratio value for the upper ratio segments.
Definition compressor_editor.h:44
static constexpr int kTotalRatioLines
Total number of ratio lines drawn for all bands.
Definition compressor_editor.h:74
static constexpr float kCompressorAreaBuffer
Buffer area around the compressor visualization.
Definition compressor_editor.h:52
static constexpr float kMaxEditDb
Maximum editable dB value (slightly below kMaxDb).
Definition compressor_editor.h:37
static constexpr float kMinDb
Minimum decibel value displayed in the compressor editor.
Definition compressor_editor.h:28
static constexpr float kMinEditDb
Minimum editable dB value (slightly above kMinDb).
Definition compressor_editor.h:35
void renderCompressor(OpenGlWrapper &open_gl, bool animate)
Renders the compressor-specific elements.
Definition compressor_editor.cpp:438
void resized() override
Called when the component is resized.
Definition compressor_editor.cpp:292
static constexpr int kDbLineSections
Number of dB line sections in the display.
Definition compressor_editor.h:68
static constexpr int kExtraDbLines
Extra dB lines to draw for extended resolution.
Definition compressor_editor.h:70
static constexpr int kRatioDbLines
Total number of dB lines for ratio calculations.
Definition compressor_editor.h:72
void setActive(bool active)
Sets the active state of the entire compressor editor.
Definition compressor_editor.h:192
static constexpr float kBarWidth
Width of the displayed bars relative to the component width.
Definition compressor_editor.h:54
void init(OpenGlWrapper &open_gl) override
Initializes the OpenGL context and related objects.
Definition compressor_editor.cpp:301
void setSizeRatio(float ratio)
Sets the size ratio, scaling the display proportionally.
Definition compressor_editor.h:168
void setAllValues(vital::control_map &controls)
Sets all threshold and ratio values from a given control map.
Definition compressor_editor.cpp:541
static constexpr float kRatioEditMultiplier
Multiplier applied to ratio edits for finer control.
Definition compressor_editor.h:49
virtual ~CompressorEditor()
Destructor.
Definition compressor_editor.cpp:128
static constexpr float kInputLineRadius
Radius for input line rendering in normalized coordinates.
Definition compressor_editor.h:57
static constexpr float kMaxLowerRatio
Maximum ratio value for the lower ratio segments.
Definition compressor_editor.h:42
static constexpr float kMaxDb
Maximum decibel value displayed in the compressor editor.
Definition compressor_editor.h:30
static constexpr float kMaxUpperRatio
Maximum ratio value for the upper ratio segments.
Definition compressor_editor.h:46
void parentHierarchyChanged() override
Called when the component's parent hierarchy changes, used for initialization.
Definition compressor_editor.cpp:696
void setHighBandActive(bool active)
Sets the activity state of the high band.
Definition compressor_editor.h:180
void paintBackground(Graphics &g) override
Draws the background of the editor.
Definition compressor_editor.cpp:281
void mouseDoubleClick(const MouseEvent &e) override
Handles mouse double-click events.
Definition compressor_editor.cpp:171
void mouseMove(const MouseEvent &e) override
Handles mouse move events (primarily used for updating hover state).
Definition compressor_editor.cpp:198
void mouseExit(const MouseEvent &e) override
Handles mouse exit events.
Definition compressor_editor.cpp:276
static constexpr float kDbEditBuffer
Decibel buffer around the min and max dB edit range.
Definition compressor_editor.h:33
void render(OpenGlWrapper &open_gl, bool animate) override
Renders the compressor visualization.
Definition compressor_editor.cpp:310
void setLowBandActive(bool active)
Sets the activity state of the low band.
Definition compressor_editor.h:186
static constexpr int kNumChannels
Number of channels (2 channels per band).
Definition compressor_editor.h:65
A base component class that integrates JUCE's Component with OpenGL rendering.
Definition open_gl_component.h:20
A component for rendering multiple quads using OpenGL, with customizable colors, rounding,...
Definition open_gl_multi_quad.h:16
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
An interface class linking the Vital synthesizer backend (SynthBase) with a GUI.
Definition synth_gui_interface.h:56
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
Listener interface for receiving slider events such as mouse interactions, modulation changes,...
Definition synth_slider.h:347
A helper class to track the "status" of a particular Output as a poly_float value.
Definition synth_module.h:35
std::map< std::string, Value * > control_map
Maps parameter names to Value pointers representing synth control parameters.
Definition synth_types.h:214
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...
Declares the SynthSlider and related classes, providing various slider styles and functionality in th...