Queue: move queue_shuffle_order_first() into the class
This commit is contained in:
parent
2b8ce83c9b
commit
53e5139b99
@ -423,10 +423,10 @@ queue::ShuffleOrder()
|
|||||||
ShuffleOrderRangeWithPriority(0, length);
|
ShuffleOrderRangeWithPriority(0, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
queue_shuffle_order_first(struct queue *queue, unsigned start, unsigned end)
|
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
|
void
|
||||||
@ -543,8 +543,7 @@ queue::SetPriority(unsigned position, uint8_t priority, int after_order)
|
|||||||
const unsigned priority_count =
|
const unsigned priority_count =
|
||||||
queue_count_same_priority(this, new_order, priority);
|
queue_count_same_priority(this, new_order, priority);
|
||||||
assert(priority_count >= 1);
|
assert(priority_count >= 1);
|
||||||
queue_shuffle_order_first(this, new_order,
|
ShuffleOrderFirst(new_order, new_order + priority_count);
|
||||||
new_order + priority_count);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -316,6 +316,8 @@ struct queue {
|
|||||||
*/
|
*/
|
||||||
void ShuffleOrder();
|
void ShuffleOrder();
|
||||||
|
|
||||||
|
void ShuffleOrderFirst(unsigned start, unsigned end);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffles the virtual order of the last song in the specified
|
* Shuffles the virtual order of the last song in the specified
|
||||||
* (order) range. This is used in random mode after a song has been
|
* (order) range. This is used in random mode after a song has been
|
||||||
|
Loading…
Reference in New Issue
Block a user