Module mixer_ui

Source
Expand description

Mixer pane: the routing list (which track feeds which bus) on top, one channel strip per bus below (Main last). Everything in a strip scrolls vertically, so a long filter chain stays reachable.

Strip: name (editable), what feeds it, a stereo peak meter fed by BusGraph::meter, a gain fader (dB), pan knob, Mute (speaker glyph) / Solo / Mono, the output-bus combo, and the filter chain — each filter as a header row (enable, name, up/down, X) with its parameters below (DragValue per FilterKind::params() + a diamond keyframe toggle); EQ / pass filters also draw a response plot over a labelled log-frequency grid with one draggable handle per band. “+ Filter” adds from FilterKind::ALL, “+ Bus” creates a bus, X deletes one (never Main; its users fall back to Main). Routing: every audio track is a row — click it to send it to the selected bus, or pick from its own combo (Track.bus); the selected clip gets an override combo (Clip.bus, “(track)” = inherit). Undo once per gesture; returns true when the project changed.

Every parameter (bus gain/pan and each filter param) is an Animated read and written at the playhead: set_at moves the constant while the parameter is unkeyed and upserts a keyframe once it is animated, exactly like a clip property.

Edits go into a per-frame clone of Project.buses and are written back at the end of the frame, so undo can snapshot the project before the first change of a gesture (the effects/inspector pattern).

Structs§

Edits 🔒
Structural edits that need Project’s own helpers, applied after undo has snapshotted.
MixerState
Strip 🔒
What one strip needs to know about its bus beyond the Bus itself.

Constants§

CURVE_DB 🔒
Full-scale range of the EQ plot, in dB.
CURVE_H 🔒
Response-curve plot height.
GRID_HZ 🔒
Grid lines of the EQ plot: a third of a decade apart, labelled.
STRIP_W 🔒
Channel-strip width in points.

Functions§

curve 🔒
EQ / pass-filter response plot: a labelled log-frequency + dB grid, the summed curve on top, and one draggable handle per band (X = frequency, Y = gain). The grabbed band is latched for the whole drag. Returns true when the drag changed a parameter.
feeds 🔒
Who sums into each bus: the audio tracks routed to it and the buses that send here. Mirrors mixer_fx::resolve — a dangling send lands in Main. ponytail: track-level routing only. A single clip’s Clip.bus override is visible in the routing list instead; walk Project::bus_of over every clip here if that turns out to be confusing.
filter_body 🔒
One filter’s editable half: its response curve and its parameter grid. Shared by the strip and by the pop-out window, so a floating filter is the same control surface, not a second implementation.
filters 🔒
key_button 🔒
Diamond keyframe toggle for one parameter at the playhead; right-click clears every key. at only has to be unique inside the strip — the mixer edits a fresh clone of the bus list every frame, so an id derived from the Animated’s address (crate::ui::key_buttons) would not survive a click.
meter 🔒
Stereo peak meter, -60 dB … +6 dB left to right.
routing 🔒
One row per audio track — click a track to send it to the selected bus, or pick from its own combo — plus the Clip.bus override of the selected clip.
show
strip 🔒