diff options
author | Max Kellermann <max@duempel.org> | 2013-01-07 21:26:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-07 21:26:22 +0100 |
commit | 53e5139b9940bd51af5ad6bc123331a94af5f462 (patch) | |
tree | 448ec45aac2fd1334ef40847f6185b6638b4a6f1 | |
parent | 2b8ce83c9b5963706d2729334add71251fa32b79 (diff) | |
download | mpd-53e5139b9940bd51af5ad6bc123331a94af5f462.tar.gz mpd-53e5139b9940bd51af5ad6bc123331a94af5f462.tar.xz mpd-53e5139b9940bd51af5ad6bc123331a94af5f462.zip |
Queue: move queue_shuffle_order_first() into the class
-rw-r--r-- | src/Queue.cxx | 9 | ||||
-rw-r--r-- | src/Queue.hxx | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Queue.cxx b/src/Queue.cxx index 608cb1736..5b3e00d90 100644 --- a/src/Queue.cxx +++ b/src/Queue.cxx @@ -423,10 +423,10 @@ queue::ShuffleOrder() ShuffleOrderRangeWithPriority(0, length); } -static void -queue_shuffle_order_first(struct queue *queue, unsigned start, unsigned end) +void +queue::ShuffleOrderFirst(unsigned start, unsigned end) { - queue->SwapOrders(start, g_rand_int_range(queue->rand, start, end)); + SwapOrders(start, g_rand_int_range(rand, start, end)); } void @@ -543,8 +543,7 @@ queue::SetPriority(unsigned position, uint8_t priority, int after_order) const unsigned priority_count = queue_count_same_priority(this, new_order, priority); assert(priority_count >= 1); - queue_shuffle_order_first(this, new_order, - new_order + priority_count); + ShuffleOrderFirst(new_order, new_order + priority_count); return true; } diff --git a/src/Queue.hxx b/src/Queue.hxx index 0652c711f..b887810b0 100644 --- a/src/Queue.hxx +++ b/src/Queue.hxx @@ -316,6 +316,8 @@ struct queue { */ void ShuffleOrder(); + void ShuffleOrderFirst(unsigned start, unsigned end); + /** * Shuffles the virtual order of the last song in the specified * (order) range. This is used in random mode after a song has been |