wiki:Technical/AudioDisplay

Audio Display

Seriously needs a rewrite, some of the most horrible code present in Aegisub. Nobody wants to touch it.

Here's an order it should draw things in. Each thing is also a component, and for each, that components's responsibilities and other properties are listed.

Timeline

At the bottom of the display. Shows the range of time currently in view, with hours:minutes:seconds markers, sub-second markers. Dragging it scrolls the view.

Audio view

A view of the actual audio data.

  • Drawn by one of several different renderers (waveform, spectrum...)
  • Possibly an internal bitmap cache
  • Has to know the selected area from a later stage

Secondary markers

These are helper lines showing additional information to the user.

  • Have a list of "providers", each supplies a list of visible markers given the range of samples visible.
  • Each provider also supplies a visual style for itself.
  • Markers from a provider can be snappable or not. (Dragging an audio selection point can snap to that marker or not.)
  • Examples of these markers: Scene change points, current video frame's time, a marker every second, start/end times of unselected lines...

Audio selection

The primary thing the user interacts with: The selected audio.

  • Different "mode" providers, switching from line timing to karaoke timing changes to a different selection provider. Possibly add more modes in the future, such as time shifting.
  • Supplies a list of draggable markers, each with a style. A marker may be allowed to snap to secondary markers or not.
  • Receives dragging and clicking events that don't go to anything else.
  • Dragging a marker is handled by the audio display, only the "marker was moved" event is sent, not raw mouse down/up/move when a drag is going on.
  • Knows about the "selection" range, has to supply this to the audio view renderer.