TrackQueue: Add current_queue method (#16)
This commit is contained in:
@@ -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<TrackHandle> {
|
||||
let inner = self.inner.lock();
|
||||
|
||||
inner.tracks.iter().map(|q| q.handle()).collect()
|
||||
}
|
||||
}
|
||||
|
||||
impl TrackQueueCore {
|
||||
|
||||
Reference in New Issue
Block a user