9 font_height_ratio_(kDefaultFontHeightRatio),
10 round_amount_(0.0f), hover_(false), text_component_(false) {
11 static const PathStrokeType arrow_stroke(0.05f, PathStrokeType::JointStyle::curved,
12 PathStrokeType::EndCapStyle::rounded);
14 text_ = std::make_unique<PlainTextComponent>(
"Text",
"Init");
16 text_->setInterceptsMouseClicks(
false,
false);
18 text_->setScissor(
true);
19 Path prev_line, prev_shape, next_line, next_shape;
22 prev_preset_ = std::make_unique<OpenGlShapeButton>(
"Prev");
23 addAndMakeVisible(prev_preset_.get());
25 prev_preset_->addListener(
this);
26 prev_line.startNewSubPath(0.65f, 0.3f);
27 prev_line.lineTo(0.35f, 0.5f);
28 prev_line.lineTo(0.65f, 0.7f);
30 arrow_stroke.createStrokedPath(prev_shape, prev_line);
31 prev_shape.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
32 prev_shape.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
33 prev_preset_->setShape(prev_shape);
36 next_preset_ = std::make_unique<OpenGlShapeButton>(
"Next");
37 addAndMakeVisible(next_preset_.get());
39 next_preset_->addListener(
this);
40 next_line.startNewSubPath(0.35f, 0.3f);
41 next_line.lineTo(0.65f, 0.5f);
42 next_line.lineTo(0.35f, 0.7f);
44 arrow_stroke.createStrokedPath(next_shape, next_line);
45 next_shape.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
46 next_shape.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
47 next_preset_->setShape(next_shape);
65 if (text_component_) {
66 SynthSection* parent = findParentComponentOfClass<SynthSection>();
69 int button_y = (getHeight() - button_height) / 2 + offset;
70 prev_preset_->setBounds(0, button_y, button_height, button_height);
71 next_preset_->setBounds(getWidth() - button_height, button_y, button_height, button_height);
72 text_->setBounds(getLocalBounds().translated(0, offset));
73 text_->setTextSize(button_height);
76 int height = getHeight();
77 text_->setBounds(Rectangle<int>(height, 0, getWidth() - 2 * height, height));
78 text_->setTextSize(height * font_height_ratio_);
79 prev_preset_->setBounds(0, 0, height, height);
80 next_preset_->setBounds(getWidth() - height, 0, height, height);
@ kTitle
Definition open_gl_image_component.h:308
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
virtual void resized() override
Called when the component is resized. Arranges layout of child components.
Definition synth_section.cpp:35
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