Vital
Loading...
Searching...
No Matches
WavetableEditSection Class Reference

A UI section for editing, visualizing, and managing wavetables. More...

#include <wavetable_edit_section.h>

Inheritance diagram for WavetableEditSection:
SynthSection PresetSelector::Listener WavetableOrganizer::Listener WavetableComponentList::Listener WavetablePlayhead::Listener WavetableComponentOverlay::Listener SynthButton::ButtonListener

Public Types

enum  MenuItems {
  kCancelled , kSaveAsWavetable , kImportWavetable , kExportWavetable ,
  kExportWav , kResynthesizeWavetable , kNumMenuItems
}
 Menu items for main menu actions. More...
 
enum  BarEditorMenu {
  kCancel = 0 , kPowerScale , kAmplitudeScale , kZoom1 ,
  kZoom2 , kZoom4 , kZoom8 , kZoom16
}
 Menu items for the bar editor settings. More...
 

Public Member Functions

 WavetableEditSection (int index, WavetableCreator *wavetable_creator)
 Constructs a WavetableEditSection.
 
virtual ~WavetableEditSection ()
 Destructor.
 
Rectangle< int > getFrameEditBounds ()
 Gets the bounds of the frame editing area.
 
Rectangle< int > getTimelineBounds ()
 Gets the bounds of the timeline area.
 
void paintBackground (Graphics &g) override
 Paints the background of the wavetable edit section, including children.
 
void paintBackgroundShadow (Graphics &g) override
 Paints any background shadow or tab shadows for the section.
 
void resized () override
 Called when the component is resized, arranges the layout of UI elements.
 
void reset () override
 Resets the editing section, clearing and re-initializing components.
 
void visibilityChanged () override
 Called when visibility changes, e.g., updating UI if made visible.
 
void mouseWheelMove (const MouseEvent &e, const MouseWheelDetails &wheel) override
 Handles mouse wheel movement for zooming frequency domain views.
 
void componentAdded (WavetableComponent *component) override
 Callback when a wavetable component is added to the list.
 
void componentRemoved (WavetableComponent *component) override
 Callback when a wavetable component is removed.
 
void componentsReordered () override
 Called when components are reordered.
 
void componentsChanged () override
 Callback when components in the list change.
 
int getTopHeight ()
 Gets the top section height for title and controls.
 
void playheadMoved (int position) override
 Callback for when the playhead moves to a different frame.
 
void setWaveFrameSlider (Slider *slider)
 Sets the WaveFrame slider to reflect current editing frame position.
 
void frameDoneEditing () override
 Callback when a frame finishes editing, triggers a waveform re-render.
 
void frameChanged () override
 Callback when a frame changes, triggers a display re-render.
 
void prevClicked () override
 Callback when 'previous' is clicked, attempts to load previous wavetable.
 
void nextClicked () override
 Callback when 'next' is clicked, attempts to load next wavetable.
 
void textMouseDown (const MouseEvent &e) override
 Callback when text is clicked, possibly showing a browser to load wavetable.
 
void loadDefaultWavetable ()
 Loads the default wavetable (initializes a blank state).
 
void saveAsWavetable ()
 Saves the current wavetable state as a file.
 
void importWavetable ()
 Imports an external wavetable file.
 
void exportWavetable ()
 Exports the current wavetable as a .vitaltable file.
 
void exportToWav ()
 Exports the current wavetable frames as a .wav file.
 
void loadFile (const File &wavetable_file) override
 Loads a wavetable file from disk.
 
File getCurrentFile () override
 Gets the current wavetable file being edited.
 
void loadWavetable (json &wavetable_data)
 Loads a wavetable from JSON data.
 
json getWavetableJson ()
 Gets the current wavetable state as JSON.
 
bool loadAudioAsWavetable (String name, InputStream *audio_stream, WavetableCreator::AudioFileLoadStyle style)
 Loads audio data as a wavetable.
 
void resynthesizeToWavetable ()
 Resynthesizes the current preset into a wavetable.
 
virtual void buttonClicked (Button *clicked_button) override
 Handles button clicks for menu, settings, exit, etc.
 
virtual void positionsUpdated () override
 Callback for when positions in the wavetable organizer are updated.
 
virtual void frameSelected (WavetableKeyframe *keyframe) override
 Callback when a frame is selected in the wavetable organizer.
 
