15 template<
class Comparator>
16 void sortFiles(Array<File>& file_array) {
17 Comparator comparator;
18 file_array.sort(comparator,
true);
21 String getRelativePath(
const File& file,
const String& folder) {
23 while (parent.exists() && !parent.isRoot()) {
24 parent = parent.getParentDirectory();
25 if (parent.getFileName() == folder)
26 return file.getRelativePathFrom(parent).replaceCharacter(File::getSeparatorChar(),
'/');
29 return file.getFileName();
34 SynthSection(name), num_contents_(0), last_selected_index_(-1), hover_index_(-1),
35 cache_position_(0), view_position_(0), sort_column_(kDate), sort_ascending_(true), selected_(),
36 highlight_(kNumCachedRows,
Shaders::kColorFragment), hover_(
Shaders::kColorFragment) {
37 addAndMakeVisible(browse_area_);
38 browse_area_.setInterceptsMouseClicks(
false,
false);
44 scroll_bar_ = std::make_unique<OpenGlScrollBar>();
45 addAndMakeVisible(scroll_bar_.get());
47 scroll_bar_->addListener(
this);
57 int date_width = getWidth() - name_width;
59 int text_padding = row_height / 2;
63 g.reduceClipRegion(getLocalBounds().removeFromTop(title_width));
64 Rectangle<float> top = getLocalBounds().toFloat().removeFromTop(title_width * 2.0f);
69 scroll_bar_->setColor(lighten);
72 g.fillRect(selected_width, 0, 1, title_width);
73 g.fillRect(selected_width + name_width, 0, 1, title_width);
76 g.setFont(
Fonts::instance()->proportional_regular().withPointHeight(title_width * 0.5f));
78 String name = getName() +
" Name";
79 g.drawText(name, selected_width + text_padding, 0, name_width, title_width, Justification::centredLeft);
80 g.drawText(
"Date", getWidth() - date_width, 0,
81 date_width - text_padding, title_width, Justification::centredRight);
83 setWantsKeyboardFocus(
true);
84 setMouseClickGrabsKeyboardFocus(
true);
88 static constexpr float kScrollBarWidth = 15.0f;
92 int scroll_bar_height = getHeight() - title_width;
93 scroll_bar_->setBounds(getWidth() - scroll_bar_width, title_width, scroll_bar_width, scroll_bar_height);
96 browse_area_.setBounds(0, title_width, getWidth(), getHeight() - title_width);
97 loadBrowserCache(cache_position_, cache_position_ +
kNumCachedRows);
100void ContentList::sort() {
101 if (sort_column_ ==
kName && sort_ascending_)
102 sortFiles<FileNameAscendingComparator>(contents_);
103 else if (sort_column_ ==
kName && !sort_ascending_)
104 sortFiles<FileNameDescendingComparator>(contents_);
105 else if (sort_column_ ==
kDate && sort_ascending_)
106 sortFiles<FileDateAscendingComparator>(contents_);
107 else if (sort_column_ ==
kDate && !sort_ascending_)
108 sortFiles<FileDateDescendingComparator>(contents_);
109 else if (sort_column_ ==
kAdded) {
110 SelectedComparator comparator(selected_files_, sort_ascending_);
111 contents_.sort(comparator,
true);
116 contents_ = std::move(contents);
117 num_contents_ = contents_.size();
124 view_position_ = std::max(0.0f, view_position_);
126 float scaled_height = getHeight() - title_width;
128 view_position_ = std::min(view_position_, 1.0f * scrollable_range - scaled_height);
129 viewPositionChanged();
136 return floorf((mouse_position + getViewPosition() - title_width) /
getRowHeight());
141 if (hover_index_ >= contents_.size())
151 float click_y_position = e.position.y;
152 float click_x_position = e.position.x;
155 if (click_y_position <= title_width) {
160 if (click_x_position < selected_right)
162 else if (click_x_position < name_right)
163 clicked_column =
kName;
165 clicked_column =
kDate;
167 if (clicked_column == sort_column_)
168 sort_ascending_ = !sort_ascending_;
170 sort_ascending_ =
true;
171 sort_column_ = clicked_column;
176 else if (row < contents_.size() && row >= 0) {
178 if (highlighted_files_.count(contents_[row].getFullPathName().toStdString()) == 0)
179 highlightClick(e, row);
180 selectHighlighted(row);
183 highlightClick(e, row);
191 view_position_ = range_start;
192 viewPositionChanged();
196 static constexpr float kScrollStepRatio = 0.05f;
199 float scaled_height = getHeight() - title_width;
201 scroll_bar_->setCurrentRange(view_position_, scaled_height, dontSendNotification);
202 scroll_bar_->setSingleStepSize(scroll_bar_->getHeight() * kScrollStepRatio);
203 scroll_bar_->cancelPendingUpdate();
206void ContentList::selectHighlighted(
int clicked_index) {
207 std::string path = contents_[clicked_index].getFullPathName().toStdString();
208 if (selected_files_.count(path)) {
209 for (
const std::string& highlighted : highlighted_files_)
210 selected_files_.erase(highlighted);
213 for (
const std::string& highlighted : highlighted_files_)
214 selected_files_.insert(highlighted);
218void ContentList::highlightClick(
const MouseEvent& e,
int clicked_index) {
219 int cache_index = clicked_index - cache_position_;
220 if (e.mods.isShiftDown())
221 selectRange(clicked_index);
222 else if (e.mods.isCommandDown()) {
223 std::string path = contents_[clicked_index].getFullPathName().toStdString();
224 bool selected = highlighted_files_.count(path);
226 highlighted_files_.erase(path);
228 highlighted_files_.insert(path);
230 selected_[cache_index] = !selected;
233 highlighted_files_.clear();
235 selected_[i] = i == cache_index;
236 highlighted_files_.insert(contents_[clicked_index].getFullPathName().toStdString());
239 last_selected_index_ = clicked_index;
242void ContentList::selectRange(
int clicked_index) {
243 if (last_selected_index_ < 0)
244 last_selected_index_ = clicked_index;
246 int start = std::min(std::min(clicked_index, last_selected_index_), contents_.size());
247 int end = std::min(std::max(clicked_index, last_selected_index_), contents_.size());
249 for (
int i = start; i <= end; ++i) {
250 int cache_index = i - cache_position_;
252 selected_[cache_index] =
true;
253 highlighted_files_.insert(contents_[i].getFullPathName().toStdString());
258 if (getWidth() <= 0 || getHeight() <= 0)
262 int position = std::max(0, std::min<int>(cache_position_, max));
269 int presets_height = row_height *
static_cast<int>(contents_.size());
270 return std::max(presets_height, getHeight() - title_width);
276 rows_[i].
init(open_gl);
280 highlight_.
init(open_gl);
281 hover_.
init(open_gl);
285void ContentList::viewPositionChanged() {
288 int last_cache_position = cache_position_;
289 cache_position_ = getViewPosition() / row_height;
291 cache_position_ = std::max(0, std::min<int>(cache_position_, max));
293 if (std::abs(cache_position_ - last_cache_position) >=
kNumCachedRows)
295 else if (last_cache_position < cache_position_)
297 else if (last_cache_position > cache_position_)
298 loadBrowserCache(cache_position_, last_cache_position);
301void ContentList::loadBrowserCache(
int start_index,
int end_index) {
304 int image_width = getWidth() * mult;
306 int text_padding = row_height / 2.0f;
307 int add_x = text_padding;
309 int name_x = add_x + add_width;
312 int date_x = image_width - date_width + text_padding;
314 end_index = std::min(
static_cast<int>(contents_.size()), end_index);
318 icon.addRoundedRectangle(0.0f, 0.0f, 1.0f, 1.0f, 0.1f, 0.1f);
320 float add_draw_width = row_height * 0.8f;
321 float add_y = (row_height - add_draw_width) / 2.0f;
322 Rectangle<float> add_bounds((add_width - add_draw_width) / 2.0f, add_y, add_draw_width, add_draw_width);
323 icon.applyTransform(icon.getTransformToScaleToFit(add_bounds,
true));
324 PathStrokeType add_stroke(1.0f, PathStrokeType::curved);
330 for (
int i = start_index; i < end_index; ++i) {
331 Image row_image(Image::ARGB, image_width, row_height,
true);
332 Graphics g(row_image);
334 File content = contents_[i];
335 String name = content.getFileNameWithoutExtension();
336 String date = content.getCreationTime().toString(
true,
false,
false);
338 if (selected_files_.count(content.getFullPathName().toStdString()))
339 g.setColour(add_selected);
341 g.setColour(add_unselected);
345 g.setColour(text_color);
347 g.drawText(name, name_x, 0, name_width - 2 * text_padding, row_height, Justification::centredLeft,
true);
348 g.drawText(date, date_x, 0, date_width - 2 * text_padding, row_height, Justification::centredRight,
true);
351 selected_[i %
kNumCachedRows] = highlighted_files_.count(content.getFullPathName().toStdString());
355void ContentList::moveQuadToRow(
OpenGlMultiQuad* quad,
int index,
int row,
float y_offset) {
358 float open_gl_row_height = 2.0f * row_height / view_height;
359 float offset = row * open_gl_row_height;
361 float y = 1.0f + y_offset - offset;
362 quad->
setQuad(index, -1.0f, y - open_gl_row_height, 2.0f, open_gl_row_height);
367 float view_height = getHeight() - title_width;
369 int num_contents = num_contents_;
371 int view_position = getViewPosition();
372 float y_offset = 2.0f * view_position / view_height;
374 Rectangle<int> view_bounds(0, title_width, getWidth(), getHeight() - title_width);
379 float width_ratio = image_width / getWidth();
380 float height_ratio = image_height / row_height;
382 float open_gl_row_height = 2.0f * row_height / view_height;
383 float open_gl_image_height = height_ratio * open_gl_row_height;
384 int cache_position = std::max(0, std::min(cache_position_, num_contents -
kNumCachedRows));
385 int num_selected = 0;
387 int row = cache_position + i;
389 float offset = (2.0f * row_height * row) / view_height;
390 float y = 1.0f + y_offset - offset;
392 Rectangle<int> row_bounds(0, row_height * row - view_position + title_width, getWidth(), row_height);
396 rows_[cache_index].
setTopRight(-1.0f + 2.0f * width_ratio, y);
397 rows_[cache_index].
setBottomLeft(-1.0f, y - open_gl_image_height);
398 rows_[cache_index].
setBottomRight(-1.0f + 2.0f * width_ratio, y - open_gl_image_height);
401 if (selected_[cache_index]) {
402 highlight_.
setQuad(num_selected, -1.0f, y - open_gl_row_height, 2.0f, open_gl_row_height);
411 if (hover_index_ >= 0) {
412 moveQuadToRow(&hover_, 0, hover_index_, y_offset);
422 rows_[i].destroy(open_gl);
430 export_bank_button_ = std::make_unique<OpenGlToggleButton>(
"Export Bank");
431 export_bank_button_->setEnabled(
false);
432 export_bank_button_->addListener(
this);
433 export_bank_button_->setUiButton(
true);
434 addAndMakeVisible(export_bank_button_.get());
437 addKeyListener(
this);
439 preset_list_ = std::make_unique<ContentList>(
"Preset");
441 wavetable_list_ = std::make_unique<ContentList>(
"Wavetable");
443 lfo_list_ = std::make_unique<ContentList>(
"LFO");
445 sample_list_ = std::make_unique<ContentList>(
"Sample");
448#if !defined(NO_TEXT_ENTRY)
449 bank_name_box_ = std::make_unique<OpenGlTextEditor>(
"Bank Name");
450 bank_name_box_->addListener(
this);
451 bank_name_box_->setSelectAllWhenFocused(
true);
452 bank_name_box_->setMultiLine(
false,
false);
453 bank_name_box_->setJustification(Justification::centredLeft);
454 addAndMakeVisible(bank_name_box_.get());
458 setWantsKeyboardFocus(
true);
459 setMouseClickGrabsKeyboardFocus(
true);
467 Rectangle<int> export_bounds = wavetable_list_->getBounds();
468 export_bounds.setY(0);
473 empty_color = empty_color.withAlpha(0.5f * empty_color.getFloatAlpha());
476 if (bank_name_box_) {
477 bank_name_box_->setTextToShowWhenEmpty(TRANS(
"Bank Name"), empty_color);
479 bank_name_box_->setColour(TextEditor::textColourId, findColour(
Skin::kBodyText,
true));
480 bank_name_box_->setColour(TextEditor::highlightedTextColourId, findColour(
Skin::kBodyText,
true));
482 bank_name_box_->redoImage();
492 Rectangle<int> export_bounds = wavetable_list_->getBounds();
493 export_bounds.setY(0);
499 static constexpr float kOptionsHeight = 0.08f;
502 int browse_width = getWidth() / 2 - padding_width;
503 preset_list_->setBounds(0, 0, browse_width, getHeight());
505 int options_height = kOptionsHeight * getHeight();
506 int other_browse_x = getWidth() - browse_width - padding_width;
507 int other_browse_height = (getHeight() - options_height - 2.0f * padding_width) / 3.0f;
509 wavetable_list_->setBounds(other_browse_x, options_height, browse_width, other_browse_height);
511 Rectangle<int> export_bounds = wavetable_list_->getBounds();
512 export_bounds.setY(0);
515 int lfo_y = wavetable_list_->getBottom() + padding_width;
516 lfo_list_->setBounds(other_browse_x, lfo_y, browse_width, other_browse_height);
518 int sample_y = getHeight() - other_browse_height;
519 sample_list_->setBounds(other_browse_x, sample_y, browse_width, other_browse_height);
522 int active_export_width = export_bounds.getWidth() - 3 * widget_margin;
523 int bank_name_width = active_export_width / 2;
524 int export_button_width = active_export_width - bank_name_width;
525 int options_y = export_bounds.getY() + widget_margin;
526 int option_component_height = export_bounds.getHeight() - 2 * widget_margin;
528 int name_x = export_bounds.getX() + widget_margin;
529 int export_button_x = name_x + bank_name_width + widget_margin;
530 export_bank_button_->setBounds(export_button_x, options_y, export_button_width, option_component_height);
532 if (bank_name_box_) {
533 bank_name_box_->setBounds(name_x, options_y, bank_name_width, option_component_height);
534 bank_name_box_->resized();
539 SynthSection::visibilityChanged();
545 bool enabled = bank_name_box_ && bank_name_box_->getText().trim() !=
"";
546 if (enabled == export_bank_button_->isEnabled())
549 export_bank_button_->setEnabled(enabled);
553void BankExporter::setButtonColors() {
554 if (export_bank_button_->isEnabled())
563void BankExporter::exportBank() {
564 ZipFile::Builder bank_zip;
565 String bank_name = bank_name_box_->getText().trim();
566 if (bank_name.isEmpty())
569 std::set<std::string> presets = preset_list_->selectedFiles();
570 std::set<std::string> wavetables = wavetable_list_->selectedFiles();
571 std::set<std::string> lfos = lfo_list_->selectedFiles();
572 std::set<std::string> samples = sample_list_->selectedFiles();
574 if (presets.empty() && wavetables.empty() && lfos.empty() && samples.empty())
578 for (
const std::string& path : presets) {
585 for (
const std::string& path : wavetables) {
586 File wavetable(path);
587 if (wavetable.exists())
592 for (
const std::string& path : lfos) {
599 for (
const std::string& path : samples) {
605 File file = File::getCurrentWorkingDirectory().getChildFile(bank_name +
"." +
vital::kBankExtension);
607 if (export_box.browseForFileToSave(
true)) {
609 if (destination.hasWriteAccess()) {
610 FileOutputStream output_stream(destination);
611 if (output_stream.openedOk())
612 bank_zip.writeToStream(output_stream,
nullptr);
617void BankExporter::loadFiles() {
620 preset_list_->setContent(presets);
622 Array<File> wavetables;
624 wavetable_list_->setContent(wavetables);
628 lfo_list_->setContent(lfos);
632 sample_list_->setContent(samples);
636 if (clicked_button == export_bank_button_.get())
641 if (key.getKeyCode() == KeyPress::escapeKey && isVisible()) {
645 return bank_name_box_->hasKeyboardFocus(
true);
650 return bank_name_box_->hasKeyboardFocus(
true);
Declares the ContentList and BankExporter classes for exporting banks of presets, wavetables,...
void visibilityChanged() override
Called when visibility changes, loads files if becoming visible.
Definition bank_exporter.cpp:538
bool keyPressed(const KeyPress &key, Component *origin) override
Definition bank_exporter.cpp:640
bool keyStateChanged(bool is_key_down, Component *origin) override
Definition bank_exporter.cpp:648
void textEditorTextChanged(TextEditor &editor) override
Definition bank_exporter.cpp:544
~BankExporter()
Destructor.
void paintBackgroundShadow(Graphics &g) override
Definition bank_exporter.cpp:486
void paintBackground(Graphics &g) override
Definition bank_exporter.cpp:465
void resized() override
Resizes and lays out child components.
Definition bank_exporter.cpp:498
void buttonClicked(Button *clicked_button) override
Definition bank_exporter.cpp:635
BankExporter()
Constructor.
Definition bank_exporter.cpp:429
static constexpr float kScrollSensitivity
Scroll sensitivity factor.
Definition bank_exporter.h:51
void scrollBarMoved(ScrollBar *scroll_bar, double range_start) override
Definition bank_exporter.cpp:190
ContentList(const std::string &name)
Definition bank_exporter.cpp:33
void setContent(Array< File > presets)
Definition bank_exporter.cpp:115
static constexpr float kDateWidthRatio
Width ratio allocated to the date column.
Definition bank_exporter.h:49
static constexpr float kNameWidthRatio
Width ratio allocated to the name column.
Definition bank_exporter.h:47
void mouseWheelMove(const MouseEvent &e, const MouseWheelDetails &wheel) override
Handles mouse wheel events for scrolling.
Definition bank_exporter.cpp:122
int getScrollableRange()
Definition bank_exporter.cpp:266
int getRowFromPosition(float mouse_position)
Definition bank_exporter.cpp:133
void setScrollBarRange()
Updates the scrollbar range based on content size and view position.
Definition bank_exporter.cpp:195
void resized() override
Resizes and lays out child components.
Definition bank_exporter.cpp:87
void renderOpenGlComponents(OpenGlWrapper &open_gl, bool animate) override
Definition bank_exporter.cpp:365
void destroyOpenGlComponents(OpenGlWrapper &open_gl) override
Definition bank_exporter.cpp:420
int getRowHeight()
Definition bank_exporter.h:142
void mouseMove(const MouseEvent &e) override
Handles mouse move events for hover effects.
Definition bank_exporter.cpp:139
void mouseDown(const MouseEvent &e) override
Handles mouse down events for selection and sorting actions.
Definition bank_exporter.cpp:149
void redoCache()
Reloads cached rows after content changes.
Definition bank_exporter.cpp:257
void mouseExit(const MouseEvent &e) override
Handles mouse exit events to clear hover state.
Definition bank_exporter.cpp:145
void paintBackground(Graphics &g) override
Definition bank_exporter.cpp:50
static constexpr float kAddWidthRatio
Width ratio allocated to the "add" (selection) column.
Definition bank_exporter.h:45
void initOpenGlComponents(OpenGlWrapper &open_gl) override
Definition bank_exporter.cpp:273
static constexpr int kNumCachedRows
Number of rows to keep cached.
Definition bank_exporter.h:41
Column
Columns used in the list for sorting and display.
Definition bank_exporter.h:32
@ kDate
Column representing file date.
Definition bank_exporter.h:36
@ kAdded
Column representing selection status.
Definition bank_exporter.h:34
@ kName
Column representing file name.
Definition bank_exporter.h:35
Font & proportional_light()
Returns a reference to the proportional light font.
Definition fonts.h:28
static Fonts * instance()
Gets the singleton instance of the Fonts class.
Definition fonts.h:52
static const std::string kPresetFolderName
Definition load_save.h:74
static void getAllUserLfos(Array< File > &lfos)
Retrieves all user LFO shapes (from data and user directories).
Definition load_save.cpp:1871
static const std::string kSampleFolderName
Definition load_save.h:77
static void getAllUserPresets(Array< File > &presets)
Retrieves all user presets (from data and user directories).
Definition load_save.cpp:1855
static const std::string kLfoFolderName
Definition load_save.h:78
static void getAllUserWavetables(Array< File > &wavetables)
Retrieves all user wavetables (from data and user directories).
Definition load_save.cpp:1863
static const std::string kWavetableFolderName
Definition load_save.h:75
static void getAllUserSamples(Array< File > &samples)
Retrieves all user samples (from data and user directories).
Definition load_save.cpp:1879
static bool setViewPort(Component *component, Rectangle< int > bounds, OpenGlWrapper &open_gl)
Sets the OpenGL viewport to match a specified rectangle within a component.
Definition open_gl_component.cpp:42
static void setScissorBounds(Component *component, Rectangle< int > bounds, OpenGlWrapper &open_gl)
Sets the OpenGL scissor region to a specified rectangle within a component.
Definition open_gl_component.cpp:82
void setOwnImage(Image &image)
Sets the image from an owned copy.
Definition open_gl_image.h:69
void init(OpenGlWrapper &open_gl)
Initializes the OpenGL buffers and shader attributes needed for rendering the image.
Definition open_gl_image.cpp:33
void setBottomLeft(float x, float y)
Sets the bottom-left corner position of the image quad.
Definition open_gl_image.h:116
void drawImage(OpenGlWrapper &open_gl)
Draws the image to the current OpenGL context.
Definition open_gl_image.cpp:59
void setScissor(bool scissor)
Enables or disables scissor test when drawing the image.
Definition open_gl_image.h:156
void setBottomRight(float x, float y)
Sets the bottom-right corner position of the image quad.
Definition open_gl_image.h:121
void setTopLeft(float x, float y)
Sets the top-left corner position of the image quad.
Definition open_gl_image.h:111
void setTopRight(float x, float y)
Sets the top-right corner position of the image quad.
Definition open_gl_image.h:126
void setColor(Colour color)
Sets the color tint applied to the image.
Definition open_gl_image.h:92
A component for rendering multiple quads using OpenGL, with customizable colors, rounding,...
Definition open_gl_multi_quad.h:16
virtual void init(OpenGlWrapper &open_gl) override
Initializes OpenGL buffers and shader attributes.
Definition open_gl_multi_quad.cpp:37
void setQuad(int i, float x, float y, float w, float h)
Sets the position and size of a quad in normalized device space.
Definition open_gl_multi_quad.h:313
void setTargetComponent(Component *target_component)
Sets a target component to help position the quads.
Definition open_gl_multi_quad.h:358
void setNumQuads(int num_quads)
Sets how many quads will actually be drawn (up to max_quads).
Definition open_gl_multi_quad.h:92
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the quads using OpenGL.
Definition open_gl_multi_quad.cpp:92
virtual void destroy(OpenGlWrapper &open_gl) override
Releases OpenGL resources when the component is destroyed.
Definition open_gl_multi_quad.cpp:69
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
void setAdditive(bool additive)
Enables or disables additive blending for rendering.
Definition open_gl_multi_quad.h:377
static Path plusOutline()
Definition paths.h:322
Manages and provides access to vertex and fragment shaders used by the OpenGL rendering pipeline.
Definition shaders.h:19
@ kWidgetMargin
Definition skin.h:103
@ kBodyRounding
Definition skin.h:71
@ kLargePadding
Definition skin.h:82
@ kUiButtonPressed
Definition skin.h:195
@ kUiActionButton
Definition skin.h:196
@ kUiButtonHover
Definition skin.h:194
@ kWidgetPrimary1
Definition skin.h:165
@ kWidgetBackground
Definition skin.h:173
@ kBodyText
Definition skin.h:133
@ kWidgetSecondary1
Definition skin.h:168
@ kLightenScreen
Definition skin.h:141
@ kUiActionButtonHover
Definition skin.h:197
@ kUiActionButtonPressed
Definition skin.h:198
@ kUiButton
Definition skin.h:192
@ kTextEditorSelection
Definition skin.h:203
@ kTextComponentText
Definition skin.h:148
@ kTextEditorCaret
Definition skin.h:202
@ kBody
Definition skin.h:129
@ kPresetBrowser
Definition skin.h:57
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
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
void addSubSection(SynthSection *section, bool show=true)
Adds a subsection (another SynthSection) as a child.
Definition synth_section.cpp:457
virtual void paintBody(Graphics &g, Rectangle< int > bounds)
Paints the body background within given bounds.
Definition synth_section.cpp:165
void paintChildrenBackgrounds(Graphics &g)
Paints the backgrounds for all child sections.
Definition synth_section.cpp:274
virtual int getPixelMultiple() const
Definition synth_section.cpp:729
virtual void destroyOpenGlComponents(OpenGlWrapper &open_gl)
Destroys all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:383
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
float getSizeRatio() const
Definition synth_section.h:765
float getTitleWidth()
Definition synth_section.cpp:629
void setSkinOverride(Skin::SectionOverride skin_override)
Definition synth_section.h:303
virtual void initOpenGlComponents(OpenGlWrapper &open_gl)
Initializes all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:349
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188
force_inline int nextPowerOfTwo(mono_float value)
Finds the next power of two greater than or equal to a float value.
Definition utils.h:370
const std::string kBankExtension
File extension for Vital bank files, which group multiple presets.
Definition synth_constants.h:103
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174