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

A UI component that displays the current playhead position in a wavetable editor. More...

#include <wavetable_playhead_info.h>

Inheritance diagram for WavetablePlayheadInfo:
WavetablePlayhead::Listener

Public Member Functions

 WavetablePlayheadInfo ()
 Constructs the WavetablePlayheadInfo component.
 
void paint (Graphics &g) override
 Paints the current playhead position text onto the component.
 
void resized () override
 Called when the component is resized.
 
void playheadMoved (int position) override
 Called when the associated playhead moves to a new position.
 
- Public Member Functions inherited from WavetablePlayhead::Listener
virtual ~Listener ()
 

Protected Attributes

int playhead_position_
 The current playhead position being displayed.
 

Detailed Description

A UI component that displays the current playhead position in a wavetable editor.

WavetablePlayheadInfo listens to a WavetablePlayhead and shows the current frame position as a textual number. Whenever the playhead moves, this component updates and redraws the display.

Constructor & Destructor Documentation

◆ WavetablePlayheadInfo()

WavetablePlayheadInfo::WavetablePlayheadInfo ( )
inline

Constructs the WavetablePlayheadInfo component.

Initializes the displayed playhead position to zero.

Member Function Documentation

◆ paint()

void WavetablePlayheadInfo::paint ( Graphics & g)
override

Paints the current playhead position text onto the component.

Parameters
gThe graphics context used for painting.

◆ playheadMoved()

void WavetablePlayheadInfo::playheadMoved ( int position)
overridevirtual

Called when the associated playhead moves to a new position.

Parameters
positionThe new playhead position.

Updates the displayed position and repaints the component.

Implements WavetablePlayhead::Listener.

◆ resized()

void WavetablePlayheadInfo::resized ( )
override

Called when the component is resized.

Triggers a repaint to ensure that the displayed text is positioned correctly within the new bounds.

Member Data Documentation

◆ playhead_position_

int WavetablePlayheadInfo::playhead_position_
protected

The current playhead position being displayed.


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