WaveformController class
Controls waveform timeline state: zoom, scroll, regions, and markers.
Constructors
-
WaveformController({double initialPixelsPerSample = 1.0, double maxPixelsPerSample = 100.0, double minPixelsPerSample = 0.1, double scrollOffset = 0.0, List<
WaveformRegion> ? regions, List<CueMarker> ? markers})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
markers
→ List<
CueMarker> -
Cue markers on the waveform.
final
- maxPixelsPerSample → double
-
Maximum allowed pixels per sample (zoom-in limit).
final
- minPixelsPerSample → double
-
Minimum allowed pixels per sample (zoom-out limit).
final
- onScrollChanged ↔ void Function(double scrollOffset)?
-
Callback when scroll position changes.
getter/setter pair
- onZoomChanged ↔ void Function(double scrollOffset)?
-
Callback when zoom level changes.
getter/setter pair
- pixelsPerSample ↔ double
-
Current zoom level (pixels per sample).
Higher values = more zoomed in.
getter/setter pair
-
regions
→ List<
WaveformRegion> -
Selected regions on the waveform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollOffset ↔ double
-
Current scroll offset in pixels.
getter/setter pair
- viewportWidth ↔ double
-
Width of the visible viewport in pixels.
getter/setter pair
- visibleSampleRange → (int, int)
-
The visible sample range (start, end) based on scroll and viewport.
no setter
- visibleTimeRange → (double, double)
-
The visible time range in seconds.
no setter
Methods
-
addMarker(
CueMarker marker) → void - Add a cue marker.
-
addRegion(
WaveformRegion region) → void - Add a region selection.
-
attach(
int totalSamples, double samplesPerSecond) → void - Initialize controller with waveform data dimensions.
-
clearMarkers(
) → void - Clear all markers.
-
clearRegions(
) → void - Clear all regions.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pixelToTime(
double pixelX) → double - Convert a pixel position to a time in seconds.
-
removeMarker(
CueMarker marker) → void - Remove a marker.
-
removeRegion(
WaveformRegion region) → void - Remove a region.
-
resetZoom(
) → void - Reset zoom to fit all samples in the viewport.
-
scrollToSample(
int sampleIndex) → void - Scroll so that the given sample index is visible.
-
scrollToTime(
double seconds) → void - Scroll so that the given time (in seconds) is visible.
-
timeToPixel(
double seconds) → double - Convert a time in seconds to a pixel X position.
-
toString(
) → String -
A string representation of this object.
inherited
-
zoomIn(
[double factor = 1.5]) → void - Zoom in by a factor.
-
zoomOut(
[double factor = 1.5]) → void - Zoom out by a factor.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited