Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes the PlayerTrackLoader #1452

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [connect] Replaced `ConnectConfig` with `ConnectStateConfig` (breaking)
- [connect] Replaced `playing_track_index` field of `SpircLoadCommand` with `playing_track` (breaking)
- [connect] Replaced Mercury usage in `Spirc` with Dealer
- [player] Expose `PlayerTrackLoader` as a public interface.

### Added

Expand Down
16 changes: 8 additions & 8 deletions playback/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,11 @@ impl Drop for Player {
}
}

struct PlayerLoadedTrackData {
decoder: Decoder,
pub struct PlayerLoadedTrackData {
pub decoder: Decoder,
pub audio_item: AudioItem,
normalisation_data: NormalisationData,
stream_loader_controller: StreamLoaderController,
audio_item: AudioItem,
bytes_per_second: usize,
duration_ms: u32,
stream_position_ms: u32,
Expand All @@ -655,7 +655,7 @@ enum PlayerPreload {
},
}

type Decoder = Box<dyn AudioDecoder + Send>;
pub type Decoder = Box<dyn AudioDecoder + Send>;

enum PlayerState {
Stopped,
Expand Down Expand Up @@ -876,9 +876,9 @@ impl PlayerState {
}
}

struct PlayerTrackLoader {
session: Session,
config: PlayerConfig,
pub struct PlayerTrackLoader {
pub session: Session,
pub config: PlayerConfig,
}

impl PlayerTrackLoader {
Expand Down Expand Up @@ -927,7 +927,7 @@ impl PlayerTrackLoader {
Some(data_rate.ceil() as usize)
}

async fn load_track(
pub async fn load_track(
&self,
spotify_id: SpotifyId,
position_ms: u32,
Expand Down
Loading