Exposes the PlayerTrackLoader

This commit is contained in:
Joshua 2025-01-19 15:22:44 +00:00
parent f3bb380851
commit 127f54e90f
2 changed files with 9 additions and 8 deletions

View file

@ -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

View file

@ -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<dyn AudioDecoder + Send>;
pub type Decoder = Box<dyn AudioDecoder + Send>;
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,