diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-05 18:18:18 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-05 18:25:25 -0700 |
commit | bb1c32af94c42cda454a0ba2a2979626b96b53fd (patch) | |
tree | 3813323e9b9cd6450e062b2d2bf5238fc99fcb84 /src/song.h | |
parent | 36eba830fc097279f568e801b2d2a35a08004717 (diff) | |
download | mpd-bb1c32af94c42cda454a0ba2a2979626b96b53fd.tar.gz mpd-bb1c32af94c42cda454a0ba2a2979626b96b53fd.tar.xz mpd-bb1c32af94c42cda454a0ba2a2979626b96b53fd.zip |
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).
Diffstat (limited to '')
-rw-r--r-- | src/song.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/song.h b/src/song.h index aebc8f044..377a78814 100644 --- a/src/song.h +++ b/src/song.h @@ -30,11 +30,6 @@ #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: " @@ -42,12 +37,10 @@ typedef struct _Song { struct mpd_tag *tag; struct _Directory *parentDir; time_t mtime; - enum song_type type; char url[1]; } mpd_packed Song; -Song *newSong(const char *url, enum song_type type, - struct _Directory *parentDir); +Song *newSong(const char *url, struct _Directory *parentDir); void freeSong(Song *); @@ -69,4 +62,9 @@ void printSongUrl(int fd, 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 |