Vital
Loading...
Searching...
No Matches
phase_modifier_overlay.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4#include "phase_editor.h"
5#include "phase_modifier.h"
7#include "text_selector.h"
8
19 public TextEditor::Listener {
20public:
27
35 virtual void frameSelected(WavetableKeyframe* keyframe) override;
36
42 virtual void frameDragged(WavetableKeyframe* keyframe, int position) override { }
43
50 virtual void setEditBounds(Rectangle<int> bounds) override;
51
59 virtual bool setTimeDomainBounds(Rectangle<int> bounds) override;
60
67 virtual void textEditorReturnKeyPressed(TextEditor& text_editor) override;
68
75 virtual void textEditorFocusLost(TextEditor& text_editor) override;
76
84 void phaseChanged(float phase, bool mouse_up) override;
85
92 void sliderValueChanged(Slider* moved_slider) override;
93
100 void sliderDragEnded(Slider* moved_slider) override;
101
108 void setPhaseModifier(PhaseModifier* phase_modifier) {
109 phase_modifier_ = phase_modifier;
110 current_frame_ = nullptr;
111 }
112
113protected:
118 void setPhase(String phase_string);
119
122 std::unique_ptr<PhaseEditor> editor_;
123 std::unique_ptr<PhaseEditor> slider_;
124 std::unique_ptr<TextEditor> phase_text_;
125 std::unique_ptr<TextSelector> phase_style_;
126 std::unique_ptr<SynthSlider> mix_;
127
128 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PhaseModifierOverlay)
129};
Interface for receiving notifications when the phase value changes.
Definition phase_editor.h:26
A keyframe class holding parameters for phase modification at a given position.
Definition phase_modifier.h:41
A WavetableComponent that modifies the phase of frequency components in a wavetable frame.
Definition phase_modifier.h:19
Overlay UI for editing a PhaseModifier's parameters in the wavetable editor.
Definition phase_modifier_overlay.h:19
PhaseModifier * phase_modifier_
The assigned PhaseModifier.
Definition phase_modifier_overlay.h:120
void setPhaseModifier(PhaseModifier *phase_modifier)
Assign the PhaseModifier whose frames this overlay should edit.
Definition phase_modifier_overlay.h:108
void sliderDragEnded(Slider *moved_slider) override
Called when a slider drag operation ends.
Definition phase_modifier_overlay.cpp:166
std::unique_ptr< TextSelector > phase_style_
Selector for phase style.
Definition phase_modifier_overlay.h:125
virtual void frameSelected(WavetableKeyframe *keyframe) override
Called when a new frame is selected.
Definition phase_modifier_overlay.cpp:66
std::unique_ptr< SynthSlider > mix_
Slider for phase mix amount.
Definition phase_modifier_overlay.h:126
void phaseChanged(float phase, bool mouse_up) override
Callback from PhaseEditor when the phase has changed.
Definition phase_modifier_overlay.cpp:136
virtual bool setTimeDomainBounds(Rectangle< int > bounds) override
Set the bounds for the time-domain waveform display area.
Definition phase_modifier_overlay.cpp:119
PhaseModifier::PhaseModifierKeyframe * current_frame_
Currently selected frame from the PhaseModifier.
Definition phase_modifier_overlay.h:121
std::unique_ptr< TextEditor > phase_text_
Text editor for manual phase input.
Definition phase_modifier_overlay.h:124
void sliderValueChanged(Slider *moved_slider) override
Called when a slider value changes.
Definition phase_modifier_overlay.cpp:148
virtual void textEditorFocusLost(TextEditor &text_editor) override
Called when the phase text editor loses focus.
Definition phase_modifier_overlay.cpp:131
void setPhase(String phase_string)
Sets the phase from a text string (in degrees).
Definition phase_modifier_overlay.cpp:170
std::unique_ptr< PhaseEditor > editor_
Interactive phase editor.
Definition phase_modifier_overlay.h:122
virtual void textEditorReturnKeyPressed(TextEditor &text_editor) override
Called when the user presses 'Enter' in the phase text editor.
Definition phase_modifier_overlay.cpp:126
virtual void setEditBounds(Rectangle< int > bounds) override
Set the bounds of editing controls within the overlay.
Definition phase_modifier_overlay.cpp:82
std::unique_ptr< PhaseEditor > slider_
Phase editor used as a reference slider line.
Definition phase_modifier_overlay.h:123
virtual void frameDragged(WavetableKeyframe *keyframe, int position) override
Called when a frame is dragged. Not used in this overlay.
Definition phase_modifier_overlay.h:42
PhaseModifierOverlay()
Constructor.
Definition phase_modifier_overlay.cpp:18
A base overlay component for editing and interacting with a wavetable component's parameters.
Definition wavetable_component_overlay.h:22
Represents a single state of a waveform at a specific position in a wavetable.
Definition wavetable_keyframe.h:35
Declares the TextSelector class and PaintPatternSelector class for selecting text-based options and d...