commit 3596777343e23033eea9cdd618adeb7871a6c708
parent d7762735059e53a8f9cf549b06af6f3f6013efd4
Author: Louis Burda <quent.burda@gmail.com>
Date: Fri, 17 Feb 2023 23:16:50 +0100
Allow unqueuing last track
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/tui.c b/src/tui.c
@@ -62,6 +62,7 @@ static bool nav_to_track(struct track *target);
static bool rename_current_track(void);
static bool delete_current_track(void);
static void queue_current_track(void);
+static void unqueue_last_track(void);
static bool track_pane_input(wint_t c);
static void track_pane_vis(struct pane *pane, int sel);
@@ -611,6 +612,16 @@ queue_current_track(void)
list_push_back(&player.queue, &track->link_pq);
}
+void
+unqueue_last_track(void)
+{
+ struct link *link;
+
+ link = list_back(&player.queue);
+ if (!link) return;
+ link_pop(link);
+}
+
bool
track_pane_input(wint_t c)
{
@@ -641,9 +652,12 @@ track_pane_input(wint_t c)
case L'G': /* seek end of list */
listnav_update_sel(&track_nav, track_nav.max - 1);
break;
- case L'y': /* queue track */
+ case L'y': /* push queue track */
queue_current_track();
break;
+ case L'Y': /* pop queue track */
+ unqueue_last_track();
+ break;
case L'n': /* seek playing */
nav_to_track(player.track);
break;