Commit 7519768c authored by Max Kellermann's avatar Max Kellermann

Queue: add "reorder" parameter to SetPriority()

parent 9af470c9
...@@ -402,7 +402,8 @@ Queue::CountSamePriority(unsigned start_order, uint8_t priority) const ...@@ -402,7 +402,8 @@ Queue::CountSamePriority(unsigned start_order, uint8_t priority) const
} }
bool bool
Queue::SetPriority(unsigned position, uint8_t priority, int after_order) Queue::SetPriority(unsigned position, uint8_t priority, int after_order,
bool reorder)
{ {
assert(position < length); assert(position < length);
...@@ -414,7 +415,7 @@ Queue::SetPriority(unsigned position, uint8_t priority, int after_order) ...@@ -414,7 +415,7 @@ Queue::SetPriority(unsigned position, uint8_t priority, int after_order)
item->version = version; item->version = version;
item->priority = priority; item->priority = priority;
if (!random) if (!random || !reorder)
/* don't reorder if not in random mode */ /* don't reorder if not in random mode */
return true; return true;
......
...@@ -340,10 +340,13 @@ struct Queue { ...@@ -340,10 +340,13 @@ struct Queue {
/** /**
* Shuffles a (position) range in the queue. The songs are physically * Shuffles a (position) range in the queue. The songs are physically
* shuffled, not by using the "order" mapping. * shuffled, not by using the "order" mapping.
*
* @param reorder false to suppress updating the order list
*/ */
void ShuffleRange(unsigned start, unsigned end); void ShuffleRange(unsigned start, unsigned end);
bool SetPriority(unsigned position, uint8_t priority, int after_order); bool SetPriority(unsigned position, uint8_t priority, int after_order,
bool reorder=true);
bool SetPriorityRange(unsigned start_position, unsigned end_position, bool SetPriorityRange(unsigned start_position, unsigned end_position,
uint8_t priority, int after_order); uint8_t priority, int after_order);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment