Vital
Loading...
Searching...
No Matches
random_section.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4#include "synth_section.h"
5#include "preset_selector.h"
6
7class RandomViewer;
8class SynthSlider;
9class TempoSelector;
10class TextSelector;
11
20public:
28 RandomSection(String name, std::string value_prepend,
29 const vital::output_map& mono_modulations,
30 const vital::output_map& poly_modulations);
31
34
39 void paintBackground(Graphics& g) override;
40
44 void resized() override;
45
50 void setAllValues(vital::control_map& controls) override {
52 transpose_tune_divider_->setVisible(sync_->isKeytrack());
53 }
54
59 void sliderValueChanged(Slider* changed_slider) override {
61 transpose_tune_divider_->setVisible(sync_->isKeytrack());
62 }
63
64private:
65 std::unique_ptr<RandomViewer> viewer_;
66
67 std::unique_ptr<SynthSlider> frequency_;
68 std::unique_ptr<SynthSlider> tempo_;
69 std::unique_ptr<SynthButton> stereo_;
70 std::unique_ptr<TempoSelector> sync_;
71 std::unique_ptr<SynthButton> sync_type_;
72 std::unique_ptr<TextSelector> style_;
73
74 std::unique_ptr<SynthSlider> keytrack_transpose_;
75 std::unique_ptr<SynthSlider> keytrack_tune_;
76
77 std::unique_ptr<OpenGlQuad> transpose_tune_divider_;
78
79 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(RandomSection)
80};
A section of the UI dedicated to controlling a random mod source, such as a random LFO.
Definition random_section.h:19
void paintBackground(Graphics &g) override
Paints the background of the random section including labels and backgrounds.
Definition random_section.cpp:258
~RandomSection()
Destructor.
Definition random_section.cpp:256
void resized() override
Called when the component is resized. Arranges the layout of sliders, buttons, and viewer.
Definition random_section.cpp:278
RandomSection(String name, std::string value_prepend, const vital::output_map &mono_modulations, const vital::output_map &poly_modulations)
Constructs a RandomSection.
Definition random_section.cpp:190
void setAllValues(vital::control_map &controls) override
Sets all control values from a given control map.
Definition random_section.h:50
void sliderValueChanged(Slider *changed_slider) override
Called when a slider's value changes.
Definition random_section.h:59
Visualizes the random modulation source as a waveform line renderer.
Definition random_section.cpp:18
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
virtual void sliderValueChanged(Slider *moved_slider) override
Called when a slider value changes. Updates the synth parameter accordingly.
Definition synth_section.cpp:391
virtual void setAllValues(vital::control_map &controls)
Sets values for all known parameters from a control map.
Definition synth_section.cpp:827
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
A slider component that allows selection between different tempo modes (seconds, tempo,...
Definition tempo_selector.h:14
A specialized SynthSlider that displays a popup menu of text options.
Definition text_selector.h:14
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.