Skip to content

refactor(playback): improved playback and public api#63

Open
Yesterday17 wants to merge 7 commits into
masterfrom
refactor/playback
Open

refactor(playback): improved playback and public api#63
Yesterday17 wants to merge 7 commits into
masterfrom
refactor/playback

Conversation

@Yesterday17

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the anni-playback crate to provide a configurable low-level Player plus an annil-aware AnniPlayer with variant-safe caching, expanded runtime events, and richer playback/cache statistics.

Changes:

  • Reworked decoder/output pipeline for gapless preloading, accurate seeking, buffering/error reporting, and deterministic shutdown.
  • Added PlayerConfig/builder APIs, new public stats module, and expanded public events/errors.
  • Rebuilt HTTP + cached HTTP sources to support codec/quality variants with atomic cache publication and cache statistics.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
anni-playback/src/utils/blocking_rb.rs Replace custom ring buffer with ArrayQueue + blocking producer / RT-safe consumer API.
anni-playback/src/types.rs Add structured PlaybackError and expand internal/public events.
anni-playback/src/stats.rs New playback/cache stats snapshot + internal stats handles.
anni-playback/src/sources/mod.rs Remove unused legacy receiver type.
anni-playback/src/sources/http.rs Simplify HTTP stream buffering; handle servers that ignore range requests.
anni-playback/src/sources/cached_http/provider.rs Introduce AudioVariant/AudioCodec and safer URL formatting.
anni-playback/src/sources/cached_http/mod.rs Add variant-aware caching, background download coordination, cancellation, and variant resolution.
anni-playback/src/sources/cached_http/cache.rs Implement atomic “publish when complete” cache entries + cache stats.
anni-playback/src/player.rs Add Player/AnniPlayer builders, lifecycle ownership, and stats accessors.
anni-playback/src/lib.rs Export new config/stats APIs and expanded public surface.
anni-playback/src/dsp/resampler.rs Make resampling error-aware and trim delay/padding deterministically.
anni-playback/src/dsp/normalizer.rs Make normalizer initialization fallible and avoid panics.
anni-playback/src/decoder/opus.rs Respect Symphonia gapless trim options in Opus decode.
anni-playback/src/decoder/mod.rs Add clippy allowance for module layout.
anni-playback/src/decoder/decoder.rs Major decoder refactor: lazy output init, preload pipeline, seek trimming, error/buffering events.
anni-playback/src/cpal_output.rs Device config negotiation, multi-format output support, remix/downmix logic, output gating, stats hooks.
anni-playback/src/controls.rs Move to decoder-confirmed events/state, add stats handle, output gate, volume atomics.
anni-playback/src/config.rs New runtime configuration types with validation + tests.
anni-playback/Readme.md Document new APIs, stats, preload/gapless, and annil variant caching behavior.
anni-playback/examples/tui.rs Update example to use new Player builder/events.
anni-playback/examples/player.rs Update example to use new Player builder/events.
anni-playback/examples/gapless.rs Update example to use new preload/gapless flow and events.
anni-playback/CHANGELOG.md Document major new features and behavior fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread anni-playback/src/sources/cached_http/cache.rs Outdated
Comment thread anni-playback/src/sources/cached_http/cache.rs
Comment thread anni-playback/src/cpal_output.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Comment thread anni-playback/src/dsp/resampler.rs Outdated
Comment thread anni-playback/src/dsp/resampler.rs
Comment thread anni-playback/src/cpal_output.rs Outdated
Comment thread anni-playback/src/utils/blocking_rb.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Comment thread anni-playback/src/sources/cached_http/mod.rs
Comment thread anni-playback/src/sources/cached_http/mod.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

Comment thread anni-playback/src/sources/cached_http/cache.rs
Comment thread anni-playback/src/utils/blocking_rb.rs
Comment thread anni-playback/src/cpal_output.rs
Comment thread anni-playback/src/cpal_output.rs
Comment thread anni-playback/src/cpal_output.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Comment thread anni-playback/src/sources/http.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

Comment thread anni-playback/src/player.rs
Comment thread anni-playback/src/utils/blocking_rb.rs
Comment thread anni-playback/src/dsp/resampler.rs
Comment thread anni-playback/src/decoder/decoder.rs
Comment thread anni-playback/src/cpal_output.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

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.

2 participants