diff --git a/CHANGELOG.md b/CHANGELOG.md index ad5c94329..279f69ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/playback/src/player.rs b/playback/src/player.rs index e9663a706..de396a482 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -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, @@ -655,7 +655,7 @@ enum PlayerPreload { }, } -type Decoder = Box; +pub type Decoder = Box; enum PlayerState { Stopped, @@ -876,9 +876,9 @@ impl PlayerState { } } -struct PlayerTrackLoader { - session: Session, - config: PlayerConfig, +pub struct PlayerTrackLoader { + pub session: Session, + pub config: PlayerConfig, } impl PlayerTrackLoader { @@ -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,