diff --git a/src/queue.rs b/src/queue.rs index 840e4f50..523cf1ea 100644 --- a/src/queue.rs +++ b/src/queue.rs @@ -100,6 +100,11 @@ impl SourcesQueueInput { self.keep_alive_if_empty.load(Ordering::Acquire) } + /// Returns the additional length of the queue. + pub fn queue_len(&self) -> usize { + self.next_sounds.lock().unwrap().len() + } + /// Removes all the sounds from the queue. Returns the number of sounds cleared. pub fn clear(&self) -> usize { let mut sounds = self.next_sounds.lock().unwrap();