virtual void frameDragged (WavetableKeyframe *keyframe, int position) override
 Callback when a frame is dragged to a new position.
 
virtual void wheelMoved (const MouseEvent &e, const MouseWheelDetails &wheel) override
 Callback for wheel movements in the component list area.
 
void renderOpenGlComponents (OpenGlWrapper &open_gl, bool animate) override
 Renders the OpenGL components, including overlays.
 
void setPowerScale (bool power_scale)
 Sets whether the frequency display uses power scale or amplitude scale.
 
void setZoom (int zoom)
 Sets the zoom level for frequency domain rendering.
 
void clear ()
 Clears the current wavetable editing state.
 
void init ()
 Initializes the wavetable state after loading or clearing.
 
std::string getLastBrowsedWavetable ()
 Gets the last browsed wavetable file.
 
std::string getName ()
 Gets the current wavetable name.
 
- Public Member Functions inherited from SynthSection
 SynthSection (const String &name)
 Constructs a SynthSection with a given name.
 
virtual ~SynthSection ()=default
 
void setParent (const SynthSection *parent)
 Sets the parent SynthSection.
 
float findValue (Skin::ValueId value_id) const
 Finds a value in the skin overrides or from the parent if not found locally.
 
virtual void paint (Graphics &g) override
 Called when the component should paint itself.
 
virtual void paintSidewaysHeadingText (Graphics &g)
 Paints the section name heading text vertically if sideways_heading_ is true.
 
virtual void paintHeadingText (Graphics &g)
 Paints the heading text for this section, either sideways or horizontally.
 
virtual void setSkinValues (const Skin &skin, bool top_level)
 Sets skin values (colors, sizes) and applies them to sub-sections.
 
void setSkinOverride (Skin::SectionOverride skin_override)
 
virtual void repaintBackground ()
 Requests a repaint of the background.
 
void showPopupBrowser (SynthSection *owner, Rectangle< int > bounds, std::vector< File > directories, String extensions, std::string passthrough_name, std::string additional_folders_name)
 Shows a file browser popup (e.g., for loading samples or wavetables).
 
void updatePopupBrowser (SynthSection *owner)
 Updates the currently visible popup browser if any.
 
void showPopupSelector (Component *source, Point< int > position, const PopupItems &options, std::function< void(int)> callback, std::function< void()> cancel={ })
 Shows a popup selector with options.
 
void showDualPopupSelector (Component *source, Point< int > position, int width, const PopupItems &options, std::function< void(int)> callback)
 Shows a dual popup selector for hierarchical selection.
 
void showPopupDisplay (Component *source, const std::string &text, BubbleComponent::BubblePlacement placement, bool primary)
 Shows a brief popup display (like a tooltip).
 
void hidePopupDisplay (bool primary)
 Hides the currently shown popup display.
 
virtual std::string getFileName ()
 Gets the name of the currently loaded file. Overridden by subclasses.
 
virtual std::string getFileAuthor ()
 Gets the author metadata of the currently loaded file. Overridden by subclasses.
 
virtual void paintContainer (Graphics &g)
 Paints the container background, body, heading, etc.
 
virtual void paintBody (Graphics &g, Rectangle< int > bounds)
 Paints the body background within given bounds.
 
virtual void paintBorder (Graphics &g, Rectangle< int > bounds)
 Paints the border around given bounds.
 
virtual void paintBody (Graphics &g)
 Paints the section body background using the entire component area.
 
virtual void paintBorder (Graphics &g)
 Paints the border around the entire component.
 
int getComponentShadowWidth ()
 Gets the width of shadow around components.
 
virtual void paintTabShadow (Graphics &g)
 Paints a tab-like shadow effect around the component.
 
void paintTabShadow (Graphics &g, Rectangle< int > bounds)
 Paints a tab shadow effect within specified bounds.
 
virtual void setSizeRatio (float ratio)
 Sets the size ratio for scaling UI elements.
 
void paintKnobShadows (Graphics &g)
 Paints knob shadows for all sliders.
 
Font getLabelFont ()
 Gets a suitable font for label text.
 
void setLabelFont (Graphics &g)
 Sets the Graphics context font and color for labels.
 
void drawLabelConnectionForComponents (Graphics &g, Component *left, Component *right)
 Draws a rectangular connection between labels of two components.
 
void drawLabelBackground (Graphics &g, Rectangle< int > bounds, bool text_component=false)
 Draws a background for a label area.
 
void drawLabelBackgroundForComponent (Graphics &g, Component *component)
 Draws label background for a specific component.
 
Rectangle< int > getDividedAreaBuffered (Rectangle< int > full_area, int num_sections, int section, int buffer)
 Divides an area into equal sections with buffering, returns the specified section.
 
Rectangle< int > getDividedAreaUnbuffered (Rectangle< int > full_area, int num_sections, int section, int buffer)
 Divides an area into equal sections without extra buffering, returns the specified section.
 
Rectangle< int > getLabelBackgroundBounds (Rectangle< int > bounds, bool text_component=false)
 Gets the background bounds for a label.
 
Rectangle< int > getLabelBackgroundBounds (Component *component, bool text_component=false)
 Gets the label background bounds for a component.
 
void drawLabel (Graphics &g, String text, Rectangle< int > component_bounds, bool text_component=false)
 Draws a label text below a component.
 
void drawLabelForComponent (Graphics &g, String text, Component *component, bool text_component=false)
 Draws a label for a given component.
 
void drawTextBelowComponent (Graphics &g, String text, Component *component, int space, int padding=0)
 Draws text below a component with optional padding.
 
virtual void paintChildrenShadows (Graphics &g)
 Paints shadows for child sections.
 
void paintChildrenBackgrounds (Graphics &g)
 Paints the backgrounds for all child sections.
 
void paintOpenGlChildrenBackgrounds (Graphics &g)
 Paints the backgrounds for all OpenGL child components.
 
void paintChildBackground (Graphics &g, SynthSection *child)
 Paints a child's background specifically.
 
void paintChildShadow (Graphics &g, SynthSection *child)
 Paints a child's shadow specifically.
 
void paintOpenGlBackground (Graphics &g, OpenGlComponent *child)
 Paints the background of an OpenGlComponent child.
 
void drawTextComponentBackground (Graphics &g, Rectangle< int > bounds, bool extend_to_label)
 Draws a background for a text component area.
 
void drawTempoDivider (Graphics &g, Component *sync)
 Draws a divider line for tempo-related controls.
 
virtual void initOpenGlComponents (OpenGlWrapper &open_gl)
 Initializes all OpenGL components in this section and sub-sections.
 
virtual void destroyOpenGlComponents (OpenGlWrapper &open_gl)
 Destroys all OpenGL components in this section and sub-sections.
 
virtual void sliderValueChanged (Slider *moved_slider) override
 Called when a slider value changes. Updates the synth parameter accordingly.
 
virtual void guiChanged (SynthButton *button) override
 Called when a SynthButton state changes (GUI interaction).
 
std::map< std::string, SynthSlider * > getAllSliders ()
 Gets all sliders registered in this section.
 
std::map< std::string, ToggleButton * > getAllButtons ()
 Gets all toggle buttons registered in this section.
 
std::map< std::string, ModulationButton * > getAllModulationButtons ()
 Gets all modulation buttons registered in this section.
 
virtual void setActive (bool active)
 Sets the active state of this section and sub-sections.
 
bool isActive () const
 Checks if the section is currently active.
 
virtual void animate (bool animate)
 Triggers animation state change in sub-sections if needed.
 
virtual void setAllValues (vital::control_map &controls)
 Sets values for all known parameters from a control map.
 
virtual void setValue (const std::string &name, vital::mono_float value, NotificationType notification)
 Sets a single parameter value for a known control.
 
void addModulationButton (ModulationButton *button, bool show=true)
 Adds a modulation button to this section.
 
void addSubSection (SynthSection *section, bool show=true)
 Adds a subsection (another SynthSection) as a child.
 
void removeSubSection (SynthSection *section)
 Removes a previously added subsection.
 
virtual void setScrollWheelEnabled (bool enabled)
 Enables or disables scroll wheel support for this section and sub-sections.
 
ToggleButton * activator () const
 Gets the activator toggle button if any.
 
void setSkinValues (std::map< Skin::ValueId, float > values)
 Sets custom skin values for this section.
 
void setSkinValue (Skin::ValueId id, float value)
 Sets a single skin value override.
 
float getTitleWidth ()
 
float getPadding ()
 
float getPowerButtonOffset () const
 
float getKnobSectionHeight ()
 
float getSliderWidth ()
 
float getSliderOverlap ()
 
float getSliderOverlapWithSpace ()
 
float getTextComponentHeight ()
 
float getStandardKnobSize ()
 
float getTotalKnobHeight ()
 
float getTextSectionYOffset ()
 
float getModButtonWidth ()
 
float getModFontSize ()
 
float getWidgetMargin ()
 
float getWidgetRounding ()
 
float getSizeRatio () const
 
int getPopupWidth () const
 
int getDualPopupWidth () const
 
- Public Member Functions inherited from SynthButton::ButtonListener
virtual ~ButtonListener ()
 Virtual destructor.
 
- Public Member Functions inherited from PresetSelector::Listener
virtual ~Listener ()
 Virtual destructor for proper cleanup.
 
virtual void textMouseUp (const MouseEvent &e)
 

Static Public Member Functions

static float getZoomScale (int zoom)
 Computes a zoom scale factor from a zoom menu selection.
 
static String getWavetableDataString (InputStream *input_stream)
 Extracts wavetable-specific data embedded in a .wav file's chunk.
 

Static Public Attributes

static constexpr float kObscureAmount = 0.4f
 Opacity factor for obscuring certain visuals.
 
static constexpr float kAlphaFade = 0.3f
 Alpha fade factor for overlay visuals.
 
- Static Public Attributes inherited from SynthSection
static constexpr int kDefaultPowerButtonOffset = 0
 
static constexpr float kPowerButtonPaddingPercent = 0.29f
 
static constexpr float kTransposeHeightPercent = 0.5f
 
static constexpr float kTuneHeightPercent = 0.4f
 
static constexpr float kJointModulationRadiusPercent = 0.1f
 
static constexpr float kJointModulationExtensionPercent = 0.6666f
 
static constexpr float kPitchLabelPercent = 0.33f
 
static constexpr float kJointLabelHeightPercent = 0.4f
 
static constexpr double kTransposeMouseSensitivity = 0.2
 
static constexpr float kJointLabelBorderRatioX = 0.05f
 
static constexpr int kDefaultBodyRounding = 4
 
static constexpr int kDefaultLabelHeight = 10
 
static constexpr int kDefaultLabelBackgroundHeight = 16
 
static constexpr int kDefaultLabelBackgroundWidth = 56
 
static constexpr int kDefaultLabelBackgroundRounding = 4
 
static constexpr int kDefaultPadding = 2
 
static constexpr int kDefaultPopupMenuWidth = 150
 
static constexpr int kDefaultDualPopupMenuWidth = 340
 
static constexpr int kDefaultStandardKnobSize = 32
 
static constexpr int kDefaultKnobThickness = 2
 
static constexpr float kDefaultKnobModulationAmountThickness = 2.0f
 
static constexpr int kDefaultKnobModulationMeterSize = 43
 
static constexpr int kDefaultKnobModulationMeterThickness = 4
 
static constexpr int kDefaultModulationButtonWidth = 64
 
static constexpr int kDefaultModFontSize = 10
 
static constexpr int kDefaultKnobSectionHeight = 64
 
static constexpr int kDefaultSliderWidth = 24
 
static constexpr int kDefaultTextWidth = 80
 
static constexpr int kDefaultTextHeight = 24
 
static constexpr int kDefaultWidgetMargin = 6
 
static constexpr float kDefaultWidgetFillFade = 0.3f
 
static constexpr float kDefaultWidgetLineWidth = 4.0f
 
static constexpr float kDefaultWidgetFillCenter = 0.0f
 

Additional Inherited Members

- Protected Member Functions inherited from SynthSection
void setSliderHasHzAlternateDisplay (SynthSlider *slider)
 
void setSidewaysHeading (bool sideways)
 
void addToggleButton (ToggleButton *button, bool show)
 
void addButton (OpenGlToggleButton *button, bool show=true)
 
void addButton (OpenGlShapeButton *button, bool show=true)
 
void addSlider (SynthSlider *slider, bool show=true, bool listen=true)
 
void addOpenGlComponent (OpenGlComponent *open_gl_component, bool to_beginning=false)
 
void setActivator (SynthButton *activator)
 
void createOffOverlay ()
 
void setPresetSelector (PresetSelector *preset_selector, bool half=false)
 
void paintJointControlSliderBackground (Graphics &g, int x, int y, int width, int height)
 
