66 void mouseDown(
const MouseEvent& e)
override;
75 void mouseUp(
const MouseEvent& e)
override;
84 void mouseDrag(
const MouseEvent& e)
override;
115 void updatePhase(
const MouseEvent& e);
122 void updatePositions();
124 std::vector<Listener*> listeners_;
125 Point<int> last_edit_position_;
128 float max_tick_height_;
130 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
PhaseEditor)
A component for rendering multiple quads using OpenGL, with customizable colors, rounding,...
Definition open_gl_multi_quad.h:16
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the quads using OpenGL.
Definition open_gl_multi_quad.cpp:92
Interface for receiving notifications when the phase value changes.
Definition phase_editor.h:26
virtual void phaseChanged(float phase, bool mouse_up)=0
Called when the phase value has been changed by user interaction.
virtual ~Listener()
Definition phase_editor.h:28
A UI component for interactively editing a phase value using a horizontal dragging gesture.
Definition phase_editor.h:15
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the tick lines representing the current phase.
Definition phase_editor.h:55
virtual ~PhaseEditor()
Destructor.
Definition phase_editor.cpp:14
void setPhase(float phase)
Sets the current phase value and updates the display.
Definition phase_editor.cpp:63
void mouseDrag(const MouseEvent &e) override
Called while the mouse is dragged horizontally.
Definition phase_editor.cpp:28
void mouseUp(const MouseEvent &e) override
Called when the mouse is released after interaction.
Definition phase_editor.cpp:20
void mouseDown(const MouseEvent &e) override
Called when the mouse is pressed down on the component.
Definition phase_editor.cpp:16
PhaseEditor()
Constructs a PhaseEditor.
Definition phase_editor.cpp:8
void setMaxTickHeight(float height)
Sets the maximum tick line height relative to the component height.
Definition phase_editor.h:105
static constexpr float kDefaultHeightPercent
Definition phase_editor.h:20
void addListener(Listener *listener)
Adds a listener to be notified when the phase changes.
Definition phase_editor.h:91
static constexpr int kNumLines
Definition phase_editor.h:18
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174