From: Richard Kettlewell Date: Wed, 29 Oct 2008 19:07:52 +0000 (+0000) Subject: Obsolete playing_random state X-Git-Tag: 5.0.3~5^2~54 X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/commitdiff_plain/3867fa20c6fd4e319b1ab77ebfa3ed8c68cbcfa7?hp=094e0af7be0a5c3bf65be093bba0f31cdf2f9718 Obsolete playing_random state --- diff --git a/lib/queue.h b/lib/queue.h index 6baf916..f62ccac 100644 --- a/lib/queue.h +++ b/lib/queue.h @@ -60,10 +60,11 @@ enum playing_state { /** @brief Track is playing but the server is quitting */ playing_quitting, - /** @brief Track was randomly chosen and has not been played + /** @brief OBSOLETE * - * This is going to become obsolete eventually; it's equivalent to @ref - * playing_unplayed but for tracks with a different origin. + * Formerly this meant a track that was picked at random and has not yet been + * played. This situation is now indicated by @p playing_unplayed and @p + * origin_random (or @p origin_adopted). */ playing_random, diff --git a/server/play.c b/server/play.c index 9a04a98..8b79843 100644 --- a/server/play.c +++ b/server/play.c @@ -492,7 +492,6 @@ static void chosen_random_track(ev_source *ev, return; /* Add the track to the queue */ q = queue_add(track, 0, WHERE_END, origin_random); - q->state = playing_random; D(("picked %p (%s) at random", (void *)q, q->track)); queue_write(); /* Maybe a track can now be played */ diff --git a/server/server-queue.c b/server/server-queue.c index 38af055..779e5e1 100644 --- a/server/server-queue.c +++ b/server/server-queue.c @@ -85,8 +85,16 @@ static void queue_do_read(struct queue_entry *head, const char *path) { /* Fix up origin field as best we can; will be wrong in some cases but * hopefully not too horribly so. */ q->origin = q->submitter ? origin_picked : origin_random; - if(q->state == playing_isscratch) + switch(q->state) { + case playing_isscratch: q->origin = origin_scratch; + break; + case playing_random: + q->state = playing_unplayed; + break; + default: + break; + } } if(head == &qhead && (!q->track