add command/binding to jump to currently playing track

fixes #181
This commit is contained in:
Henrik Friedrichsen
2020-04-18 21:57:41 +02:00
parent 510f1ff6ad
commit 4e7af1c920
5 changed files with 20 additions and 2 deletions

View File

@@ -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() {