void paintJointControlBackground (Graphics &g, int x, int y, int width, int height)
 
void paintJointControl (Graphics &g, int x, int y, int width, int height, const std::string &name)
 
void placeJointControls (int x, int y, int width, int height, SynthSlider *left, SynthSlider *right, Component *widget=nullptr)
 
void placeTempoControls (int x, int y, int width, int height, SynthSlider *tempo, SynthSlider *sync)
 
void placeRotaryOption (Component *option, SynthSlider *rotary)
 
void placeKnobsInArea (Rectangle< int > area, std::vector< Component * > knobs)
 
void lockCriticalSection ()
 
void unlockCriticalSection ()
 
Rectangle< int > getPresetBrowserBounds ()
 
int getTitleTextRight ()
 
Rectangle< int > getPowerButtonBounds ()
 
Rectangle< int > getTitleBounds ()
 
float getDisplayScale () const
 
virtual int getPixelMultiple () const
 
- Protected Attributes inherited from SynthSection
std::map< Skin::ValueId, float > value_lookup_
 
std::vector< SynthSection * > sub_sections_
 
std::vector< OpenGlComponent * > open_gl_components_
 
std::map< std::string, SynthSlider * > slider_lookup_
 
std::map< std::string, Button * > button_lookup_
 
std::map< std::string, ModulationButton * > modulation_buttons_
 
std::map< std::string, SynthSlider * > all_sliders_
 
std::map< std::string, ToggleButton * > all_buttons_
 
std::map< std::string, ModulationButton * > all_modulation_buttons_
 
const SynthSectionparent_
 
SynthButtonactivator_
 
PresetSelectorpreset_selector_
 
bool preset_selector_half_width_
 
std::unique_ptr< OffOverlayoff_overlay_
 
Skin::SectionOverride skin_override_
 
float size_ratio_
 
bool active_
 
bool sideways_heading_
 

Detailed Description

A UI section for editing, visualizing, and managing wavetables.

This section provides a sophisticated interface for loading, editing, and saving wavetables. Users can manipulate time- and frequency-domain representations, resynthesize wavetables, and manage their frame components. The section uses multiple subcomponents such as waveform editors, frequency domain bar renderers, component lists, organizers, and overlays to facilitate detailed wavetable editing.

Member Enumeration Documentation

◆ BarEditorMenu

Menu items for the bar editor settings.

Enumerator
kCancel 
kPowerScale 
kAmplitudeScale 
kZoom1 
kZoom2 
kZoom4 
kZoom8 
kZoom16 

◆ MenuItems

Menu items for main menu actions.

Enumerator
kCancelled 
kSaveAsWavetable 
kImportWavetable 
kExportWavetable 
kExportWav 
kResynthesizeWavetable 
kNumMenuItems 

Constructor & Destructor Documentation

◆ WavetableEditSection()

WavetableEditSection::WavetableEditSection ( int index,
WavetableCreator * wavetable_creator )

Constructs a WavetableEditSection.

Parameters
indexThe oscillator index for which we are editing the wavetable.
wavetable_creatorPointer to a WavetableCreator managing wavetable data.

◆ ~WavetableEditSection()

WavetableEditSection::~WavetableEditSection ( )
virtual

Destructor.

Member Function Documentation

◆ buttonClicked()

void WavetableEditSection::buttonClicked ( Button * clicked_button)
overridevirtual

Handles button clicks for menu, settings, exit, etc.

Parameters
clicked_buttonThe clicked button.

Reimplemented from SynthSection.

◆ clear()

void WavetableEditSection::clear ( )

Clears the current wavetable editing state.

◆ componentAdded()

void WavetableEditSection::componentAdded ( WavetableComponent * component)
overridevirtual

Callback when a wavetable component is added to the list.

Parameters
componentThe added WavetableComponent.

Implements WavetableComponentList::Listener.

◆ componentRemoved()

void WavetableEditSection::componentRemoved ( WavetableComponent * component)
overridevirtual

Callback when a wavetable component is removed.

Parameters
componentThe removed WavetableComponent.

Implements WavetableComponentList::Listener.

◆ componentsChanged()

void WavetableEditSection::componentsChanged ( )
overridevirtual

Callback when components in the list change.

Implements WavetableComponentList::Listener.

◆ componentsReordered()

void WavetableEditSection::componentsReordered ( )
inlineoverridevirtual

