45 const std::vector<Band>&
bands()
const {
102 show_band_curves_ = show;
105 return show_band_curves_;
113 show_disabled_handles_ = show;
116 return show_disabled_handles_;
130 show_readout_ = show;
133 return show_readout_;
144 content_top_pad_ =
px > 0.0f ?
px : 0.0f;
147 return content_top_pad_;
155 return hit_test_band(pos);
164 hover_animation_ =
on;
167 return hover_animation_;
172 return hover_animating_;
190 return analyzer_enabled_;
198 return analyzer_enabled_ && !spectrum_smoothed_.empty();
208 analyzer_scale_draggable_ =
on;
211 return analyzer_scale_draggable_;
222 analyzer_top_db_ = top_db;
223 analyzer_bottom_db_ = bottom_db;
226 return analyzer_top_db_;
229 return analyzer_bottom_db_;
268 record_gestures_ =
on;
271 return record_gestures_;
280 return selected_band_;
283 selected_band_ = index;
289 return hovered_band_;
311 std::vector<Band> bands_;
312 float min_freq_ = 20.0f;
313 float max_freq_ = 20000.0f;
314 float min_db_ = -24.0f;
315 float max_db_ = 24.0f;
316 float sample_rate_ = 48000.0f;
317 bool show_grid_ =
true;
318 bool show_band_curves_ =
true;
319 bool show_disabled_handles_ =
false;
320 bool show_labels_ =
true;
321 bool show_readout_ =
true;
322 float content_top_pad_ = 0.0f;
323 bool hover_animation_ =
false;
324 bool hover_animating_ =
false;
325 std::vector<float> handle_radius_;
326 std::vector<float> spectrum_;
330 std::vector<float> spectrum_smoothed_;
331 int selected_band_ = -1;
332 int dragging_band_ = -1;
333 int hovered_band_ = -1;
336 bool suppress_next_down_ =
false;
341 std::vector<signal::BiquadCoefficients> coefficients_;
344 mutable std::vector<float> curve_db_;
345 mutable std::vector<float> spectrum_db_;
346 mutable std::vector<float> band_db_;
347 mutable std::vector<canvas::Canvas::Point2D> fill_poly_;
350 float analyzer_top_db_ = 0.0f;
351 float analyzer_bottom_db_ = -60.0f;
355 bool analyzer_enabled_ =
true;
356 bool analyzer_scale_draggable_ =
true;
358 bool gutter_hover_ =
false;
359 bool analyzer_drag_active_ =
false;
360 float analyzer_drag_start_y_ = 0.0f;
361 float analyzer_drag_start_top_ = 0.0f;
362 float analyzer_drag_start_bottom_ = 0.0f;
366 std::vector<BandParamIds> band_params_;
367 bool record_gestures_ =
true;
370 bool writing_to_store_ =
false;
375 void rebuild_coefficients();
376 float freq_to_x(
float freq)
const;
377 float x_to_freq(
float x)
const;
378 float db_to_y(
float db)
const;
379 float y_to_db(
float y)
const;
380 int hit_test_band(Point pos)
const;
383 bool point_in_analyzer_gutter(Point pos)
const;
396 std::vector<pulp::state::ListenerToken> param_listener_tokens_;
Definition canvas.hpp:240
Centralized parameter storage with lock-free value access.
Definition store.hpp:164
bool hover_animation() const
Definition eq_curve_view.hpp:166
static Color band_palette_color(size_t index)
bool show_readout() const
Definition eq_curve_view.hpp:132
void on_gesture_event(const GestureEvent &event) override
Gesture event (pinch/rotate from multi-touch or trackpad).
void on_mouse_up(Point pos) override
void set_gain_range(float min_db, float max_db)
bool analyzer_animating() const
Definition eq_curve_view.hpp:197
float min_gain() const
Definition eq_curve_view.hpp:64
void on_hover_move(Point local_pos) override
Pointer moved over this view with no button held, reported in this view's LOCAL coordinates.
void set_show_disabled_handles(bool show)
Definition eq_curve_view.hpp:112
DecibelScale gain_scale() const
void set_show_readout(bool show)
Definition eq_curve_view.hpp:129
LogFrequencyScale frequency_scale() const
void bind_bands(pulp::state::StateStore &store, std::span< const BandParamIds > ids)
void on_mouse_drag(Point pos) override
void set_show_labels(bool show)
Definition eq_curve_view.hpp:120
std::function< void(size_t band_index)> on_band_selected
Definition eq_curve_view.hpp:276
FilterType
Definition eq_curve_view.hpp:26
@ peak
Definition eq_curve_view.hpp:26
@ band_pass
Definition eq_curve_view.hpp:26
@ high_pass
Definition eq_curve_view.hpp:26
@ high_shelf
Definition eq_curve_view.hpp:26
@ notch
Definition eq_curve_view.hpp:26
@ low_shelf
Definition eq_curve_view.hpp:26
@ low_pass
Definition eq_curve_view.hpp:26
float sample_rate() const
Definition eq_curve_view.hpp:76
void set_record_gestures(bool on)
Definition eq_curve_view.hpp:267
void set_analyzer_scale_draggable(bool on)
Definition eq_curve_view.hpp:207
void on_mouse_down(Point pos) override
void set_frequency_range(float min_hz, float max_hz)
void on_mouse_event(const MouseEvent &event) override
Mouse down with full event context.
void set_bands(std::vector< Band > bands)
std::function< void(size_t band_index, Band band)> on_band_changed
Definition eq_curve_view.hpp:275
void set_band(size_t index, const Band &band)
float analyzer_top_db() const
Definition eq_curve_view.hpp:225
void on_mouse_leave() override
float min_frequency() const
Definition eq_curve_view.hpp:58
void set_sample_rate(float sample_rate)
void set_show_grid(bool show)
Definition eq_curve_view.hpp:92
int hit_test_handle(Point pos) const
Definition eq_curve_view.hpp:154
float content_top_padding() const
Definition eq_curve_view.hpp:146
const std::vector< Band > & bands() const
Definition eq_curve_view.hpp:45
void paint(canvas::Canvas &canvas) override
void remove_band(size_t index)
void set_analyzer_enabled(bool on)
bool analyzer_scale_draggable() const
Definition eq_curve_view.hpp:210
bool record_gestures() const
Definition eq_curve_view.hpp:270
bool analyzer_enabled() const
Definition eq_curve_view.hpp:189
void set_spectrum(const float *magnitudes_db, size_t bin_count)
float max_gain() const
Definition eq_curve_view.hpp:67
bool show_labels() const
Definition eq_curve_view.hpp:123
size_t band_count() const
Definition eq_curve_view.hpp:51
void set_analyzer_range(float top_db, float bottom_db)
Definition eq_curve_view.hpp:221
void set_selected_band(int index)
Definition eq_curve_view.hpp:282
float analyzer_bottom_db() const
Definition eq_curve_view.hpp:228
bool hover_animating() const
Definition eq_curve_view.hpp:171
void set_content_top_padding(float px)
Definition eq_curve_view.hpp:143
float max_frequency() const
Definition eq_curve_view.hpp:61
int hovered_band() const
Definition eq_curve_view.hpp:288
void set_hover_animation(bool on)
Definition eq_curve_view.hpp:163
bool show_grid() const
Definition eq_curve_view.hpp:95
bool wants_mouse_input() const override
True if this widget handles mouse down/drag through virtual methods even when it does not expose JS p...
Definition eq_curve_view.hpp:306
float magnitude_db_at(float freq_hz) const
void set_show_band_curves(bool show)
Definition eq_curve_view.hpp:101
float analyzer_db_to_y(float dbfs) const
bool show_disabled_handles() const
Definition eq_curve_view.hpp:115
bool show_band_curves() const
Definition eq_curve_view.hpp:104
int selected_band() const
Definition eq_curve_view.hpp:279
Shared axis mapping for frequency-domain plots.
Definition affine_transform.hpp:24
uint32_t ParamID
Unique parameter identifier, stable across plugin versions.
Definition parameter.hpp:55
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ px
Absolute pixels.
Definition geometry.hpp:393
canvas::Color Color
Definition theme.hpp:12
@ value
the widget's primary value (Knob, Fader, RangeSlider, Toggle, ProgressBar)
Definition binding_diagnostics.hpp:19
@ y
Definition input_events.hpp:42
@ x
Definition input_events.hpp:41
@ on
Definition accessibility.hpp:132
Maps decibels to a vertical pixel position on a linear axis (dB is already logarithmic in amplitude,...
Definition graph_scale.hpp:55
Definition eq_curve_view.hpp:240
pulp::state::ParamID gain
Definition eq_curve_view.hpp:242
pulp::state::ParamID freq
Definition eq_curve_view.hpp:241
pulp::state::ParamID q
Definition eq_curve_view.hpp:243
Definition eq_curve_view.hpp:28
bool enabled
Definition eq_curve_view.hpp:33
float q
Definition eq_curve_view.hpp:31
float frequency
Definition eq_curve_view.hpp:29
float gain_db
Definition eq_curve_view.hpp:30
Color color
Definition eq_curve_view.hpp:38
FilterType type
Definition eq_curve_view.hpp:32
High-level gesture event for pinch (scale) and rotate.
Definition input_events.hpp:181
Maps frequency (Hz) to a horizontal pixel position on a logarithmic axis.
Definition graph_scale.hpp:23
Rich mouse/pointer event with position, modifiers, button state, pointer ID, and stylus properties.
Definition input_events.hpp:104
Definition geometry.hpp:20