Vital
Loading...
Searching...
No Matches
about_section.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "JuceHeader.h"
7#include "overlay.h"
10
11class AppLogo;
12
18class OpenGlDeviceSelector : public OpenGlAutoImageComponent<AudioDeviceSelectorComponent> {
19public:
30 OpenGlDeviceSelector(AudioDeviceManager& device_manager,
31 int min_audio_input_channels, int max_audioInput_channels,
32 int min_audio_output_channels, int max_audioOutput_channels,
33 bool show_midi_input_options, bool show_midi_output_selector,
34 bool show_channels_as_stereo_pairs, bool hide_advanced_options_with_button)
35 : OpenGlAutoImageComponent<AudioDeviceSelectorComponent>(device_manager,
36 min_audio_input_channels, max_audioInput_channels,
37 min_audio_output_channels, max_audioOutput_channels,
38 show_midi_input_options, show_midi_output_selector,
39 show_channels_as_stereo_pairs,
40 hide_advanced_options_with_button) {
41 setLookAndFeel(DefaultLookAndFeel::instance());
43 }
44
46 void resized() override {
48 if (isShowing())
49 redoImage();
50 }
51
52private:
53 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(OpenGlDeviceSelector)
54};
55
64class AboutSection : public Overlay {
65public:
67 static constexpr int kInfoWidth = 430;
68 static constexpr int kBasicInfoHeight = 250;
69 static constexpr int kPaddingX = 25;
70 static constexpr int kPaddingY = 15;
71 static constexpr int kButtonHeight = 30;
72 static constexpr int kLeftLogoBuffer = 95;
73 static constexpr int kNameRightBuffer = 85;
74 static constexpr int kLogoWidth = 96;
75
77 static constexpr float kMultExtraSmall = 0.5f;
78 static constexpr float kMultSmall = 0.7f;
79 static constexpr float kMultLarge = 1.35f;
80 static constexpr float kMultDouble = 2.0f;
81 static constexpr float kMultTriple = 3.0f;
82 static constexpr float kMultQuadruple = 4.0f;
83
86 AboutSection(const String& name);
87
89 virtual ~AboutSection();
90
92 void setLogoBounds();
93
95 void resized() override;
96
101
104 Rectangle<int> getInfoRect();
105
108 void mouseUp(const MouseEvent& e) override;
109
112 void setVisible(bool should_be_visible) override;
113
116 void buttonClicked(Button* clicked_button) override;
117
118private:
121 void setGuiSize(float multiplier);
122
124 void fullScreen();
125
126 std::unique_ptr<OpenGlDeviceSelector> device_selector_;
127 std::unique_ptr<OpenGlToggleButton> check_for_updates_;
128 std::unique_ptr<PlainTextComponent> check_for_updates_text_;
129
130 std::unique_ptr<OpenGlToggleButton> size_button_extra_small_;
131 std::unique_ptr<OpenGlToggleButton> size_button_small_;
132 std::unique_ptr<OpenGlToggleButton> size_button_normal_;
133 std::unique_ptr<OpenGlToggleButton> size_button_large_;
134 std::unique_ptr<OpenGlToggleButton> size_button_double_;
135 std::unique_ptr<OpenGlToggleButton> size_button_triple_;
136 std::unique_ptr<OpenGlToggleButton> size_button_quadruple_;
137
138 OpenGlQuad body_;
139 std::unique_ptr<AppLogo> logo_;
140 std::unique_ptr<PlainTextComponent> name_text_;
141 std::unique_ptr<PlainTextComponent> version_text_;
142 std::unique_ptr<PlainTextComponent> check_updates_text_;
143
144 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AboutSection)
145};
An overlay section that displays application information, device settings, and UI scaling options.
Definition about_section.h:64
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
void renderOpenGlComponents(OpenGlWrapper &open_gl, bool animate) override
Renders OpenGL components by forwarding to the base class rendering method.
Definition about_section.h:98
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
Displays the application's logo using paths and gradients.
Definition synth_section.h:140
static DefaultLookAndFeel * instance()
Singleton instance accessor.
Definition default_look_and_feel.h:157
A template class that wraps a given ComponentType and automatically redraws an OpenGlImageComponent o...
Definition open_gl_image_component.h:153
virtual void redoImage()
Definition open_gl_image_component.h:196
OpenGlImageComponent image_component_
Definition open_gl_image_component.h:199
A device selector component rendered using OpenGL for improved performance.
Definition about_section.h:18
OpenGlDeviceSelector(AudioDeviceManager &device_manager, int min_audio_input_channels, int max_audioInput_channels, int min_audio_output_channels, int max_audioOutput_channels, bool show_midi_input_options, bool show_midi_output_selector, bool show_channels_as_stereo_pairs, bool hide_advanced_options_with_button)
Definition about_section.h:30
void resized() override
Called when the component is resized; triggers a redraw of the image.
Definition about_section.h:46
void setComponent(Component *component)
Sets the component to be drawn into the OpenGL image. If not set, uses this component.
Definition open_gl_image_component.h:83
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
A SynthSection that displays an overlay with a background and optional listeners.
Definition overlay.h:180
virtual void renderOpenGlComponents(OpenGlWrapper &open_gl, bool animate)
Renders all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:357
virtual void animate(bool animate)
Triggers animation state change in sub-sections if needed.
Definition synth_section.cpp:822
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174