Krotos Modules 3
Loading...
Searching...
No Matches
KwidgetGUI_PhaseVocoder.cpp
Go to the documentation of this file.
1namespace krotos
2{
4 {
5 using P = Parameters;
6
7 addAndMakeVisible(m_mode);
8 m_mode.addItemList({"Robotizer", "PitchShifter", "TimeStrecher"}, 1);
10
11 addAndMakeVisible(m_window);
12 m_window.addItemList({"NoWindow", "Hann", "Hamming", "Rectangular", "BlackmanHarris"}, 2);
14
15 addAttachedComponent(m_generalSlider, P::GeneralParam);
16 }
17
19 {
21 Rectangle<int> bounds = m_currentBounds;
22 auto topBounds = bounds.removeFromTop(15);
23 topBounds.removeFromLeft(5);
24
25 FlexBox fb;
26
27 fb.flexDirection = FlexBox::Direction::row;
28 fb.flexWrap = FlexBox::Wrap::noWrap;
29 fb.alignContent = FlexBox::AlignContent::stretch;
30 fb.alignItems = FlexBox::AlignItems::stretch;
31 fb.justifyContent = FlexBox::JustifyContent::center;
32
33 FlexItem::Margin margin{0.0f, 0.0f, 0.0f, 0.0f};
34 float minWidth = m_currentBounds.getWidth() * 0.25f;
35 float minHeight = m_currentBounds.getHeight() * 0.7f;
36 fb.items.add(FlexItem(m_generalSlider)
37 .withMargin(margin)
38 .withMinWidth(minWidth)
39 .withMinHeight(minHeight)
40 .withFlex(1.0f));
41 fb.performLayout(bounds);
42
43 auto modeBounds = topBounds.removeFromLeft(static_cast<int>(getWidth() * 0.45f));
44 m_mode.setBounds(modeBounds);
45
46 auto windowBounds = topBounds.removeFromLeft(static_cast<int>(getWidth() * 0.45f));
47 m_window.setBounds(windowBounds);
48 }
49} // namespace krotos
KwidgetGUI_PhaseVocoder(Kwidget &owner)
Definition KwidgetGUI_PhaseVocoder.cpp:3
ComboBox m_window
Definition KwidgetGUI_PhaseVocoder.h:16
Kwidget_PhaseVocoder::Parameters Parameters
Definition KwidgetGUI_PhaseVocoder.h:6
ComboBox m_mode
Definition KwidgetGUI_PhaseVocoder.h:13
std::unique_ptr< ComboBoxParameterAttachment > m_modeAttachment
Definition KwidgetGUI_PhaseVocoder.h:14
AttachedSlider m_generalSlider
Definition KwidgetGUI_PhaseVocoder.h:19
std::unique_ptr< ComboBoxParameterAttachment > m_windowAttachment
Definition KwidgetGUI_PhaseVocoder.h:17
void resized() override
Definition KwidgetGUI_PhaseVocoder.cpp:18
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