queue/Queue: MoveOrder() returns to_order

This commit is contained in:
Max Kellermann 2017-10-18 08:46:31 +02:00
parent fa67c2548a
commit 81b7373637
3 changed files with 6 additions and 4 deletions

View File

@ -310,8 +310,7 @@ playlist::SetRandom(PlayerControl &pc, bool status)
playlist is played after that */
unsigned current_order =
queue.PositionToOrder(current_position);
queue.MoveOrder(current_order, 0);
current = 0;
current = queue.MoveOrder(current_order, 0);
} else
current = -1;
} else

View File

@ -195,7 +195,7 @@ Queue::MoveRange(unsigned start, unsigned end, unsigned to) noexcept
}
}
void
unsigned
Queue::MoveOrder(unsigned from_order, unsigned to_order) noexcept
{
assert(from_order < length);
@ -212,6 +212,7 @@ Queue::MoveOrder(unsigned from_order, unsigned to_order) noexcept
}
order[to_order] = from_position;
return to_order;
}
void

View File

@ -284,8 +284,10 @@ struct Queue {
/**
* Moves a song to a new position in the "order" list.
*
* @return to_order
*/
void MoveOrder(unsigned from_order, unsigned to_order) noexcept;
unsigned MoveOrder(unsigned from_order, unsigned to_order) noexcept;
/**
* Moves a song to a new position.