Called when components are reordered.

Implements WavetableComponentList::Listener.

◆ exportToWav()

void WavetableEditSection::exportToWav ( )

Exports the current wavetable frames as a .wav file.

◆ exportWavetable()

void WavetableEditSection::exportWavetable ( )

Exports the current wavetable as a .vitaltable file.

◆ frameChanged()

void WavetableEditSection::frameChanged ( )
overridevirtual

Callback when a frame changes, triggers a display re-render.

Implements WavetableComponentOverlay::Listener.

◆ frameDoneEditing()

void WavetableEditSection::frameDoneEditing ( )
overridevirtual

Callback when a frame finishes editing, triggers a waveform re-render.

Implements WavetableComponentOverlay::Listener.

◆ frameDragged()

void WavetableEditSection::frameDragged ( WavetableKeyframe * keyframe,
int position )
overridevirtual

Callback when a frame is dragged to a new position.

Parameters
keyframeThe dragged keyframe.
positionThe new frame position.

Implements WavetableOrganizer::Listener.

◆ frameSelected()

void WavetableEditSection::frameSelected ( WavetableKeyframe * keyframe)
overridevirtual

Callback when a frame is selected in the wavetable organizer.

Parameters
keyframeThe selected keyframe.

Implements WavetableOrganizer::Listener.

◆ getCurrentFile()

File WavetableEditSection::getCurrentFile ( )
inlineoverridevirtual

Gets the current wavetable file being edited.

Returns
The current wavetable File.

Reimplemented from SynthSection.

◆ getFrameEditBounds()

Rectangle< int > WavetableEditSection::getFrameEditBounds ( )

Gets the bounds of the frame editing area.

Returns
The rectangle representing the editing area.

◆ getLastBrowsedWavetable()

std::string WavetableEditSection::getLastBrowsedWavetable ( )
inline

Gets the last browsed wavetable file.

Returns
The path to the last loaded wavetable file.

◆ getName()

std::string WavetableEditSection::getName ( )
inline

Gets the current wavetable name.

Returns
The wavetable name.

◆ getTimelineBounds()

Rectangle< int > WavetableEditSection::getTimelineBounds ( )

Gets the bounds of the timeline area.

Returns
The rectangle representing the timeline area.

◆ getTopHeight()

int WavetableEditSection::getTopHeight ( )
inline

Gets the top section height for title and controls.

Returns
The height in pixels of the top area.

◆ getWavetableDataString()

String WavetableEditSection::getWavetableDataString ( InputStream * input_stream)
static

Extracts wavetable-specific data embedded in a .wav file's chunk.

Parameters
input_streamPointer to the InputStream of the .wav file.
Returns
A string containing wavetable data.

◆ getWavetableJson()

json WavetableEditSection::getWavetableJson ( )
inline

Gets the current wavetable state as JSON.

Returns
The JSON representation of the wavetable state.

◆ getZoomScale()

static float WavetableEditSection::getZoomScale ( int zoom)
inlinestatic

Computes a zoom scale factor from a zoom menu selection.

Parameters
zoomThe menu selection (e.g., kZoom1, kZoom2, etc.).
Returns
The computed scale factor (e.g., 1x, 2x, 4x zoom).

◆ importWavetable()

void WavetableEditSection::importWavetable ( )

Imports an external wavetable file.

◆ init()

void WavetableEditSection::init ( )

Initializes the wavetable state after loading or clearing.

◆ loadAudioAsWavetable()

bool WavetableEditSection::loadAudioAsWavetable ( String name,
InputStream * audio_stream,
WavetableCreator::AudioFileLoadStyle style )

Loads audio data as a wavetable.

Parameters
nameThe name for the wavetable.
audio_streamInputStream to the audio file.
styleThe load style (e.g., splice, pitch-based).
Returns
True if loading successful, false otherwise.

◆ loadDefaultWavetable()

void WavetableEditSection::loadDefaultWavetable ( )

Loads the default wavetable (initializes a blank state).

◆ loadFile()

void WavetableEditSection::loadFile ( const File & wavetable_file)
overridevirtual

Loads a wavetable file from disk.

Parameters
wavetable_fileThe file to load.

Reimplemented from SynthSection.

◆ loadWavetable()

void WavetableEditSection::loadWavetable ( json & wavetable_data)

Loads a wavetable from JSON data.

