Skip to content

feat: playlist support (POC)#9

Draft
velocitysystems wants to merge 5 commits into
silvermine:masterfrom
velocitysystems:feat/playlist
Draft

feat: playlist support (POC)#9
velocitysystems wants to merge 5 commits into
silvermine:masterfrom
velocitysystems:feat/playlist

Conversation

@velocitysystems
Copy link
Copy Markdown
Contributor

@velocitysystems velocitysystems commented Apr 29, 2026

Summary

Adds playlist support to the Rodio-backed audio player.
Auto-extracts ID3 metadata from loaded items to surface title, artist, and embedded artwork.
Replaces the single-channel state-update event with four typed event channels.

API changes

Breaking

  • load(src, metadata)load(playlist, startIndex?) — the single-source signature is gone. Callers now pass PlaylistItem[] (each item is { src, metadata? }). For the previous single-track use case, pass a one-item array.
  • setLoop(loop: boolean)setLoopMode(mode: LoopMode) — boolean replaced with a LoopMode enum (Off / One / All). The Tauri permission rename matches: allow-set-loopallow-set-loop-mode.
  • player.listen(...) removed — replaced by four typed event channels (see below).
  • PlayerState.title / PlayerState.artist removed — per-track metadata now lives on PlayerState.playlist[currentIndex].metadata.
  • PlayerState.playlist and PlayerState.currentIndex addedcurrentIndex is null when Idle.

Added

  • Transport actions: next(), prev(), jumpTo(index). Allowed in Ready / Playing / Paused / Ended / Error (Error allows them so consumers can skip past a broken track without reloading the whole playlist). prev() restarts the current item if currentTime > 3s, otherwise moves to the previous item (with wrap-around in LoopMode.All).
  • LoopMode enum (Off / One / All) — auto-advance behaviour at end of track or end of playlist.
  • PlaylistItem interface{ src: string, metadata?: AudioMetadata }.
  • Event channels (replacing listen):
    • onStateChanged((change: StateChange) => void) — status / error transitions only.
    • onTrackChanged((change: TrackChange) => void) — fires after each item finishes loading; payload carries the enriched playlist item (auto-extracted ID3 title / artist / artwork merged with caller-supplied metadata, caller wins per field).
    • onSettingsChanged((change: SettingsChange) => void)volume / muted / playbackRate / loopMode deltas.
    • onTimeUpdate((time: TimeUpdate) => void) — high-frequency position updates (~250 ms) plus seek hits.
  • PlaybackStatus.Error is now in allowedActions for Load, Stop, Next, Prev, JumpTo (the recovery surface).
  • Tauri commands: next, prev, jump_to, set_loop_mode (replaces set_loop).

@velocitysystems velocitysystems force-pushed the feat/playlist branch 2 times, most recently from 3d9c4bf to d3f7c1e Compare April 29, 2026 20:50
@velocitysystems velocitysystems changed the title feat: playlist support feat: playlist support (POC) May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant