20 editor_ = std::make_unique<WaveWindowEditor>();
21 addAndMakeVisible(
editor_.get());
31 window_shape_ = std::make_unique<TextSelector>(
"Window Shape");
38 window_shape_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
69 if (keyframe ==
nullptr) {
80 editor_->setPositions(left, right);
89 static constexpr float kWaveShapeWidthHeightRatio = 5.0f;
90 static constexpr float kPositionPaddingRatio = 0.5f;
91 static constexpr float kPositionWidthHeightRatio = 5.0f;
100 int window_shape_width = bounds.getHeight() * kWaveShapeWidthHeightRatio;
101 int position_width = bounds.getHeight() * kPositionWidthHeightRatio;
102 int position_padding = bounds.getHeight() * kPositionPaddingRatio;
103 int total_width = window_shape_width + 2 * position_width + 2 * padding;
107 int x = bounds.getX() + (bounds.getWidth() - total_width) / 2;
109 int y = bounds.getY();
110 int y_title = y + title_height;
111 int height = bounds.getHeight();
112 int height_title = height - title_height;
116 position_width - 2 * position_padding, height_title);
118 position_width - 2 * position_padding, height_title);
152 editor_->setWindowShape(window_shape);
@ kWidgetFillFade
Definition skin.h:108
@ kWidgetPrimary1
Definition skin.h:165
@ kWidgetSecondary1
Definition skin.h:168
void addSlider(SynthSlider *slider, bool show=true, bool listen=true)
Definition synth_section.cpp:445
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
static TextLookAndFeel * instance()
Singleton instance access.
Definition text_look_and_feel.h:106
void setRight(float right)
Sets the right position of the window (0 to 1).
Definition wave_window_modifier.h:82
float getLeft()
Gets the left window position.
Definition wave_window_modifier.h:89
void setLeft(float left)
Sets the left position of the window (0 to 1).
Definition wave_window_modifier.h:73
float getRight()
Gets the right window position.
Definition wave_window_modifier.h:96
WaveWindowModifierKeyframe * getKeyframe(int index)
Retrieves a WaveWindowModifierKeyframe by index.
Definition wave_window_modifier.cpp:112
WindowShape
Defines different windowing curves.
Definition wave_window_modifier.h:25
@ kNumWindowShapes
Definition wave_window_modifier.h:31
void setWindowShape(WindowShape window_shape)
Sets the window shape used by this modifier.
Definition wave_window_modifier.h:146
std::unique_ptr< SynthSlider > left_position_
Slider for the left window position.
Definition wave_window_overlay.h:108
std::unique_ptr< WaveWindowEditor > editor_
Editor for adjusting the window parameters.
Definition wave_window_overlay.h:106
void sliderDragEnded(Slider *moved_slider) override
Called when a slider drag operation ends.
Definition wave_window_overlay.cpp:172
void sliderValueChanged(Slider *moved_slider) override
Called when a slider's value changes.
Definition wave_window_overlay.cpp:145
virtual void setEditBounds(Rectangle< int > bounds) override
Sets the edit bounds for the controls in this overlay.
Definition wave_window_overlay.cpp:88
WaveWindowModifier::WaveWindowModifierKeyframe * current_frame_
The currently active keyframe.
Definition wave_window_overlay.h:105
WaveWindowModifier * wave_window_modifier_
The associated WaveWindowModifier.
Definition wave_window_overlay.h:104
void windowChanged(bool left, bool mouse_up) override
Called when the window editor notifies a window change.
Definition wave_window_overlay.cpp:134
std::unique_ptr< SynthSlider > right_position_
Slider for the right window position.
Definition wave_window_overlay.h:109
virtual bool setTimeDomainBounds(Rectangle< int > bounds) override
Sets the time domain editor's bounds.
Definition wave_window_overlay.cpp:129
virtual void frameSelected(WavetableKeyframe *keyframe) override
Called when a new keyframe is selected.
Definition wave_window_overlay.cpp:68
WaveWindowOverlay()
Constructs a WaveWindowOverlay with default UI elements.
Definition wave_window_overlay.cpp:19
std::unique_ptr< TextSelector > window_shape_
Selector for window shape type.
Definition wave_window_overlay.h:107
void addTitle(const std::string &title)
Adds a title string for the next control section.
Definition wavetable_component_overlay.h:94
void addLine(int position)
Adds a vertical line divider at the given position.
Definition wavetable_component_overlay.h:88
void clearTitles()
Clears all control section titles.
Definition wavetable_component_overlay.h:82
void clearLines()
Clears all line divider positions.
Definition wavetable_component_overlay.h:77
A base overlay component for editing and interacting with a wavetable component's parameters.
Definition wavetable_component_overlay.h:22
void setControlsWidth(int width)
Sets the total width for controls in the overlay.
Definition wavetable_component_overlay.h:267
ControlsBackground controls_background_
Definition wavetable_component_overlay.h:300
virtual void setEditBounds(Rectangle< int > bounds)
Sets the editing bounds within which controls and titles are placed.
Definition wavetable_component_overlay.cpp:67
static constexpr float kTitleHeightRatio
Definition wavetable_component_overlay.h:32
int getPadding()
Gets the current padding value.
Definition wavetable_component_overlay.h:248
void notifyChanged(bool mouse_up)
Notifies listeners that a change has occurred to the frame.
Definition wavetable_component_overlay.cpp:86
Represents a single state of a waveform at a specific position in a wavetable.
Definition wavetable_keyframe.h:35
int index()
Gets the index of this keyframe within its owner component.
Definition wavetable_keyframe.cpp:32
WavetableComponent * owner()
Gets the WavetableComponent that owns this keyframe.
Definition wavetable_keyframe.h:152
Declares the TextSelector class and PaintPatternSelector class for selecting text-based options and d...