aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue.c
diff options
context:
space:
mode:
authorRomain Bignon <romain@peerfuse.org>2009-03-27 14:42:55 +0100
committerRomain Bignon <romain@peerfuse.org>2009-03-27 14:58:31 +0100
commite46722b2ebe05fce63bc7b86100c159b5cadd297 (patch)
treec61515a84ad0f425233a7ebe7ee3731ab63df92a /src/queue.c
parent929c200c380996d6dfcbdd468a74aaef48298af6 (diff)
downloadmpd-e46722b2ebe05fce63bc7b86100c159b5cadd297.tar.gz
mpd-e46722b2ebe05fce63bc7b86100c159b5cadd297.tar.xz
mpd-e46722b2ebe05fce63bc7b86100c159b5cadd297.zip
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
Diffstat (limited to '')
-rw-r--r--src/queue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/queue.c b/src/queue.c
index b9486cfe5..28da0e5a3 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]) *