diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-06 18:52:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-06 18:52:13 +0200 |
commit | f1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea (patch) | |
tree | 47a2c85685dbf09cc4c1f44f66f8afd11c0daa84 /src/song.h | |
parent | 22e40b61cc0166dcda15b7146724928368201b07 (diff) |
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 'src/song.h')
-rw-r--r-- | src/song.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/song.h b/src/song.h index c20bae270..b5f316955 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 |