diff options
author | Max Kellermann <max@duempel.org> | 2014-01-19 10:51:34 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-19 17:04:51 +0100 |
commit | f5ae1ce00b85699291a7cdf9782574e70a8c28f5 (patch) | |
tree | 9cb95dd1d98b1b0cd522ee27d7e8a374a3c8eb4a /src/SongPrint.cxx | |
parent | 738d6f10409037fbf8aa30cec5aceb121e21e230 (diff) | |
download | mpd-f5ae1ce00b85699291a7cdf9782574e70a8c28f5.tar.gz mpd-f5ae1ce00b85699291a7cdf9782574e70a8c28f5.tar.xz mpd-f5ae1ce00b85699291a7cdf9782574e70a8c28f5.zip |
LightSong: new class to be used by DatabasePlugin callbacks
Detach the Song class completely from the public API, only to be used
by SimpleDatabase and the update thread.
Diffstat (limited to 'src/SongPrint.cxx')
-rw-r--r-- | src/SongPrint.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index 67b622356..810518c21 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -19,7 +19,7 @@ #include "config.h" #include "SongPrint.hxx" -#include "Song.hxx" +#include "LightSong.hxx" #include "DetachedSong.hxx" #include "Directory.hxx" #include "TimePrint.hxx" @@ -28,6 +28,8 @@ #include "Client.hxx" #include "util/UriUtil.hxx" +#define SONG_FILE "file: " + static void song_print_uri(Client &client, const char *uri) { @@ -40,11 +42,11 @@ song_print_uri(Client &client, const char *uri) } void -song_print_uri(Client &client, const Song &song) +song_print_uri(Client &client, const LightSong &song) { - if (song.parent != nullptr && !song.parent->IsRoot()) { + if (song.directory != nullptr) { client_printf(client, "%s%s/%s\n", SONG_FILE, - song.parent->GetPath(), song.uri); + song.directory, song.uri); } else song_print_uri(client, song.uri); } @@ -56,7 +58,7 @@ song_print_uri(Client &client, const DetachedSong &song) } void -song_print_info(Client &client, const Song &song) +song_print_info(Client &client, const LightSong &song) { song_print_uri(client, song); @@ -74,7 +76,7 @@ song_print_info(Client &client, const Song &song) if (song.mtime > 0) time_print(client, "Last-Modified", song.mtime); - tag_print(client, song.tag); + tag_print(client, *song.tag); } void |