aboutsummaryrefslogtreecommitdiffstats
path: root/src/DatabaseHelpers.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-19 10:51:34 +0100
committerMax Kellermann <max@duempel.org>2014-01-19 17:04:51 +0100
commitf5ae1ce00b85699291a7cdf9782574e70a8c28f5 (patch)
tree9cb95dd1d98b1b0cd522ee27d7e8a374a3c8eb4a /src/DatabaseHelpers.cxx
parent738d6f10409037fbf8aa30cec5aceb121e21e230 (diff)
downloadmpd-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/DatabaseHelpers.cxx')
-rw-r--r--src/DatabaseHelpers.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DatabaseHelpers.cxx b/src/DatabaseHelpers.cxx
index e7bd006f0..58e7aaa3b 100644
--- a/src/DatabaseHelpers.cxx
+++ b/src/DatabaseHelpers.cxx
@@ -19,7 +19,7 @@
#include "DatabaseHelpers.hxx"
#include "DatabasePlugin.hxx"
-#include "Song.hxx"
+#include "LightSong.hxx"
#include "tag/Tag.hxx"
#include <functional>
@@ -37,9 +37,9 @@ struct StringLess {
typedef std::set<const char *, StringLess> StringSet;
static bool
-CollectTags(StringSet &set, TagType tag_type, Song &song)
+CollectTags(StringSet &set, TagType tag_type, const LightSong &song)
{
- const Tag *tag = &song.tag;
+ const Tag *tag = song.tag;
bool found = false;
for (unsigned i = 0; i < tag->num_items; ++i) {
@@ -102,11 +102,11 @@ StatsVisitTag(DatabaseStats &stats, StringSet &artists, StringSet &albums,
static bool
StatsVisitSong(DatabaseStats &stats, StringSet &artists, StringSet &albums,
- Song &song)
+ const LightSong &song)
{
++stats.song_count;
- StatsVisitTag(stats, artists, albums, song.tag);
+ StatsVisitTag(stats, artists, albums, *song.tag);
return true;
}