mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 14:14:21 +00:00
Add a len() method to Sink for some insight into the queue state.
This commit is contained in:
parent
25d3151917
commit
f36411f6f5
1 changed files with 7 additions and 1 deletions
|
@ -148,7 +148,13 @@ impl Sink {
|
|||
/// Returns true if this sink has no more sounds to play.
|
||||
#[inline]
|
||||
pub fn empty(&self) -> bool {
|
||||
self.sound_count.load(Ordering::Relaxed) == 0
|
||||
self.len() == 0
|
||||
}
|
||||
|
||||
/// Returns the number of sounds currently in the queue.
|
||||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
self.sound_count.load(Ordering::Relaxed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue