Skip to content

Commit

Permalink
Exposes the PlayerTrackLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-00FF00 committed Jan 19, 2025
1 parent f3bb380 commit 127f54e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
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

0 comments on commit 127f54e

Please sign in to comment.