12 filter_section_2_ = std::make_unique<FilterSection>(2, mono_modulations, poly_modulations);
14 filter_section_2_->addListener(
this);
16 filter_section_1_ = std::make_unique<FilterSection>(1, mono_modulations, poly_modulations);
18 filter_section_1_->addListener(
this);
21 oscillators_[i] = std::make_unique<OscillatorSection>(auth, i, mono_modulations, poly_modulations);
23 oscillators_[i]->addListener(
this);
26 sample_section_ = std::make_unique<SampleSection>(
"SMP");
28 sample_section_->addListener(
this);
41 int active_width = getWidth() - padding;
42 int width_left = (active_width - padding) / 2;
43 int width_right = active_width - width_left;
44 int right_x = width_left + padding;
50 oscillators_[i]->setBounds(0, i * (oscillator_height + padding), getWidth(), oscillator_height);
53 int sample_height = sample_section_->getKnobSectionHeight();
55 int filter_height = getHeight() - filter_y;
57 sample_section_->setBounds(0, sample_y, getWidth(), sample_height);
59 filter_section_1_->setBounds(0, filter_y, width_left, filter_height);
60 filter_section_2_->setBounds(right_x, filter_y, width_right, filter_height);
67 oscillators_[i]->loadBrowserState();
74 dependents[i] =
false;
76 int index = section->
index();
77 int last_index = index;
78 while (!dependents[index]) {
79 dependents[index] =
true;
81 int type = oscillators_[index]->getDistortion();
90 oscillators_[last_index]->resetOscillatorModulationDistortionType();
97 if (oscillators_[i].get() == section) {
98 filter_section_1_->setOscillatorInput(i, filter1_on);
99 filter_section_2_->setOscillatorInput(i, filter2_on);
105 if (section == filter_section_1_.get())
106 filter_section_2_->clearFilterInput();
108 filter_section_1_->clearFilterInput();
112 int filter_index = section == filter_section_1_.get() ? 0 : 1;
113 oscillators_[index]->toggleFilterInput(filter_index, on);
117 int filter_index = section == filter_section_1_.get() ? 0 : 1;
118 sample_section_->toggleFilterInput(filter_index, on);
124 filter_section_1_->setSampleInput(filter1_on);
125 filter_section_2_->setSampleInput(filter2_on);
A no-op stub implementation used when authentication is disabled.
Definition authentication.h:163
A graphical user interface component representing a filter section in the synthesizer.
Definition filter_section.h:25
A UI section representing an oscillator in the synthesizer.
Definition oscillator_section.h:32
int index() const
Gets the oscillator index.
Definition oscillator_section.h:310
A UI section for managing and editing a sample source.
Definition sample_section.h:24
@ kWidgetMargin
Definition skin.h:103
@ kLargePadding
Definition skin.h:82
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
float getPadding()
Definition synth_section.cpp:660
void addSubSection(SynthSection *section, bool show=true)
Adds a subsection (another SynthSection) as a child.
Definition synth_section.cpp:457
virtual void resized() override
Called when the component is resized. Arranges layout of child components.
Definition synth_section.cpp:35
void paintChildrenBackgrounds(Graphics &g)
Paints the backgrounds for all child sections.
Definition synth_section.cpp:274
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
float getKnobSectionHeight()
Definition synth_section.cpp:633
void sampleDestinationChanged(SampleSection *section, int destination) override
Called when the sample routing destination changes.
Definition synthesis_interface.cpp:121
SynthesisInterface(Authentication *auth, const vital::output_map &mono_modulations, const vital::output_map &poly_modulations)
Constructs the SynthesisInterface.
Definition synthesis_interface.cpp:9
virtual ~SynthesisInterface()
Destructor.
Definition synthesis_interface.cpp:33
void paintBackground(Graphics &g) override
Paints the background of the synthesis interface.
Definition synthesis_interface.cpp:35
void distortionTypeChanged(OscillatorSection *section, int type) override
Called when the distortion type changes in one of the oscillators.
Definition synthesis_interface.cpp:71
void sampleInputToggled(FilterSection *section, bool on) override
Called when sample input to a filter is toggled.
Definition synthesis_interface.cpp:116
void oscInputToggled(FilterSection *section, int index, bool on) override
Called when oscillator input to a filter is toggled.
Definition synthesis_interface.cpp:111
void resized() override
Handles component resizing and lays out child components.
Definition synthesis_interface.cpp:39
void visibilityChanged() override
Called when the visibility of this interface changes. Used here to load browser states for oscillator...
Definition synthesis_interface.cpp:64
void filterSerialSelected(FilterSection *section) override
Called when a filter section changes to serial routing.
Definition synthesis_interface.cpp:104
void oscillatorDestinationChanged(OscillatorSection *section, int destination) override
Called when the oscillator routing destination changes.
Definition synthesis_interface.cpp:93
static force_inline int getFirstModulationIndex(int index)
Helper function to determine the first modulation index for a given oscillator index.
Definition producers_module.h:50
static force_inline int getSecondModulationIndex(int index)
Helper function to determine the second modulation index for a given oscillator index.
Definition producers_module.h:60
static bool isFirstModulation(int type)
Checks if distortion type uses the first modulation oscillator.
Definition synth_oscillator.h:185
static bool isSecondModulation(int type)
Checks if distortion type uses the second modulation oscillator.
Definition synth_oscillator.h:194
@ kDualFilters
Route through both filters.
Definition synth_constants.h:118
@ kFilter2
Route through Filter 2.
Definition synth_constants.h:117
@ kFilter1
Route through Filter 1.
Definition synth_constants.h:116
constexpr int kNumOscillators
Number of oscillators available in Vital.
Definition synth_constants.h:16
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229