10 dry_wet_ = std::make_unique<SynthSlider>(
"reverb_dry_wet");
12 dry_wet_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
14 high_pre_cutoff_ = std::make_unique<SynthSlider>(
"reverb_pre_high_cutoff");
16 high_pre_cutoff_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
19 chorus_frequency_ = std::make_unique<SynthSlider>(
"reverb_chorus_frequency");
21 chorus_frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
23 low_gain_ = std::make_unique<SynthSlider>(
"reverb_low_shelf_gain");
25 low_gain_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
27 high_gain_ = std::make_unique<SynthSlider>(
"reverb_high_shelf_gain");
29 high_gain_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
31 decay_time_ = std::make_unique<SynthSlider>(
"reverb_decay_time");
33 decay_time_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
35 low_pre_cutoff_ = std::make_unique<SynthSlider>(
"reverb_pre_low_cutoff");
37 low_pre_cutoff_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
40 low_cutoff_ = std::make_unique<SynthSlider>(
"reverb_low_shelf_cutoff");
42 low_cutoff_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
45 high_cutoff_ = std::make_unique<SynthSlider>(
"reverb_high_shelf_cutoff");
47 high_cutoff_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
50 chorus_amount_ = std::make_unique<SynthSlider>(
"reverb_chorus_amount");
52 chorus_amount_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
54 delay_ = std::make_unique<SynthSlider>(
"reverb_delay");
56 delay_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
58 size_ = std::make_unique<SynthSlider>(
"reverb_size");
60 size_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
62 feedback_eq_response_ = std::make_unique<EqualizerResponse>();
64 feedback_eq_response_->initReverb(mono_modulations);
65 feedback_eq_response_->setLowSliders(low_cutoff_.get(),
nullptr, low_gain_.get());
66 feedback_eq_response_->setHighSliders(high_cutoff_.get(),
nullptr, high_gain_.get());
67 feedback_eq_response_->setDrawFrequencyLines(
false);
68 addAndMakeVisible(feedback_eq_response_.get());
70 feedback_eq_response_->addListener(
this);
72 selected_eq_band_ = std::make_unique<TabSelector>(
"selected_band");
73 addAndMakeVisible(selected_eq_band_.get());
75 selected_eq_band_->setSliderStyle(Slider::LinearBar);
76 selected_eq_band_->setRange(0, 1);
77 selected_eq_band_->addListener(
this);
78 selected_eq_band_->setNames({
"LOW",
"HIGH"});
79 selected_eq_band_->setFontHeightPercent(0.4f);
80 selected_eq_band_->setScrollWheelEnabled(
false);
82 on_ = std::make_unique<SynthButton>(
"reverb_on");
112 int eq_width = getHeight() - 2 * widget_margin;
113 float feedback_widget_x = (getWidth() - title_width - eq_width - 2 * widget_margin) / 5.0f +
114 title_width + widget_margin;
119 int selected_x = feedback_widget_x + widget_rounding;
120 int selected_width = eq_width - 2 * widget_rounding;
121 selected_eq_band_->setBounds(selected_x, widget_margin, selected_width, band_height);
122 feedback_eq_response_->setBounds(feedback_widget_x, widget_margin, eq_width, eq_width);
124 int pre_cutoff_x = title_width + widget_margin;
125 int pre_cutoff_width = feedback_widget_x - pre_cutoff_x - widget_margin;
126 int knob_y2 = section_height - widget_margin;
128 low_pre_cutoff_->setBounds(pre_cutoff_x, 0, pre_cutoff_width, section_height - widget_margin);
129 high_pre_cutoff_->setBounds(pre_cutoff_x, knob_y2, pre_cutoff_width, section_height - widget_margin);
131 int knobs_x = feedback_widget_x + eq_width;
132 int knobs_width = getWidth() - knobs_x;
135 { low_cutoff_.get(), chorus_amount_.get(), delay_.get(), dry_wet_.get() });
137 placeKnobsInArea(Rectangle<int>(knobs_x, knob_y2, knobs_width, section_height),
138 { low_gain_.get(), chorus_frequency_.get(), size_.get(), decay_time_.get() });
140 high_cutoff_->setBounds(low_cutoff_->getBounds());
141 high_gain_->setBounds(low_gain_->getBounds());
147 feedback_eq_response_->setActive(active);
148 selected_eq_band_->setActive(active);
153 selected_eq_band_->setValue(0.0, dontSendNotification);
154 selected_eq_band_->redoImage();
155 low_cutoff_->setVisible(
true);
156 low_gain_->setVisible(
true);
158 high_cutoff_->setVisible(
false);
159 high_gain_->setVisible(
false);
163 selected_eq_band_->setValue(1.0, dontSendNotification);
164 selected_eq_band_->redoImage();
165 low_cutoff_->setVisible(
false);
166 low_gain_->setVisible(
false);
168 high_cutoff_->setVisible(
true);
169 high_gain_->setVisible(
true);
173 if (slider == selected_eq_band_.get()) {
174 if (selected_eq_band_->getValue() == 0.0f)
179 feedback_eq_response_->setSelectedBand(selected_eq_band_->getValue() * 2.0f);
static Fonts * instance()
Gets the singleton instance of the Fonts class.
Definition fonts.h:52
void sliderValueChanged(Slider *slider) override
Called when a slider's value changes.
Definition reverb_section.cpp:172
~ReverbSection()
Destructor.
Definition reverb_section.cpp:89
void resized() override
Called when the component is resized. Arranges the sliders, buttons, and EQ visualization.
Definition reverb_section.cpp:109
void highBandSelected() override
Called when the high EQ band is selected in the EqualizerResponse.
Definition reverb_section.cpp:162
static constexpr float kFeedbackFilterBuffer
Used to scale the feedback filter EQ buffer.
Definition reverb_section.h:20
void setActive(bool active) override
Sets the active state of this section.
Definition reverb_section.cpp:146
void lowBandSelected() override
Called when the low EQ band is selected in the EqualizerResponse.
Definition reverb_section.cpp:152
void paintBackground(Graphics &g) override
Paints the reverb section background, labels, and any custom UI elements.
Definition reverb_section.cpp:91
ReverbSection(String name, const vital::output_map &mono_modulations)
Constructs a ReverbSection.
Definition reverb_section.cpp:9
@ kWidgetMargin
Definition skin.h:103
@ kWidgetRoundedCorner
Definition skin.h:104
@ kBodyText
Definition skin.h:133
@ kReverb
Definition skin.h:54
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
void placeKnobsInArea(Rectangle< int > area, std::vector< Component * > knobs)
Definition synth_section.cpp:601
void addSlider(SynthSlider *slider, bool show=true, bool listen=true)
Definition synth_section.cpp:445
virtual void resized() override
Called when the component is resized. Arranges layout of child components.
Definition synth_section.cpp:35
virtual void setActive(bool active)
Sets the active state of this section and sub-sections.
Definition synth_section.cpp:806
void drawLabelForComponent(Graphics &g, String text, Component *component, bool text_component=false)
Draws a label for a given component.
Definition synth_section.h:548
float size_ratio_
Definition synth_section.h:821
void addButton(OpenGlToggleButton *button, bool show=true)
Definition synth_section.cpp:428
float findValue(Skin::ValueId value_id) const
Finds a value in the skin overrides or from the parent if not found locally.
Definition synth_section.cpp:18
virtual void paintBackground(Graphics &g)
Paints the background of the section. Calls paintContainer, heading, knobs, children.
Definition synth_section.cpp:77
float getKnobSectionHeight()
Definition synth_section.cpp:633
void setActivator(SynthButton *activator)
Definition synth_section.cpp:504
void addOpenGlComponent(OpenGlComponent *open_gl_component, bool to_beginning=false)
Definition synth_section.cpp:489
virtual void sliderValueChanged(Slider *moved_slider) override
Called when a slider value changes. Updates the synth parameter accordingly.
Definition synth_section.cpp:391
void setSliderHasHzAlternateDisplay(SynthSlider *slider)
Definition synth_section.cpp:410
float getTitleWidth()
Definition synth_section.cpp:629
void setSkinOverride(Skin::SectionOverride skin_override)
Definition synth_section.h:303
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
Declares the SynthSlider and related classes, providing various slider styles and functionality in th...
Declares the TabSelector class, a slider-based UI component for selecting tabs.