diff --git a/src/tracks/queue.rs b/src/tracks/queue.rs index bbfab65e8..d7e635bf0 100644 --- a/src/tracks/queue.rs +++ b/src/tracks/queue.rs @@ -278,6 +278,19 @@ impl TrackQueue { inner.stop_current() } + + /// Returns a list of currently queued tracks. + /// + /// Does not allow for modification of the queue, instead returns a snapshot of the queue at the time of calling. + /// + /// Use [`modify_queue`] for direct modification of the queue. + /// + /// [`modify_queue`]: #method.modify_queue + pub fn current_queue(&self) -> Vec { + let inner = self.inner.lock(); + + inner.tracks.iter().map(|q| q.handle()).collect() + } } impl TrackQueueCore {