-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to return a vector of all the handles in a queue #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request. This should be a good convenience method.
A few nits, mainly in naming and pointing out some gotchas in documentation for future users.
src/tracks/queue.rs
Outdated
@@ -278,6 +278,13 @@ impl TrackQueue { | |||
|
|||
inner.stop_current() | |||
} | |||
|
|||
/// Returns Vec of all handles in queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main points to mention in docs after the headline:
- Reordering the queue can't be done here, and has to go through
modify_queue
. The returned Vec is a snapshot of the queue at the time of call, and might change afterwards. - Calling
stop
on a handle will effectively skip that track.
Minor nits:
- can you please end doc comments with a full stop?
- Maybe something like "Returns a list of currently queued tracks." for the headline?
src/tracks/queue.rs
Outdated
@@ -278,6 +278,13 @@ impl TrackQueue { | |||
|
|||
inner.stop_current() | |||
} | |||
|
|||
/// Returns Vec of all handles in queue | |||
pub fn to_vec(&self) -> Vec<TrackHandle> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn to_vec(&self) -> Vec<TrackHandle> { | |
pub fn current_queue(&self) -> Vec<TrackHandle> { |
This is a little more descriptive of the function's purpose here.
Basically, an extension to current() but returns a vector of all the handles in a queue