From 5e4be9e495677a6728e3161e39a05a081a5bff9a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Oct 2008 11:05:25 +0200 Subject: 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. --- src/song.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/song.h') 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 *); -- cgit v1.2.3