82 drag_circle_.setBounds(getLocalBounds());
83 hover_circle_.setBounds(getLocalBounds());
84 grid_lines_.setBounds(getLocalBounds());
85 sub_grid_lines_.setBounds(getLocalBounds());
86 position_circle_.setBounds(getLocalBounds());
87 point_circles_.setBounds(getLocalBounds());
88 power_circles_.setBounds(getLocalBounds());
92 times_[i]->setTextSize(font_height);
95 reset_positions_ =
true;
141 void mouseMove(
const MouseEvent& e)
override;
142 void mouseExit(
const MouseEvent& e)
override;
143 void mouseDown(
const MouseEvent& e)
override;
144 void mouseDrag(
const MouseEvent& e)
override;
146 void mouseUp(
const MouseEvent& e)
override;
153 void mouseWheelMove(
const MouseEvent& e,
const MouseWheelDetails& wheel)
override;
194 void setEditingCircleBounds();
199 void setGridPositions();
204 void setTimePositions();
209 void setPointPositions();
214 void setGlPositions();
225 void zoom(
float amount);
234 static std::pair<vital::Output*, vital::Output*> getOutputs(
const vital::output_map& mono_modulations,
236 const String& name) {
238 mono_modulations.at(name.toStdString()),
239 poly_modulations.at(name.toStdString())
249 vital::poly_float getOutputsTotal(std::pair<vital::Output*, vital::Output*> outputs,
264 std::pair<float, float> getPosition(
int index);
269 float unpadX(
float x);
270 float unpadY(
float y);
271 float padOpenGlX(
float x);
272 float padOpenGlY(
float y);
275 float getSliderDelayX();
276 float getSliderAttackX();
277 float getSliderHoldX();
278 float getSliderDecayX();
279 float getSliderSustainY();
280 float getSliderReleaseX();
281 float getDelayTime(
int index);
282 float getAttackTime(
int index);
283 float getHoldTime(
int index);
284 float getDecayTime(
int index);
285 float getReleaseTime(
int index);
286 float getDelayX(
int index);
287 float getAttackX(
int index);
288 float getHoldX(
int index);
289 float getDecayX(
int index);
290 float getSustainY(
int index);
291 float getReleaseX(
int index);
293 float getBackupPhase(
float phase,
int index);
295 float getEnvelopeValue(
float t,
float power,
float start,
float end);
296 float getSliderAttackValue(
float t);
297 float getSliderDecayValue(
float t);
298 float getSliderReleaseValue(
float t);
299 float getAttackValue(
float t,
int index);
300 float getDecayValue(
float t,
int index);
301 float getReleaseValue(
float t,
int index);
304 void setDelayX(
float x);
305 void setAttackX(
float x);
306 void setHoldX(
float x);
307 void setDecayX(
float x);
308 void setSustainY(
float y);
309 void setReleaseX(
float x);
312 void setAttackPower(
float power);
313 void setDecayPower(
float power);
314 void setReleasePower(
float power);
322 bool attack_power_hover_;
323 bool decay_power_hover_;
324 bool release_power_hover_;
326 Point<float> last_edit_position_;
335 Colour line_left_color_;
336 Colour line_right_color_;
337 Colour line_center_color_;
338 Colour fill_left_color_;
339 Colour fill_right_color_;
340 Colour background_color_;
343 bool reset_positions_;
365 std::pair<vital::Output*, vital::Output*> delay_outputs_;
366 std::pair<vital::Output*, vital::Output*> attack_outputs_;
367 std::pair<vital::Output*, vital::Output*> hold_outputs_;
368 std::pair<vital::Output*, vital::Output*> decay_outputs_;
369 std::pair<vital::Output*, vital::Output*> sustain_outputs_;
370 std::pair<vital::Output*, vital::Output*> release_outputs_;
A graphical editor for envelope shapes with interactive points and power curves.
Definition envelope_editor.h:19
void setDecayPowerSlider(SynthSlider *decay_slider)
Definition envelope_editor.cpp:590
static constexpr int kNumSections
Number of envelope sections (e.g., Delay->Attack->Hold->Decay->Release mapped to 4 sections plus 1 ex...
Definition envelope_editor.h:53
void parentHierarchyChanged() override
Called when the component’s parent hierarchy changes.
Definition envelope_editor.cpp:105
void mouseDrag(const MouseEvent &e) override
Definition envelope_editor.cpp:204
void mouseWheelMove(const MouseEvent &e, const MouseWheelDetails &wheel) override
Handles mouse wheel events for zooming.
Definition envelope_editor.cpp:244
static constexpr int kTotalPoints
Total number of points for the entire envelope line.
Definition envelope_editor.h:55
void setAttackPowerSlider(SynthSlider *attack_slider)
Definition envelope_editor.cpp:580
void resetEnvelopeLine(int index)
Resets the envelope line for a given voice index.
Definition envelope_editor.cpp:620
static constexpr float kRingThickness
Thickness fraction for the marker rings.
Definition envelope_editor.h:24
void render(OpenGlWrapper &open_gl, bool animate) override
Renders the envelope using OpenGL.
Definition envelope_editor.cpp:735
static constexpr int kNumPointsPerSection
Number of points per envelope section.
Definition envelope_editor.h:51
static constexpr float kTailDecay
Decay factor for tail end animations.
Definition envelope_editor.h:32
~EnvelopeEditor()
Destructor.
Definition envelope_editor.cpp:96
void setHoldSlider(SynthSlider *hold_slider)
Definition envelope_editor.cpp:575
void setSustainSlider(SynthSlider *sustain_slider)
Definition envelope_editor.cpp:595
void init(OpenGlWrapper &open_gl) override
Initializes OpenGL resources.
Definition envelope_editor.cpp:721
void mouseMove(const MouseEvent &e) override
Mouse event callbacks for interactions.
Definition envelope_editor.cpp:181
static constexpr float kTimeDisplaySize
Display size ratio for time text.
Definition envelope_editor.h:42
void mouseDown(const MouseEvent &e) override
Definition envelope_editor.cpp:198
void setDecaySlider(SynthSlider *decay_slider)
Definition envelope_editor.cpp:585
static constexpr float kPaddingX
Horizontal padding ratio for the display.
Definition envelope_editor.h:34
static constexpr int kMaxGridLines
Maximum number of grid lines displayed.
Definition envelope_editor.h:47
EnvelopeEditor(const String &prefix, const vital::output_map &mono_modulations, const vital::output_map &poly_modulations)
Constructs an EnvelopeEditor.
Definition envelope_editor.cpp:29
static constexpr float kMarkerGrabRadius
Radius in pixels for grabbing markers.
Definition envelope_editor.h:30
static constexpr int kMaxTimesShown
Maximum number of time markers shown.
Definition envelope_editor.h:49
void mouseDoubleClick(const MouseEvent &e) override
Definition envelope_editor.cpp:230
void setReleasePowerSlider(SynthSlider *release_slider)
Definition envelope_editor.cpp:605
void guiChanged(SynthSlider *slider) override
Called when a slider value changes.
Definition envelope_editor.cpp:272
void magnifyZoom(Point< float > delta)
Zooms the envelope display via magnification (e.g., pinch gestures).
Definition envelope_editor.cpp:250
void mouseUp(const MouseEvent &e) override
Definition envelope_editor.cpp:239
void setReleaseSlider(SynthSlider *release_slider)
Definition envelope_editor.cpp:600
void pickHoverPosition(Point< float > position)
Determines hover state based on mouse position.
Definition envelope_editor.cpp:119
void setAttackSlider(SynthSlider *attack_slider)
Definition envelope_editor.cpp:570
void resized() override
Resized callback to layout and reposition components.
Definition envelope_editor.h:80
static constexpr float kMarkerWidth
Width in pixels of the main markers (ADHSR points).
Definition envelope_editor.h:22
static constexpr float kPowerMouseMultiplier
Multiplier for mouse movements when adjusting power.
Definition envelope_editor.h:40
void magnifyReset()
Resets the magnification zoom to a default level.
Definition envelope_editor.cpp:256
static constexpr float kMinPointDistanceForPower
Minimum point distance for enabling power handle editing.
Definition envelope_editor.h:38
void setDelaySlider(SynthSlider *delay_slider)
Sets the sliders corresponding to different envelope parameters.
Definition envelope_editor.cpp:565
void resetPositions()
Flags that the positions need to be reset and recalculated.
Definition envelope_editor.h:188
void destroy(OpenGlWrapper &open_gl) override
Destroys the OpenGL resources.
Definition envelope_editor.cpp:842
void mouseExit(const MouseEvent &e) override
Definition envelope_editor.cpp:186
void paintBackground(Graphics &g) override
Paints the background of the editor.
Definition envelope_editor.cpp:98
static constexpr int kRulerDivisionSize
Division size for major time ruler lines.
Definition envelope_editor.h:45
static constexpr float kMarkerHoverRadius
Radius in pixels for hovering detection over markers.
Definition envelope_editor.h:28
static constexpr float kPaddingY
Vertical padding ratio for the display.
Definition envelope_editor.h:36
void setSizeRatio(float ratio)
Sets the size ratio for UI scaling.
Definition envelope_editor.h:125
static constexpr float kPowerMarkerWidth
Width in pixels of the power markers (for adjusting curve power).
Definition envelope_editor.h:26
virtual void resized() override
Called when the component is resized.
Definition open_gl_component.cpp:121
A component for rendering lines with optional filling and boost effects using OpenGL.
Definition open_gl_line_renderer.h:16
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
Listener interface for receiving slider events such as mouse interactions, modulation changes,...
Definition synth_slider.h:347
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
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, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
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...