Add key command to select currently playing track
This commit is contained in:
parent
902c0b903f
commit
4b34fa7233
|
|
@ -41,6 +41,9 @@ impl Queue {
|
||||||
self.tx.send(MessageFromUi::SetCurrentTrack(pos));
|
self.tx.send(MessageFromUi::SetCurrentTrack(pos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn select_current(&mut self) {
|
||||||
|
self.select(Some(self.current_position));
|
||||||
|
}
|
||||||
pub fn remove_track(&mut self) {
|
pub fn remove_track(&mut self) {
|
||||||
if let Some(pos) = self.selected() {
|
if let Some(pos) = self.selected() {
|
||||||
// FIXME: mark multiple tracks on queue and remove them
|
// FIXME: mark multiple tracks on queue and remove them
|
||||||
|
|
|
||||||
|
|
@ -303,6 +303,9 @@ fn run_ui(tx: Sender<MessageFromUi>, rx: Receiver<MessageToUi>) {
|
||||||
(UiFocus::Queue, KeyModifiers::CONTROL, KeyCode::Char('u')) => {
|
(UiFocus::Queue, KeyModifiers::CONTROL, KeyCode::Char('u')) => {
|
||||||
app.queue.up();
|
app.queue.up();
|
||||||
}
|
}
|
||||||
|
(UiFocus::Queue, KeyModifiers::NONE, KeyCode::Char('o')) => {
|
||||||
|
app.queue.select_current();
|
||||||
|
}
|
||||||
(UiFocus::Queue, KeyModifiers::NONE, KeyCode::Enter) => {
|
(UiFocus::Queue, KeyModifiers::NONE, KeyCode::Enter) => {
|
||||||
app.queue.play_selected();
|
app.queue.play_selected();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue