diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 14:00:51 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 14:00:51 +0100 |
commit | 688880bc0b22d13321da62ae93363e4b85846f68 (patch) | |
tree | 19b48299aa2f5b42c68bc5e2ca5ecd617a371526 /src/queue.c | |
parent | 1a59afa388874a2ceadcef2644fa9e08f0a9b828 (diff) | |
download | mpd-688880bc0b22d13321da62ae93363e4b85846f68.tar.gz mpd-688880bc0b22d13321da62ae93363e4b85846f68.tar.xz mpd-688880bc0b22d13321da62ae93363e4b85846f68.zip |
queue: added queue_shuffle_order_last()
This function shuffles the last song of a range. This is used by
addSongToPlaylist().
Diffstat (limited to '')
-rw-r--r-- | src/queue.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/queue.c b/src/queue.c index 983c5e43c..73adb2f49 100644 --- a/src/queue.c +++ b/src/queue.c @@ -255,6 +255,13 @@ queue_shuffle_order(struct queue *queue) } void +queue_shuffle_order_last(struct queue *queue, unsigned start, unsigned end) +{ + queue_swap_order(queue, end - 1, + g_rand_int_range(queue->rand, start, end)); +} + +void queue_shuffle_range(struct queue *queue, unsigned start, unsigned end) { assert(start <= end); |