@@ -83,12 +83,16 @@ impl Queue {
|
||||
}
|
||||
|
||||
pub fn get_current(&self) -> Option<Track> {
|
||||
match *self.current_track.read().unwrap() {
|
||||
match self.get_current_index() {
|
||||
Some(index) => Some(self.queue.read().unwrap()[index].clone()),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_current_index(&self) -> Option<usize> {
|
||||
*self.current_track.read().unwrap()
|
||||
}
|
||||
|
||||
pub fn append(&self, track: &Track) {
|
||||
let mut random_order = self.random_order.write().unwrap();
|
||||
if let Some(order) = random_order.as_mut() {
|
||||
|
||||
Reference in New Issue
Block a user