From e46722b2ebe05fce63bc7b86100c159b5cadd297 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 27 Mar 2009 14:42:55 +0100 Subject: implements the smartstop feature The smartstop feature is a way to tell mpd to stop playing after current song. This patche provides: - 'state' command returns 'smartstop' state (1 or 0) - 'smartstop' can activate or not the smartstop state - when song is terminated, mpd stops playing and smartstop is set to 0 --- src/queue.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/queue.c') diff --git a/src/queue.c b/src/queue.c index b9486cfe..28da0e5a 100644 --- a/src/queue.c +++ b/src/queue.c @@ -40,6 +40,8 @@ queue_next_order(const struct queue *queue, unsigned order) { assert(order < queue->length); + if (queue->smartstop) + return -1; if (order + 1 < queue->length) return order + 1; else if (queue->repeat) @@ -275,6 +277,7 @@ queue_init(struct queue *queue, unsigned max_length) queue->version = 1; queue->repeat = false; queue->random = false; + queue->smartstop = false; queue->items = g_new(struct queue_item, max_length); queue->order = g_malloc(sizeof(queue->order[0]) * -- cgit v1.2.3