mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 18:29:45 +02:00
Prepare for gapless play.
- change communication between player and spirc to use player events channel. - enhance player events channel - have spirc send loading messages to Spotify - enable preloading of tracks in the player
This commit is contained in:
parent
3672214e31
commit
5784b4652c
6 changed files with 1375 additions and 398 deletions
|
@ -144,6 +144,15 @@ impl StreamLoaderController {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn range_to_end_available(&self) -> bool {
|
||||
if let Some(ref shared) = self.stream_shared {
|
||||
let read_position = shared.read_position.load(atomic::Ordering::Relaxed);
|
||||
self.range_available(Range::new(read_position, self.len() - read_position))
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ping_time_ms(&self) -> usize {
|
||||
if let Some(ref shared) = self.stream_shared {
|
||||
return shared.ping_time_ms.load(atomic::Ordering::Relaxed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue