15 void setColorRecursively(Component *component,
int color_id,
const Colour& color) {
16 component->setColour(color_id, color);
17 for (Component *child : component->getChildren())
18 setColorRecursively(child, color_id, color);
24 logo_ = std::make_unique<AppLogo>(
"logo");
27 name_text_ = std::make_unique<PlainTextComponent>(
"plugin name",
"VIAL");
30 name_text_->setTextSize(40.0f);
32 version_text_ = std::make_unique<PlainTextComponent>(
"version", String(
"version ") + ProjectInfo::versionString);
35 version_text_->setTextSize(12.0f);
37 check_for_updates_text_ = std::make_unique<PlainTextComponent>(
"Check for updates", String(
"Check for updates"));
40 check_for_updates_text_->setTextSize(14.0f);
41 check_for_updates_text_->setJustification(Justification::centredLeft);
43 check_for_updates_ = std::make_unique<OpenGlToggleButton>(
"");
45 check_for_updates_->addListener(
this);
46 addAndMakeVisible(check_for_updates_.get());
49 size_button_extra_small_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultExtraSmall) +
"%");
50 size_button_extra_small_->setUiButton(
false);
51 addAndMakeVisible(size_button_extra_small_.get());
53 size_button_extra_small_->addListener(
this);
55 size_button_small_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultSmall) +
"%");
56 size_button_small_->setUiButton(
false);
57 addAndMakeVisible(size_button_small_.get());
59 size_button_small_->addListener(
this);
61 size_button_normal_ = std::make_unique<OpenGlToggleButton>(String(
"100") +
"%");
62 size_button_normal_->setUiButton(
false);
63 addAndMakeVisible(size_button_normal_.get());
65 size_button_normal_->addListener(
this);
67 size_button_large_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultLarge) +
"%");
68 size_button_large_->setUiButton(
false);
69 addAndMakeVisible(size_button_large_.get());
71 size_button_large_->addListener(
this);
73 size_button_double_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultDouble) +
"%");
74 size_button_double_->setUiButton(
false);
75 addAndMakeVisible(size_button_double_.get());
77 size_button_double_->addListener(
this);
79 size_button_triple_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultTriple) +
"%");
80 size_button_triple_->setUiButton(
false);
81 addAndMakeVisible(size_button_triple_.get());
83 size_button_triple_->addListener(
this);
85 size_button_quadruple_ = std::make_unique<OpenGlToggleButton>(String(100 *
kMultQuadruple) +
"%");
86 size_button_quadruple_->setUiButton(
false);
87 addAndMakeVisible(size_button_quadruple_.get());
89 size_button_quadruple_->addListener(
this);
97 logo_->setBounds(info_rect.getX() + left_buffer, info_rect.getY() + (
kPaddingY + 12) *
size_ratio_,
103 if (parent && device_selector_ ==
nullptr) {
105 if (device_manager) {
106 device_selector_ = std::make_unique<OpenGlDeviceSelector>(
108 addAndMakeVisible(device_selector_.get());
114 body_.setBounds(info_rect);
118 name_text_->setColor(body_text);
119 check_for_updates_text_->setColor(body_text);
120 version_text_->setColor(body_text);
129 name_text_->setBounds(info_rect.getX() + name_x, info_rect.getY() + padding_y + 40 *
size_ratio_,
132 version_text_->setBounds(info_rect.getX() + name_x, info_rect.getY() + padding_y + 76 *
size_ratio_,
136 int size_start_x = info_rect.getX() + padding_x;
137 int size_end_x = info_rect.getRight() - padding_x + size_padding;
138 std::vector<OpenGlToggleButton*> size_buttons = {
139 size_button_extra_small_.get(),
140 size_button_small_.get(),
141 size_button_normal_.get(),
142 size_button_large_.get(),
143 size_button_double_.get(),
144 size_button_triple_.get(),
145 size_button_quadruple_.get(),
148 float size_width = (size_end_x - size_start_x) * 1.0f / size_buttons.size() - size_padding;
150 int check_updates_height = button_height * 0.6f;
151 check_for_updates_->setBounds(info_rect.getX() + padding_x,
152 info_rect.getY() + padding_y + 145.0f *
size_ratio_,
153 check_updates_height, check_updates_height);
154 int check_for_updates_width = 3 * size_width + 2 * size_padding;
155 check_for_updates_text_->setBounds(check_for_updates_->getRight() + size_padding, check_for_updates_->getY(),
156 check_for_updates_width, check_updates_height);
158 int size_y = check_for_updates_->getBottom() + padding_y;
162 int start_x = std::round(size_start_x + index * (size_width + size_padding));
163 size_button->setBounds(start_x, size_y, size_width, button_height);
167 if (device_selector_) {
168 int y = size_button_quadruple_->getBottom() + padding_y;
169 device_selector_->setBounds(info_rect.getX(), y,
170 info_rect.getWidth(), info_rect.getBottom() - y);
173 if (device_selector_) {
175 setColorRecursively(device_selector_.get(), ListBox::backgroundColourId, background);
176 setColorRecursively(device_selector_.get(), ComboBox::backgroundColourId, background);
177 setColorRecursively(device_selector_.get(), PopupMenu::backgroundColourId, background);
178 setColorRecursively(device_selector_.get(), BubbleComponent::backgroundColourId, background);
181 setColorRecursively(device_selector_.get(), ListBox::textColourId, text);
182 setColorRecursively(device_selector_.get(), ComboBox::textColourId, text);
184 setColorRecursively(device_selector_.get(), TextEditor::highlightColourId, Colours::transparentBlack);
185 setColorRecursively(device_selector_.get(), ListBox::outlineColourId, Colours::transparentBlack);
186 setColorRecursively(device_selector_.get(), ComboBox::outlineColourId, Colours::transparentBlack);
191 check_for_updates_text_->setTextSize(14.0f *
size_ratio_);
202 if (should_be_visible) {
204 Image image(Image::ARGB, 1, 1,
false);
213 if (clicked_button == check_for_updates_.get())
215 else if (clicked_button == size_button_extra_small_.get())
217 else if (clicked_button == size_button_small_.get())
219 else if (clicked_button == size_button_normal_.get())
221 else if (clicked_button == size_button_large_.get())
223 else if (clicked_button == size_button_double_.get())
225 else if (clicked_button == size_button_triple_.get())
227 else if (clicked_button == size_button_quadruple_.get())
234 if (device_selector_)
235 info_height += device_selector_->getBounds().getHeight();
237 int x = (getWidth() - info_width) / 2;
238 int y = (getHeight() - info_width) / 2;
239 return Rectangle<int>(x, y, info_width, info_height);
242void AboutSection::setGuiSize(
float multiplier) {
243 if (Desktop::getInstance().getKioskModeComponent()) {
244 Desktop::getInstance().setKioskModeComponent(
nullptr);
248 float percent = sqrtf(multiplier);
254void AboutSection::fullScreen() {
255 if (Desktop::getInstance().getKioskModeComponent())
256 Desktop::getInstance().setKioskModeComponent(
nullptr);
258 Desktop::getInstance().setKioskModeComponent(getTopLevelComponent());
Declares the AboutSection class, which displays information about the application and allows configur...
static constexpr float kMultTriple
Definition about_section.h:81
virtual ~AboutSection()
Destructor.
static constexpr float kMultExtraSmall
Scaling multipliers for adjusting GUI size.
Definition about_section.h:77
AboutSection(const String &name)
Definition about_section.cpp:22
static constexpr int kInfoWidth
The fixed dimensions and layout constants for this section.
Definition about_section.h:67
static constexpr int kNameRightBuffer
Definition about_section.h:73
void buttonClicked(Button *clicked_button) override
Definition about_section.cpp:212
void setVisible(bool should_be_visible) override
Definition about_section.cpp:201
void setLogoBounds()
Sets the bounds of the logo within the info rectangle.
Definition about_section.cpp:94
static constexpr int kPaddingX
Definition about_section.h:69
void mouseUp(const MouseEvent &e) override
Definition about_section.cpp:196
void resized() override
Handles resizing of the section, laying out child components and controls.
Definition about_section.cpp:101
static constexpr int kBasicInfoHeight
Definition about_section.h:68
static constexpr int kPaddingY
Definition about_section.h:70
Rectangle< int > getInfoRect()
Definition about_section.cpp:231
static constexpr float kMultDouble
Definition about_section.h:80
static constexpr float kMultSmall
Definition about_section.h:78
static constexpr int kLogoWidth
Definition about_section.h:74
static constexpr int kButtonHeight
Definition about_section.h:71
static constexpr int kLeftLogoBuffer
Definition about_section.h:72
static constexpr float kMultLarge
Definition about_section.h:79
static constexpr float kMultQuadruple
Definition about_section.h:82
static void saveUpdateCheckConfig(bool check_for_updates)
Saves the user's preference regarding update checks.
Definition load_save.cpp:1288
static bool shouldCheckForUpdates()
Checks if Vital should perform update checks.
Definition load_save.cpp:1554
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
void setRounding(float rounding)
Sets the rounding radius of the quads.
Definition open_gl_multi_quad.h:347
A SynthSection that displays an overlay with a background and optional listeners.
Definition overlay.h:180
virtual void resized() override
Called when the overlay is resized. Updates background color and size.
Definition overlay.h:237
void setVisible(bool should_be_visible) override
Sets the visibility of the overlay and notifies listeners.
Definition overlay.h:224
float size_ratio_
A scaling factor for the overlay size.
Definition overlay.h:267
@ kLight
Definition open_gl_image_component.h:309
@ kRegular
Definition open_gl_image_component.h:310
Manages and provides access to vertex and fragment shaders used by the OpenGL rendering pipeline.
Definition shaders.h:19
@ kBodyRounding
Definition skin.h:71
@ kBodyText
Definition skin.h:133
@ kPopupBackground
Definition skin.h:144
@ kBody
Definition skin.h:129
An interface class linking the Vital synthesizer backend (SynthBase) with a GUI.
Definition synth_gui_interface.h:56
void setGuiSize(float scale)
Sets the GUI window or component size based on a scale factor.
Definition synth_gui_interface.cpp:193
virtual AudioDeviceManager * getAudioDeviceManager()
Retrieves the audio device manager if available.
Definition synth_gui_interface.h:78
void paintOpenGlChildrenBackgrounds(Graphics &g)
Paints the backgrounds for all OpenGL child components.
Definition synth_section.cpp:267
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
void addOpenGlComponent(OpenGlComponent *open_gl_component, bool to_beginning=false)
Definition synth_section.cpp:489
constexpr int kNumChannels
Number of output channels (stereo = 2).
Definition synth_constants.h:37