tpt-av-ui
RustPure-Rust, GPU-accelerated media UI components — waveform renderers, timeline scrubbers, node graphs, and meters for building audio/video editors. Dual-licensed MIT/Apache-2.0.
Languages
tpt-av-ui provides the production-ready, GPU-accelerated widgets that
general-purpose UI frameworks don't ship: zoomable waveform displays,
multi-track timelines with clip dragging/snapping/trimming, node-based effect
routing graphs, audio meters, and transport controls. Everything renders
through wgpu (WebGPU, WGSL shaders, no C/C++ bindings)
and integrates with egui, iced, or your own raw-wgpu renderer.
Components
| Crate | What you get |
|---|---|
tpt-av-ui-core | Shared types: Color, Rect, Transform2D, theming, UiEvent input model, wgpu device/texture/pipeline helpers, mesh builders |
tpt-av-ui-waveform | GPU waveform renderer with peak-cache integration, zoom/pan/scroll, selection, playhead |
tpt-av-ui-timeline | Multi-track timeline: clips, time ruler (timecode/beats/samples), drag + snap + trim, multi-selection |
tpt-av-ui-node | Node graph editor: nodes, typed ports, bezier connection wires, drag/pan/zoom, box selection |
tpt-av-ui-meter | Level meters (VU/Peak/RMS with ballistics + peak hold), spectrum analyzer, vectorscope, real-time waveform display |
tpt-av-ui-transport | Transport state machine + callbacks, SMPTE/frames/samples/seconds timecode, tempo utilities |
tpt-av-ui-egui | Drop-in egui widgets for waveform, timeline, node graph, and meters |
tpt-av-ui-iced | iced canvas widgets (waveform, meters, transport) |
Every crate has its own README.md (features, quick-start, API notes) and
CHANGELOG.md; this file's changelog summarizes workspace-level changes.
Quick start (egui)
use std::sync::Arc;
use tpt_av_ui_egui::EguiWaveform;
use tpt_av_ui_waveform::{MemoryPeakSource, WaveformAction};
struct Viewer {
waveform: EguiWaveform,
}
impl Viewer {
fn show(&mut self, ui: &mut egui::Ui, state: &egui_wgpu::RenderState) {
// allocate space, render on the GPU, and handle input in one call
if let Some(action) = self.waveform.show(ui, state) {
match action {
WaveformAction::SetPlayhead { sample } => { /* seek */ }
_ => {}
}
}
}
}
Build a peak source from PCM samples, or enable the asset-cache feature to
read tpt-av-asset-cache .peaks files directly:
use tpt_av_ui_waveform::MemoryPeakSource;
let samples: Vec<f32> = /* interleaved mono PCM in -1.0..=1.0 */;
let source = Arc::new(MemoryPeakSource::new(samples, 44_100, 1024));
Starting a project
Generate a ready-to-build waveform viewer with cargo-generate:
cargo generate tpt-solutions/tpt-av-ui templates/basic-egui-app
Demos
The examples workspace member contains runnable eframe apps:
cargo run -p tpt-av-ui-examples --example waveform_viewer
cargo run -p tpt-av-ui-examples --example timeline_editor
cargo run -p tpt-av-ui-examples --example node_graph
cargo run -p tpt-av-ui-examples --example full_daw_ui
cargo run -p tpt-av-ui-examples --example theme_playground
A zero-install WebGPU browser demo (waveform viewer compiled to WASM,
deployable to GitHub Pages) lives in
examples-wasm/waveform-viewer.
Design
See DESIGN.md for the full architecture: workspace layout, core APIs, the WGSL shader pipeline, performance strategy (instancing, LOD, atlasing, culling), and framework integration.
Contributing
Development is issues-only: bug reports, feature requests, reproduction testing, and design discussion are welcome — external pull requests are not accepted (see CONTRIBUTING.md for the reasoning and what makes a great issue).
License
Dual-licensed under MIT or Apache-2.0, at
your option. The dependency tree is strictly permissive by policy — CI runs
cargo deny check on every PR and rejects any GPL, LGPL, AGPL, or MPL code.