aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:05:25 +0200
committerMax Kellermann <max@duempel.org>2008-10-08 11:05:25 +0200
commit5e4be9e495677a6728e3161e39a05a081a5bff9a (patch)
treecbcf94a5d1c9236e5fff17f21cbd9e3f0557a574 /src/song.h
parent4a510a26744a78696f0c69713bf3b05881175fef (diff)
downloadmpd-5e4be9e495677a6728e3161e39a05a081a5bff9a.tar.gz
mpd-5e4be9e495677a6728e3161e39a05a081a5bff9a.tar.xz
mpd-5e4be9e495677a6728e3161e39a05a081a5bff9a.zip
song: replaced all song constructors
Provide separate constructors for creating a remote song, a local song, and one for loading data from a song file. This way, we can add more assertions.
Diffstat (limited to 'src/song.h')
-rw-r--r--src/song.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/song.h b/src/song.h
index 2510f3770..c3b79f966 100644
--- a/src/song.h
+++ b/src/song.h
@@ -36,11 +36,21 @@ struct song {
char url[sizeof(int)];
};
+/** allocate a new song with a remote URL */
struct song *
-song_alloc(const char *url, struct directory *parent);
+song_remote_new(const char *url);
+/** allocate a new song with a local file name */
struct song *
-newSong(const char *url, struct directory *parentDir);
+song_file_new(const char *path, struct directory *parent);
+
+/**
+ * allocate a new song structure with a local file name and attempt to
+ * load its metadata. If all decoder plugin fail to read its meta
+ * data, NULL is returned.
+ */
+struct song *
+song_file_load(const char *path, struct directory *parent);
void
freeJustSong(struct song *);