GPUI Box GitHub

Components

AudioPlayer builder

A player for one piece of audio.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::media::AudioPlayer;

Construct

new(ident: impl Into<Ident>) -> Self

Options

Chain onto the value.

title(title: impl Into<SharedString>) -> Self
subtitle(subtitle: impl Into<SharedString>) -> Self
transport(transport: Rc<dyn MediaTransport>) -> Self
elapsed(elapsed: impl Into<SharedString>) -> Self
remaining(remaining: impl Into<SharedString>) -> Self
peaks(peaks: impl IntoIterator<Item = f32>) -> Self
step_seconds(seconds: f32) -> Self
speeds(speeds: impl IntoIterator<Item = f32>) -> Self
on_event(handler: impl Fn(&MediaEvent, &mut Window, &mut App) + 'static) -> Self

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/media/audio_player.rs