diff --git a/src/queue/Playlist.cxx b/src/queue/Playlist.cxx index 667e3457f..dfeb0d163 100644 --- a/src/queue/Playlist.cxx +++ b/src/queue/Playlist.cxx @@ -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 diff --git a/src/queue/Queue.cxx b/src/queue/Queue.cxx index d248f306b..9ee9568e0 100644 --- a/src/queue/Queue.cxx +++ b/src/queue/Queue.cxx @@ -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 diff --git a/src/queue/Queue.hxx b/src/queue/Queue.hxx index bd2f95c1a..b9ca341e4 100644 --- a/src/queue/Queue.hxx +++ b/src/queue/Queue.hxx @@ -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.