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

@@ -20,7 +20,7 @@
#include "config.h"
#include "CueParser.hxx"
#include "util/StringUtil.hxx"
#include "song.h"
#include "Song.hxx"
#include "tag.h"
#include <glib.h>
@@ -42,13 +42,13 @@ CueParser::~CueParser()
g_free(filename);
if (current != nullptr)
song_free(current);
current->Free();
if (previous != nullptr)
song_free(previous);
previous->Free();
if (finished != nullptr)
song_free(finished);
finished->Free();
}
static const char *
@@ -250,7 +250,7 @@ CueParser::Feed2(char *p)
}
state = TRACK;
current = song_remote_new(filename);
current = Song::NewRemote(filename);
assert(current->tag == nullptr);
current->tag = tag_dup(tag);
tag_add_item(current->tag, TAG_TRACK, nr);
@@ -304,7 +304,7 @@ CueParser::Finish()
end = true;
}
struct song *
Song *
CueParser::Get()
{
if (finished == nullptr && end) {
@@ -316,7 +316,7 @@ CueParser::Get()
previous = nullptr;
}
struct song *song = finished;
Song *song = finished;
finished = nullptr;
return song;
}

View File

@@ -23,6 +23,8 @@
#include "check.h"
#include "gcc.h"
struct Song;
class CueParser {
enum {
/**
@@ -58,19 +60,19 @@ class CueParser {
/**
* The song currently being edited.
*/
struct song *current;
Song *current;
/**
* The previous song. It is remembered because its end_time
* will be set to the current song's start time.
*/
struct song *previous;
Song *previous;
/**
* A song that is completely finished and can be returned to
* the caller via cue_parser_get().
*/
struct song *finished;
Song *finished;
/**
* Set to true after previous.end_time has been updated to the
@@ -109,7 +111,7 @@ public:
* @return a song object that must be freed by the caller, or NULL if
* no song was finished at this time
*/
struct song *Get();
Song *Get();
private:
gcc_pure