Parameters
wavetable_dataThe JSON object containing wavetable state.

◆ mouseWheelMove()

void WavetableEditSection::mouseWheelMove ( const MouseEvent & e,
const MouseWheelDetails & wheel )
override

Handles mouse wheel movement for zooming frequency domain views.

Parameters
eThe mouse event.
wheelThe wheel details.

◆ nextClicked()

void WavetableEditSection::nextClicked ( )
overridevirtual

Callback when 'next' is clicked, attempts to load next wavetable.

Implements PresetSelector::Listener.

◆ paintBackground()

void WavetableEditSection::paintBackground ( Graphics & g)
overridevirtual

Paints the background of the wavetable edit section, including children.

Parameters
gThe Graphics context.

Reimplemented from SynthSection.

◆ paintBackgroundShadow()

void WavetableEditSection::paintBackgroundShadow ( Graphics & g)
overridevirtual

Paints any background shadow or tab shadows for the section.

Parameters
gThe Graphics context.

Reimplemented from SynthSection.

◆ playheadMoved()

void WavetableEditSection::playheadMoved ( int position)
overridevirtual

Callback for when the playhead moves to a different frame.

Parameters
positionThe new frame position.

Implements WavetablePlayhead::Listener.

◆ positionsUpdated()

void WavetableEditSection::positionsUpdated ( )
overridevirtual

Callback for when positions in the wavetable organizer are updated.

Reimplemented from WavetableOrganizer::Listener.

◆ prevClicked()

void WavetableEditSection::prevClicked ( )
overridevirtual

Callback when 'previous' is clicked, attempts to load previous wavetable.

Implements PresetSelector::Listener.

◆ renderOpenGlComponents()

void WavetableEditSection::renderOpenGlComponents ( OpenGlWrapper & open_gl,
bool animate )
overridevirtual

Renders the OpenGL components, including overlays.

Parameters
open_glReference to the current OpenGlWrapper.
animateWhether to animate changes.

Reimplemented from SynthSection.

◆ reset()

void WavetableEditSection::reset ( )
overridevirtual

Resets the editing section, clearing and re-initializing components.

Reimplemented from SynthSection.

◆ resized()

void WavetableEditSection::resized ( )
overridevirtual

Called when the component is resized, arranges the layout of UI elements.

Reimplemented from SynthSection.

◆ resynthesizeToWavetable()

void WavetableEditSection::resynthesizeToWavetable ( )

Resynthesizes the current preset into a wavetable.

◆ saveAsWavetable()

void WavetableEditSection::saveAsWavetable ( )

Saves the current wavetable state as a file.

◆ setPowerScale()

void WavetableEditSection::setPowerScale ( bool power_scale)

Sets whether the frequency display uses power scale or amplitude scale.

Parameters
power_scaleTrue for power scale, false for amplitude scale.

◆ setWaveFrameSlider()

void WavetableEditSection::setWaveFrameSlider ( Slider * slider)
inline

Sets the WaveFrame slider to reflect current editing frame position.

Parameters
sliderPointer to the wave frame slider.

◆ setZoom()

void WavetableEditSection::setZoom ( int zoom)

Sets the zoom level for frequency domain rendering.

Parameters
zoomThe zoom factor (e.g., 1x, 2x).

◆ textMouseDown()

void WavetableEditSection::textMouseDown ( const MouseEvent & e)
overridevirtual

Callback when text is clicked, possibly showing a browser to load wavetable.

Parameters
eThe mouse event.

Reimplemented from PresetSelector::Listener.

◆ visibilityChanged()

void WavetableEditSection::visibilityChanged ( )
override

Called when visibility changes, e.g., updating UI if made visible.

◆ wheelMoved()

void WavetableEditSection::wheelMoved ( const MouseEvent & e,
const MouseWheelDetails & wheel )
overridevirtual

Callback for wheel movements in the component list area.

Parameters
eThe mouse event.
wheelThe wheel details.

Reimplemented from WavetableOrganizer::Listener.

Member Data Documentation

◆ kAlphaFade

float WavetableEditSection::kAlphaFade = 0.3f
staticconstexpr

Alpha fade factor for overlay visuals.

◆ kObscureAmount

float WavetableEditSection::kObscureAmount = 0.4f
staticconstexpr

Opacity factor for obscuring certain visuals.


The documentation for this class was generated from the following files: