29 public TextEditor::Listener,
105 wavetable_->setDirty();
286 void loadFile(
const File& wavetable_file)
override;
298 std::string
getFileName()
override {
return wavetable_->getWavetable()->getName(); }
304 std::string
getFileAuthor()
override {
return wavetable_->getWavetable()->getAuthor(); }
310 int index()
const {
return index_; }
346 void showTtwtSettings();
351 void setupSpectralMorph();
356 void setupDistortion();
361 void setupDestination();
367 void setDistortionPhaseVisible(
bool visible);
372 void notifySpectralMorphTypeChange();
377 void notifyDistortionTypeChange();
382 void notifyDestinationChange();
385 std::vector<Listener*> listeners_;
389 std::string distortion_control_name_;
390 std::string spectral_morph_control_name_;
391 std::string destination_control_name_;
392 std::string quantize_control_name_;
393 int current_distortion_type_;
394 int current_spectral_morph_type_;
395 int current_destination_;
396 bool show_ttwt_error_;
397 bool showing_language_menu_;
400 std::unique_ptr<SynthButton> oscillator_on_;
401 std::unique_ptr<SynthButton> dimension_button_;
402 std::unique_ptr<SynthSlider> dimension_value_;
403 std::unique_ptr<PresetSelector> preset_selector_;
404 std::unique_ptr<Wavetable3d> wavetable_;
405 std::unique_ptr<UnisonViewer> unison_viewer_;
407 std::unique_ptr<TransposeQuantizeButton> transpose_quantize_button_;
408 std::unique_ptr<SynthSlider> transpose_;
409 std::unique_ptr<SynthSlider> tune_;
411 std::unique_ptr<PlainTextComponent> distortion_type_text_;
412 std::unique_ptr<ShapeButton> distortion_type_selector_;
413 std::unique_ptr<SynthSlider> distortion_amount_;
414 std::unique_ptr<SynthSlider> distortion_phase_;
415 std::unique_ptr<SynthSlider> phase_;
416 std::unique_ptr<SynthSlider> random_phase_;
418 std::unique_ptr<PlainTextComponent> spectral_morph_type_text_;
419 std::unique_ptr<ShapeButton> spectral_morph_type_selector_;
420 std::unique_ptr<SynthSlider> spectral_morph_amount_;
422 std::unique_ptr<PlainTextComponent> destination_text_;
423 std::unique_ptr<ShapeButton> destination_selector_;
425 std::unique_ptr<SynthSlider> level_;
426 std::unique_ptr<SynthSlider> pan_;
427 std::unique_ptr<SynthSlider> wave_frame_;
429 std::unique_ptr<SynthSlider> unison_voices_;
430 std::unique_ptr<SynthSlider> unison_detune_;
431 std::unique_ptr<SynthSlider> unison_detune_power_;
432 std::unique_ptr<OpenGlShapeButton> edit_button_;
435 std::unique_ptr<OpenGlTextEditor> ttwt_;
436 std::unique_ptr<SynthButton> ttwt_settings_;
437 std::unique_ptr<PlainTextComponent> ttwt_error_text_;
439 std::unique_ptr<OpenGlShapeButton> prev_destination_;
440 std::unique_ptr<OpenGlShapeButton> next_destination_;
441 std::unique_ptr<OpenGlShapeButton> prev_spectral_;
442 std::unique_ptr<OpenGlShapeButton> next_spectral_;
443 std::unique_ptr<OpenGlShapeButton> prev_distortion_;
444 std::unique_ptr<OpenGlShapeButton> next_distortion_;
A no-op stub implementation used when authentication is disabled.
Definition authentication.h:163
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
Listener interface for receiving oscillator section changes.
Definition oscillator_section.h:41
virtual ~Listener()=default
virtual void distortionTypeChanged(OscillatorSection *section, int type)=0
Callback triggered when the distortion type changes.
virtual void oscillatorDestinationChanged(OscillatorSection *section, int destination)=0
Callback triggered when the oscillator destination changes.
A UI section representing an oscillator in the synthesizer.
Definition oscillator_section.h:32
void textEditorReturnKeyPressed(TextEditor &text_editor) override
Handles the return key press in the text editor.
Definition oscillator_section.cpp:940
void setIndexSelected()
Sets the language index for the text-to-wavetable functionality.
Definition oscillator_section.cpp:1078
void paintBackgroundShadow(Graphics &g) override
Paints the background shadow if active.
Definition oscillator_section.h:93
const SynthSlider * getWaveFrameSlider() const
Gets the wave frame slider.
Definition oscillator_section.h:322
void setLanguage(int index)
Sets the language for text-to-wavetable processing.
Definition oscillator_section.cpp:1085
virtual ~OscillatorSection()
Destructor.
void textToWavetable() override
Converts entered text to a wavetable (TTWT).
Definition oscillator_section.cpp:1203
const SynthSlider * getDistortionSlider() const
Gets the distortion slider.
Definition oscillator_section.h:334
void languageSelectCancelled()
Cancels the language selection for TTWT.
Definition oscillator_section.cpp:1096
void reset() override
Resets the oscillator section and marks the wavetable as dirty.
Definition oscillator_section.h:103
void loadBrowserState()
Loads the browser state for wavetable preset selection.
Definition oscillator_section.cpp:1071
void resetOscillatorModulationDistortionType()
Resets the oscillator modulation distortion type to default.
Definition oscillator_section.cpp:1143
Rectangle< float > getWavetableRelativeBounds()
Gets the relative bounds of the wavetable display area.
Definition oscillator_section.cpp:1244
void setName(String name)
Sets the display name of the oscillator section.
Definition oscillator_section.cpp:988
void loadWavetable(json &wavetable_data) override
Loads a wavetable from JSON data.
Definition oscillator_section.cpp:1170
std::string getFileAuthor() override
Gets the author of the loaded wavetable file.
Definition oscillator_section.h:304
void setSkinValues(const Skin &skin, bool top_level) override
Sets visual skin values.
Definition oscillator_section.cpp:633
void setSpectralMorphSelected(int selection)
Sets the currently selected spectral morph type.
Definition oscillator_section.cpp:1048
File getCurrentFile() override
Gets the current wavetable file.
Definition oscillator_section.h:292
void setActive(bool active) override
Sets the active state of the oscillator section.
Definition oscillator_section.cpp:980
void buttonClicked(Button *clicked_button) override
Handles button clicks.
Definition oscillator_section.cpp:840
Slider * getWaveFrameSlider()
Gets the wave frame slider.
Definition oscillator_section.cpp:1034
void nextClicked() override
Loads the next wavetable in the browser.
Definition oscillator_section.cpp:1114
void timerCallback() override
Timer callback for handling transient states (e.g. error messages).
Definition oscillator_section.cpp:972
void textEditorFocusLost(TextEditor &text_editor) override
Handles focus loss in the text editor.
Definition oscillator_section.cpp:962
void setDistortionSelected(int selection)
Sets the currently selected distortion type.
Definition oscillator_section.cpp:1039
void addListener(Listener *listener)
Adds a listener for oscillator section events.
Definition oscillator_section.h:158
bool loadAudioAsWavetable(String name, InputStream *audio_stream, WavetableCreator::AudioFileLoadStyle style) override
Loads audio data as a wavetable.
Definition oscillator_section.cpp:1152
void setDestinationSelected(int selection)
Sets the currently selected destination routing.
Definition oscillator_section.cpp:1055
void loadDefaultWavetable() override
Loads the default (init) wavetable.
Definition oscillator_section.cpp:1183
static constexpr float kSectionWidthRatio
Relative width ratio of the oscillator section.
Definition oscillator_section.h:35
void resynthesizeToWavetable() override
Resynthesizes the current source to a wavetable.
Definition oscillator_section.cpp:1194
void quantizeUpdated() override
Called when transpose quantization is updated.
Definition oscillator_section.cpp:1135
void loadFile(const File &wavetable_file) override
Loads a wavetable file from disk.
Definition oscillator_section.cpp:1223
void resized() override
Called when the component is resized. Handles layout.
Definition oscillator_section.cpp:701
void paintBackground(Graphics &g) override
Paints the background of this section.
Definition oscillator_section.cpp:644
OscillatorSection(Authentication *auth, int index, const vital::output_map &mono_modulations, const vital::output_map &poly_modulations)
Constructs a new OscillatorSection.
Definition oscillator_section.cpp:366
void prevClicked() override
Loads the previous wavetable in the browser.
Definition oscillator_section.cpp:1104
std::string getFileName() override
Gets the name of the loaded wavetable file.
Definition oscillator_section.h:298
void textMouseDown(const MouseEvent &e) override
Handles mouse-down events on textual components.
Definition oscillator_section.cpp:1124
std::string loadWavetableFromText(const String &text)
Loads a wavetable from text input (TTWT - text to wavetable).
Definition oscillator_section.cpp:1005
void saveWavetable() override
Saves the current wavetable to disk.
Definition oscillator_section.cpp:1216
int getDistortion() const
Gets the current distortion type.
Definition oscillator_section.h:183
void toggleFilterInput(int filter_index, bool on)
Toggles filter input on or off.
Definition oscillator_section.cpp:1061
void setAllValues(vital::control_map &controls) override
Sets all control values from a given control map.
Definition oscillator_section.cpp:919
const SynthSlider * getSpectralMorphSlider() const
Gets the spectral morph slider.
Definition oscillator_section.h:328
SynthSlider * getVoicesSlider() const
Gets the unison voices slider.
Definition oscillator_section.h:316
int index() const
Gets the oscillator index.
Definition oscillator_section.h:310
Interface for objects that want to be notified of PresetSelector events.
Definition preset_selector.h:24
A UI component for selecting presets within the synthesizer.
Definition preset_selector.h:14
A UI overlay for saving presets or other files.
Definition save_section.h:21
Manages the overall color and value theme (or "skin") of the user interface.
Definition skin.h:24
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
bool isActive() const
Checks if the section is currently active.
Definition synth_section.h:683
virtual void reset()
Resets the section and all sub-sections.
Definition synth_section.cpp:30
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
A specialized SynthSlider that displays a popup menu of text options.
Definition text_selector.h:14
A component for visualizing unison voices distribution and detune.
Definition oscillator_section.cpp:236
Interface for components that need to respond to wavetable loading or transformations.
Definition wavetable_3d.h:89
A class responsible for creating complete wavetables from groups of wavetable components.
Definition wavetable_creator.h:27
AudioFileLoadStyle
Defines how audio files are interpreted when loading into a wavetable.
Definition wavetable_creator.h:33
nlohmann::json json
Definition line_generator.h:7
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
std::map< std::string, Value * > control_map
Maps parameter names to Value pointers representing synth control parameters.
Definition synth_types.h:214
Declares the PresetSelector class which provides a UI component for selecting presets.
Declares classes for selecting and applying transpose quantization to notes.
Declares the Wavetable3d class, which provides a 3D and 2D visualization for wavetables.