From f1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Oct 2008 18:52:13 +0200 Subject: song: stop storing song_type We already know if a song is a URL or not based on whether it has parentDir defined or not. Hopefully one day in the future we can drop HTTP support from MPD entirely when an HTTP filesystem comes along and we can access streams via open(2). --- src/song.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/song.h') diff --git a/src/song.h b/src/song.h index c20bae27..b5f31695 100644 --- a/src/song.h +++ b/src/song.h @@ -25,18 +25,12 @@ #define SONG_BEGIN "songList begin" #define SONG_END "songList end" -enum song_type { - SONG_TYPE_FILE = 1, - SONG_TYPE_URL = 2 -}; - #define SONG_FILE "file: " #define SONG_TIME "Time: " struct client; typedef struct _Song { - enum song_type type; struct tag *tag; struct _Directory *parentDir; time_t mtime; @@ -44,10 +38,9 @@ typedef struct _Song { } mpd_packed Song; Song * -song_alloc(const char *url, enum song_type type, struct _Directory *parent); +song_alloc(const char *url, struct _Directory *parent); -Song *newSong(const char *url, enum song_type type, - struct _Directory *parentDir); +Song *newSong(const char *url, struct _Directory *parentDir); void freeSong(Song *); @@ -63,4 +56,9 @@ int updateSongInfo(Song * song); */ char *get_song_url(char *path_max_tmp, Song * song); +static inline int song_is_file(const Song *song) +{ + return !!song->parentDir; +} + #endif -- cgit v1.2.3