Skip to content

Commit d8a0a9b

Browse files
program247365claude
andcommitted
feat(playback): mouse-drag seek with true seeking via rodio 0.22
Add click/drag scrubbing on the progress bar: dragging moves a preview knob (pure render, no audio work) and a single seek commits on release. The bar's geometry is recorded each frame so the mouse handler can map a column to a position, and mouse capture is enabled/disabled with the terminal (and on the panic hook). Replace the seek mechanism entirely. The old skip_duration path decoded and discarded every sample from zero on the calling thread, which froze the UI when seeking deep into long tracks. Upgrade rodio 0.17 -> 0.22 and use Player::try_seek, a symphonia-backed true seek (~5ms, even while paused). The decoder is built seekable with the file's byte length so VBR MP3s seek accurately. This also fixes the keyboard arrow-key seek, which shared the same skip_duration path. Migration touches the renamed rodio API: Sink -> Player, OutputStream -> MixerDeviceSink/DeviceSinkBuilder, current_frame_len -> current_span_len, NonZero channel/sample-rate types, and native f32 samples (no convert_samples). Covered by an ignored audio-device test asserting the seek succeeds and returns promptly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a444951 commit d8a0a9b

6 files changed

Lines changed: 463 additions & 247 deletions

File tree

0 commit comments

Comments
 (0)