59 void mouseDown(
const MouseEvent& e)
override;
63 void mouseUp(
const MouseEvent& e)
override;
71 void mouseEnter(
const MouseEvent& e)
override { hover_ =
true; }
75 void mouseExit(
const MouseEvent& e)
override { hover_ =
false; }
85 void setText(String left, String center, String right);
89 String
getText() {
return text_->getText(); }
116 void textMouseDown(
const MouseEvent& e);
120 void textMouseUp(
const MouseEvent& e);
122 std::vector<Listener*> listeners_;
123 float font_height_ratio_;
126 bool text_component_;
128 std::unique_ptr<PlainTextComponent> text_;
129 std::unique_ptr<OpenGlShapeButton> prev_preset_;
130 std::unique_ptr<OpenGlShapeButton> next_preset_;
Interface for objects that want to be notified of PresetSelector events.
Definition preset_selector.h:24
virtual void textMouseUp(const MouseEvent &e)
Definition preset_selector.h:37
virtual void prevClicked()=0
Called when the "previous" button is clicked.
virtual void textMouseDown(const MouseEvent &e)
Definition preset_selector.h:41
virtual void nextClicked()=0
Called when the "next" button is clicked.
virtual ~Listener()
Virtual destructor for proper cleanup.
Definition preset_selector.h:27
A UI component for selecting presets within the synthesizer.
Definition preset_selector.h:14
void mouseExit(const MouseEvent &e) override
Definition preset_selector.h:75
void setFontRatio(float ratio)
Definition preset_selector.h:93
PresetSelector()
Constructor.
Definition preset_selector.cpp:8
void resized() override
Resizes and lays out the child components.
Definition preset_selector.cpp:62
void addListener(Listener *listener)
Definition preset_selector.h:101
static constexpr float kDefaultFontHeightRatio
Default ratio of the font height relative to the component's height.
Definition preset_selector.h:17
void buttonClicked(Button *clicked_button) override
Definition preset_selector.cpp:101
void clickNext()
Programmatically simulate a click on the "next" preset button.
Definition preset_selector.cpp:129
void mouseEnter(const MouseEvent &e) override
Definition preset_selector.h:71
void setRoundAmount(float round_amount)
Definition preset_selector.h:97
void clickPrev()
Programmatically simulate a click on the "previous" preset button.
Definition preset_selector.cpp:123
void mouseDown(const MouseEvent &e) override
Definition preset_selector.cpp:88
~PresetSelector()
Destructor.
Definition preset_selector.cpp:51
String getText()
Definition preset_selector.h:89
void setText(String text)
Definition preset_selector.cpp:110
void paintBackground(Graphics &g) override
Definition preset_selector.cpp:55
void setTextComponent(bool text_component)
Definition preset_selector.h:111
void mouseUp(const MouseEvent &e) override
Definition preset_selector.cpp:95
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193