71 void mouseDown(
const MouseEvent& event)
override;
77 void mouseDrag(
const MouseEvent& event)
override;
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
A listener interface for objects interested in playhead position changes.
Definition wavetable_playhead.h:31
virtual ~Listener()
Definition wavetable_playhead.h:33
virtual void playheadMoved(int new_position)=0
Called when the playhead is moved to a new position.
A UI component representing a playhead position over a range of frames in a wavetable editor.
Definition wavetable_playhead.h:19
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
int drag_start_x_
Starting x position of the mouse when dragging.
Definition wavetable_playhead.h:116
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
void addListener(Listener *listener)
Registers a listener interested in changes to the playhead position.
Definition wavetable_playhead.h:100
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
void setPadding(float padding)
Sets the horizontal padding around the playhead display area.
Definition wavetable_playhead.h:106