Vital
Loading...
Searching...
No Matches
voice_section.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4#include "synth_section.h"
5
14class VoiceSection : public SynthSection {
15public:
20 VoiceSection(String name);
21
23 virtual ~VoiceSection();
24
29 void paintBackground(Graphics& g) override;
30
35 void paintBackgroundShadow(Graphics& g) override { paintTabShadow(g); }
36
40 void resized() override;
41
46 void buttonClicked(Button* clicked_button) override;
47
52 void setAllValues(vital::control_map& controls) override;
53
58 void setStereoModeSelected(int selection);
59
60private:
61 std::unique_ptr<SynthSlider> polyphony_;
62 std::unique_ptr<SynthSlider> velocity_track_;
63 std::unique_ptr<SynthSlider> pitch_bend_range_;
64 std::unique_ptr<SynthSlider> stereo_routing_;
65
66 std::unique_ptr<PlainTextComponent> stereo_mode_text_;
67 std::unique_ptr<ShapeButton> stereo_mode_type_selector_;
68
69 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VoiceSection)
70};
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188
A UI section for controlling various global voice parameters.
Definition voice_section.h:14
void paintBackgroundShadow(Graphics &g) override
Paints a background shadow if the section is active.
Definition voice_section.h:35
virtual ~VoiceSection()
Destructor.
Definition voice_section.cpp:56
VoiceSection(String name)
Constructs a VoiceSection with a given name.
Definition voice_section.cpp:12
void setAllValues(vital::control_map &controls) override
Updates all parameter values from a given control map.
Definition voice_section.cpp:98
void paintBackground(Graphics &g) override
Paints the background of the voice section, including labels and shadows.
Definition voice_section.cpp:58
void buttonClicked(Button *clicked_button) override
Handles button click events for this section.
Definition voice_section.cpp:104
void resized() override
Lays out child components and adjusts sizing after a resize event.
Definition voice_section.cpp:74
void setStereoModeSelected(int selection)
Sets the selected stereo mode.
Definition voice_section.cpp:119
std::map< std::string, Value * > control_map
Maps parameter names to Value pointers representing synth control parameters.
Definition synth_types.h:214