Krotos Modules 3
Loading...
Searching...
No Matches
KwidgetGUI_Filter.cpp
Go to the documentation of this file.
1namespace krotos
2{
4 {
5 using P = Parameters;
6
11
12 addAndMakeVisible(m_mode);
13 m_mode.addItemList({"LPF12", "LPF24", "HPF12", "HPF24", "BPF12", "BPF24"}, 1);
15
16 addAndMakeVisible(m_bypass);
18 }
19
21 {
23 Rectangle<int> bounds = m_currentBounds;
24 FlexBox fb;
25
26 fb.flexDirection = FlexBox::Direction::row;
27 fb.flexWrap = FlexBox::Wrap::wrap;
28 fb.alignContent = FlexBox::AlignContent::stretch;
29 fb.alignItems = FlexBox::AlignItems::stretch;
30 fb.justifyContent = FlexBox::JustifyContent::center;
31
32 FlexItem::Margin margin{2.0f, 2.0f, 2.0f, 2.0f};
33 fb.items.add(FlexItem(m_cutoff).withMargin(margin).withMinWidth(20).withMinHeight(80).withFlex(1.0f));
34 fb.items.add(FlexItem(m_resonance).withMargin(margin).withMinWidth(20).withMinHeight(80).withFlex(1.0f));
35 fb.items.add(FlexItem(m_drive).withMargin(margin).withMinWidth(20).withMinHeight(80).withFlex(1.0f));
36 fb.items.add(FlexItem(m_mix).withMargin(margin).withMinWidth(20).withMinHeight(80).withFlex(1.0f));
37
38 auto bottomBounds = bounds;
39 auto topBounds = bottomBounds.removeFromTop(30);
40
41 auto modeBounds = topBounds.removeFromLeft(static_cast<int>(getWidth() * 0.8f));
42 auto bypassBounds = topBounds;
43
44 fb.performLayout(bottomBounds);
45 m_mode.setBounds(modeBounds);
46 m_bypass.setBounds(bypassBounds);
47 }
48} // namespace krotos
ToggleButton m_bypass
Definition KwidgetGUI_Filter.h:19
AttachedSlider m_cutoff
Definition KwidgetGUI_Filter.h:13
std::unique_ptr< ComboBoxParameterAttachment > m_modeAttachment
Definition KwidgetGUI_Filter.h:17
AttachedSlider m_drive
Definition KwidgetGUI_Filter.h:13
AttachedSlider m_resonance
Definition KwidgetGUI_Filter.h:13
KwidgetGUI_Filter(Kwidget &owner)
Definition KwidgetGUI_Filter.cpp:3
void resized() override
Definition KwidgetGUI_Filter.cpp:20
Kwidget_Filter::Parameters Parameters
Definition KwidgetGUI_Filter.h:6
ComboBox m_mode
Definition KwidgetGUI_Filter.h:16
std::unique_ptr< ButtonParameterAttachment > m_bypassAttachment
Definition KwidgetGUI_Filter.h:20
AttachedSlider m_mix
Definition KwidgetGUI_Filter.h:14
Interface for a UI Component that controls a KwidgetProcessor.
Definition KwidgetGUI.h:24
std::unique_ptr< SliderParameterAttachment > createParameterAttachment(const String &paramID, Slider &slider)
Definition KwidgetGUI.cpp:72
void addAttachedComponent(AttachedComponentType &component, const String &paramID, bool isDraggable=true)
Definition KwidgetGUI.h:112
Rectangle< int > m_currentBounds
Definition KwidgetGUI.h:146
void resized() override
Definition KwidgetGUI.cpp:45
Definition Kwidget.h:8
Definition AirAbsorptionFilter.cpp:2