Skip to content

Enhancement: Absolute Waveform

Replaces !76 (closed)
Obsoletes !88 (closed)

Closes #3 (closed)
Closes #61 (closed)
Closes #85 (closed)
Closes #86 (closed)
Closes #90 (closed)
Closes #95 (closed)


This MR implements the absolute waveform as discussed in #90 (closed) (from the original mockup).

As a small refactor, the APPeaksGenerator was first separated into an own file.

The MR removes the incremental peaks loading, since this proved to be either unperformant or buggy. As a replacement, an animation was added (copied from Amberol) when the peaks are ready.


The actual drawing logic was split into two classes.

The bar chart is rendered by a separate paintable: WaveformBarChart. This paintable only generates a black-and-white image of the waveform.

The split between the played and unplayed parts of the track is drawn by the widget WaveformScale. This is done by using the bar chart as an alpha mask and "painting over it". This widget is also responsible for user input.

This separation allows us to cache the generated WaveformBarChart, so we only need to draw it on track change and window resize. Also, we can now easily add more colors (AB-loops, highlight mouse hover position, etc..).


To get a uniform and smooth waveform even when resizing the window, the waveform data is resampled using a combination of stored mipmaps and linear interpolation. This behavior can be tweaked using WaveformBarCharts mipmap-bias parameter.


TODOs:

  • Expose accessibility metadata
Edited by David Keller

Merge request reports