song: convert header to C++

This commit is contained in:
Max Kellermann
2013-07-28 13:25:12 +02:00
parent 43f613d9be
commit ba161ec572
91 changed files with 643 additions and 691 deletions

View File

@@ -19,7 +19,7 @@
#include "config.h"
#include "Queue.hxx"
#include "song.h"
#include "Song.hxx"
#include <stdlib.h>
@@ -97,7 +97,7 @@ queue::ModifyAll()
}
unsigned
queue::Append(struct song *song, uint8_t priority)
queue::Append(Song *song, uint8_t priority)
{
assert(!IsFull());
@@ -105,7 +105,7 @@ queue::Append(struct song *song, uint8_t priority)
const unsigned id = id_table.Insert(position);
auto &item = items[position];
item.song = song_dup_detached(song);
item.song = song->DupDetached();
item.id = id;
item.version = version;
item.priority = priority;
@@ -232,9 +232,9 @@ queue::DeletePosition(unsigned position)
{
assert(position < length);
struct song *song = Get(position);
assert(!song_in_database(song) || song_is_detached(song));
song_free(song);
Song *song = Get(position);
assert(!song->IsInDatabase() || song->IsDetached());
song->Free();
const unsigned id = PositionToId(position);
const unsigned _order = PositionToOrder(position);
@@ -268,9 +268,9 @@ queue::Clear()
for (unsigned i = 0; i < length; i++) {
Item *item = &items[i];
assert(!song_in_database(item->song) ||
song_is_detached(item->song));
song_free(item->song);
assert(!item->song->IsInDatabase() ||
item->song->IsDetached());
item->song->Free();
id_table.Erase(item->id);
}