aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:05:25 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:47 -0700
commitd24e17ebdd5eeb16c87b897a9ecb52a5704a52b3 (patch)
treed8baf242394faccf5c73ac18367c9a542a73bad7 /src/song.h
parent5f15ba96cf5fa641d34d4e98ae8e0972fa6fef0c (diff)
downloadmpd-d24e17ebdd5eeb16c87b897a9ecb52a5704a52b3.tar.gz
mpd-d24e17ebdd5eeb16c87b897a9ecb52a5704a52b3.tar.xz
mpd-d24e17ebdd5eeb16c87b897a9ecb52a5704a52b3.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.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/song.h b/src/song.h
index 88adde0f0..0d2f976ac 100644
--- a/src/song.h
+++ b/src/song.h
@@ -38,10 +38,21 @@ struct mpd_song {
char url[sizeof(size_t)];
};
-struct mpd_song *newSong(const char *url, struct directory *parentDir);
-
void freeJustSong(struct mpd_song *);
+/** allocate a new song with a remote URL */
+struct mpd_song * song_remote_new(const char *url);
+
+/** allocate a new song with a local file name */
+struct mpd_song * 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 mpd_song * song_file_load(const char *path, struct directory *parent);
+
ssize_t song_print_info(struct mpd_song * song, int fd);
/* like song_print_info, but casts data into an fd first */