13 padding_(0), num_positions_(num_positions), position_(0), drag_start_x_(0) {
28 float active_width = getWidth() - 2 *
padding_ + 1;
42 float active_width = getWidth() - 2 *
padding_ + 1;
49 float active_width = getWidth() - 2 *
padding_ + 1;
52 int small_line_height = getHeight() / 3;
53 int big_line_height = 2 * small_line_height;
57 g.fillRect(x, getHeight() - big_line_height, 1, big_line_height);
59 g.fillRect(x, getHeight() - small_line_height, 1, small_line_height);
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
Manages and provides access to vertex and fragment shaders used by the OpenGL rendering pipeline.
Definition shaders.h:19
@ kWidgetPrimary1
Definition skin.h:165
@ kLightenScreen
Definition skin.h:141
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
virtual void resized() override
Called when the component is resized. Arranges layout of child components.
Definition synth_section.cpp:35
void addOpenGlComponent(OpenGlComponent *open_gl_component, bool to_beginning=false)
Definition synth_section.cpp:489
A listener interface for objects interested in playhead position changes.
Definition wavetable_playhead.h:31
void mouseDrag(const MouseEvent &event) override
Handles mouse drag events, moving the playhead position accordingly.
Definition wavetable_playhead.cpp:37
void setPositionQuad()
Updates the visual position of the playhead quad based on the current position and size.
Definition wavetable_playhead.cpp:27
void resized() override
Called when the component is resized, updates the playhead position display.
Definition wavetable_playhead.cpp:66
static constexpr int kLineSkip
Definition wavetable_playhead.h:23
int num_positions_
Total number of positions (frames) available.
Definition wavetable_playhead.h:114
void paintBackground(Graphics &g) override
Paints the background ticks and line indicators for the playhead.
Definition wavetable_playhead.cpp:48
std::vector< Listener * > listeners_
Registered listeners to notify on position changes.
Definition wavetable_playhead.h:111
void mouseEvent(const MouseEvent &event)
Internal method for handling mouse events to change playhead position.
Definition wavetable_playhead.cpp:41
WavetablePlayhead(int num_positions)
Constructs a WavetablePlayhead.
Definition wavetable_playhead.cpp:11
int position()
Gets the current playhead position.
Definition wavetable_playhead.h:52
void setPosition(int position)
Sets the playhead to a specific position.
Definition wavetable_playhead.cpp:17
static constexpr int kBigLineSkip
Used to determine which ticks are larger (every kBigLineSkip) and which are smaller (every kLineSkip)...
Definition wavetable_playhead.h:22
float padding_
Extra horizontal padding for the display area.
Definition wavetable_playhead.h:113
OpenGlQuad position_quad_
The visual quad representing the playhead line.
Definition wavetable_playhead.h:109
int position_
Current playhead position.
Definition wavetable_playhead.h:115
void mouseDown(const MouseEvent &event) override
Handles mouse down events for interaction.
Definition wavetable_playhead.cpp:33