Merge tag 'v0.20.7'
release v0.20.7
This commit is contained in:
@@ -92,7 +92,7 @@ playlist::QueuedSongStarted(PlayerControl &pc)
|
||||
}
|
||||
|
||||
const DetachedSong *
|
||||
playlist::GetQueuedSong() const
|
||||
playlist::GetQueuedSong() const noexcept
|
||||
{
|
||||
return playing && queued >= 0
|
||||
? &queue.GetOrder(queued)
|
||||
@@ -323,7 +323,7 @@ playlist::SetRandom(PlayerControl &pc, bool status)
|
||||
}
|
||||
|
||||
int
|
||||
playlist::GetCurrentPosition() const
|
||||
playlist::GetCurrentPosition() const noexcept
|
||||
{
|
||||
return current >= 0
|
||||
? queue.OrderToPosition(current)
|
||||
@@ -331,7 +331,7 @@ playlist::GetCurrentPosition() const
|
||||
}
|
||||
|
||||
int
|
||||
playlist::GetNextPosition() const
|
||||
playlist::GetNextPosition() const noexcept
|
||||
{
|
||||
if (current < 0)
|
||||
return -1;
|
||||
|
@@ -113,17 +113,17 @@ struct playlist {
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
int GetCurrentPosition() const;
|
||||
int GetCurrentPosition() const noexcept;
|
||||
|
||||
gcc_pure
|
||||
int GetNextPosition() const;
|
||||
int GetNextPosition() const noexcept;
|
||||
|
||||
/**
|
||||
* Returns the song object which is currently queued. Returns
|
||||
* none if there is none (yet?) or if MPD isn't playing.
|
||||
*/
|
||||
gcc_pure
|
||||
const DetachedSong *GetQueuedSong() const;
|
||||
const DetachedSong *GetQueuedSong() const noexcept;
|
||||
|
||||
/**
|
||||
* This is the "PLAYLIST" event handler. It is invoked by the
|
||||
|
@@ -43,7 +43,7 @@ Queue::~Queue()
|
||||
}
|
||||
|
||||
int
|
||||
Queue::GetNextOrder(unsigned _order) const
|
||||
Queue::GetNextOrder(unsigned _order) const noexcept
|
||||
{
|
||||
assert(_order < length);
|
||||
|
||||
@@ -60,7 +60,7 @@ Queue::GetNextOrder(unsigned _order) const
|
||||
}
|
||||
|
||||
void
|
||||
Queue::IncrementVersion()
|
||||
Queue::IncrementVersion() noexcept
|
||||
{
|
||||
static unsigned long max = ((uint32_t) 1 << 31) - 1;
|
||||
|
||||
@@ -75,7 +75,7 @@ Queue::IncrementVersion()
|
||||
}
|
||||
|
||||
void
|
||||
Queue::ModifyAtOrder(unsigned _order)
|
||||
Queue::ModifyAtOrder(unsigned _order) noexcept
|
||||
{
|
||||
assert(_order < length);
|
||||
|
||||
@@ -103,7 +103,7 @@ Queue::Append(DetachedSong &&song, uint8_t priority)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::SwapPositions(unsigned position1, unsigned position2)
|
||||
Queue::SwapPositions(unsigned position1, unsigned position2) noexcept
|
||||
{
|
||||
unsigned id1 = items[position1].id;
|
||||
unsigned id2 = items[position2].id;
|
||||
@@ -118,7 +118,7 @@ Queue::SwapPositions(unsigned position1, unsigned position2)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::MovePostion(unsigned from, unsigned to)
|
||||
Queue::MovePostion(unsigned from, unsigned to) noexcept
|
||||
{
|
||||
const Item tmp = items[from];
|
||||
|
||||
@@ -154,7 +154,7 @@ Queue::MovePostion(unsigned from, unsigned to)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::MoveRange(unsigned start, unsigned end, unsigned to)
|
||||
Queue::MoveRange(unsigned start, unsigned end, unsigned to) noexcept
|
||||
{
|
||||
Item tmp[end - start];
|
||||
// Copy the original block [start,end-1]
|
||||
@@ -196,7 +196,7 @@ Queue::MoveRange(unsigned start, unsigned end, unsigned to)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::MoveOrder(unsigned from_order, unsigned to_order)
|
||||
Queue::MoveOrder(unsigned from_order, unsigned to_order) noexcept
|
||||
{
|
||||
assert(from_order < length);
|
||||
assert(to_order <= length);
|
||||
@@ -215,7 +215,7 @@ Queue::MoveOrder(unsigned from_order, unsigned to_order)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::DeletePosition(unsigned position)
|
||||
Queue::DeletePosition(unsigned position) noexcept
|
||||
{
|
||||
assert(position < length);
|
||||
|
||||
@@ -248,7 +248,7 @@ Queue::DeletePosition(unsigned position)
|
||||
}
|
||||
|
||||
void
|
||||
Queue::Clear()
|
||||
Queue::Clear() noexcept
|
||||
{
|
||||
for (unsigned i = 0; i < length; i++) {
|
||||
Item *item = &items[i];
|
||||
@@ -262,7 +262,8 @@ Queue::Clear()
|
||||
}
|
||||
|
||||
static void
|
||||
queue_sort_order_by_priority(Queue *queue, unsigned start, unsigned end)
|
||||
queue_sort_order_by_priority(Queue *queue,
|
||||
unsigned start, unsigned end) noexcept
|
||||
{
|
||||
assert(queue != nullptr);
|
||||
assert(queue->random);
|
||||
@@ -370,7 +371,7 @@ Queue::ShuffleRange(unsigned start, unsigned end)
|
||||
|
||||
unsigned
|
||||
Queue::FindPriorityOrder(unsigned start_order, uint8_t priority,
|
||||
unsigned exclude_order) const
|
||||
unsigned exclude_order) const noexcept
|
||||
{
|
||||
assert(random);
|
||||
assert(start_order <= length);
|
||||
@@ -386,7 +387,7 @@ Queue::FindPriorityOrder(unsigned start_order, uint8_t priority,
|
||||
}
|
||||
|
||||
unsigned
|
||||
Queue::CountSamePriority(unsigned start_order, uint8_t priority) const
|
||||
Queue::CountSamePriority(unsigned start_order, uint8_t priority) const noexcept
|
||||
{
|
||||
assert(random);
|
||||
assert(start_order <= length);
|
||||
|
@@ -232,13 +232,13 @@ struct Queue {
|
||||
* @return the next order number, or -1 to stop playback
|
||||
*/
|
||||
gcc_pure
|
||||
int GetNextOrder(unsigned order) const;
|
||||
int GetNextOrder(unsigned order) const noexcept;
|
||||
|
||||
/**
|
||||
* Increments the queue's version number. This handles integer
|
||||
* overflow well.
|
||||
*/
|
||||
void IncrementVersion();
|
||||
void IncrementVersion() noexcept;
|
||||
|
||||
/**
|
||||
* Marks the specified song as "modified". Call
|
||||
@@ -256,7 +256,7 @@ struct Queue {
|
||||
* IncrementVersion() after all modifications have been made.
|
||||
* number.
|
||||
*/
|
||||
void ModifyAtOrder(unsigned order);
|
||||
void ModifyAtOrder(unsigned order) noexcept;
|
||||
|
||||
/**
|
||||
* Appends a song to the queue and returns its position. Prior to
|
||||
@@ -273,7 +273,7 @@ struct Queue {
|
||||
/**
|
||||
* Swaps two songs, addressed by their position.
|
||||
*/
|
||||
void SwapPositions(unsigned position1, unsigned position2);
|
||||
void SwapPositions(unsigned position1, unsigned position2) noexcept;
|
||||
|
||||
/**
|
||||
* Swaps two songs, addressed by their order number.
|
||||
@@ -285,27 +285,27 @@ struct Queue {
|
||||
/**
|
||||
* Moves a song to a new position in the "order" list.
|
||||
*/
|
||||
void MoveOrder(unsigned from_order, unsigned to_order);
|
||||
void MoveOrder(unsigned from_order, unsigned to_order) noexcept;
|
||||
|
||||
/**
|
||||
* Moves a song to a new position.
|
||||
*/
|
||||
void MovePostion(unsigned from, unsigned to);
|
||||
void MovePostion(unsigned from, unsigned to) noexcept;
|
||||
|
||||
/**
|
||||
* Moves a range of songs to a new position.
|
||||
*/
|
||||
void MoveRange(unsigned start, unsigned end, unsigned to);
|
||||
void MoveRange(unsigned start, unsigned end, unsigned to) noexcept;
|
||||
|
||||
/**
|
||||
* Removes a song from the playlist.
|
||||
*/
|
||||
void DeletePosition(unsigned position);
|
||||
void DeletePosition(unsigned position) noexcept;
|
||||
|
||||
/**
|
||||
* Removes all songs from the playlist.
|
||||
*/
|
||||
void Clear();
|
||||
void Clear() noexcept;
|
||||
|
||||
/**
|
||||
* Initializes the "order" array, and restores "normal" order.
|
||||
@@ -369,11 +369,11 @@ private:
|
||||
*/
|
||||
gcc_pure
|
||||
unsigned FindPriorityOrder(unsigned start_order, uint8_t priority,
|
||||
unsigned exclude_order) const;
|
||||
unsigned exclude_order) const noexcept;
|
||||
|
||||
gcc_pure
|
||||
unsigned CountSamePriority(unsigned start_order,
|
||||
uint8_t priority) const;
|
||||
uint8_t priority) const noexcept;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user