mirror of
https://github.com/librespot-org/librespot.git
synced 2025-03-09 00:17:28 +00:00
Exposes the PlayerTrackLoader
This commit is contained in:
parent
f3bb380851
commit
127f54e90f
2 changed files with 9 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue