implement HasSongs interface

This commit is contained in:
Andrzej Rybczak
2012-09-02 13:47:57 +02:00
parent ad8fef343f
commit 6f59a175ec
37 changed files with 840 additions and 705 deletions

View File

@@ -35,12 +35,8 @@ void ServerInfo::Init()
SetDimensions();
w = new Scrollpad((COLS-itsWidth)/2, (MainHeight-itsHeight)/2+MainStartY, itsWidth, itsHeight, "MPD server info", Config.main_color, Config.window_border);
Mpd.GetURLHandlers([this](std::string &&handler) {
itsURLHandlers.push_back(handler);
});
Mpd.GetTagTypes([this](std::string &&tag_type) {
itsTagTypes.push_back(tag_type);
});
itsURLHandlers = Mpd.GetURLHandlers();
itsTagTypes = Mpd.GetTagTypes();
isInitialized = 1;
}
@@ -119,11 +115,11 @@ void ServerInfo::Update()
*w << fmtBold << U("Last DB update: ") << fmtBoldEnd << Timestamp(Mpd.DBUpdateTime()) << '\n';
*w << '\n';
*w << fmtBold << U("URL Handlers:") << fmtBoldEnd;
for (MPD::TagList::const_iterator it = itsURLHandlers.begin(); it != itsURLHandlers.end(); ++it)
for (auto it = itsURLHandlers.begin(); it != itsURLHandlers.end(); ++it)
*w << (it != itsURLHandlers.begin() ? U(", ") : U(" ")) << *it;
*w << U("\n\n");
*w << fmtBold << U("Tag Types:") << fmtBoldEnd;
for (MPD::TagList::const_iterator it = itsTagTypes.begin(); it != itsTagTypes.end(); ++it)
for (auto it = itsTagTypes.begin(); it != itsTagTypes.end(); ++it)
*w << (it != itsTagTypes.begin() ? U(", ") : U(" ")) << *it;
w->Flush();