From 14504012203c64939ab0a8cd75f3daef5b0edcca Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 28 Oct 2020 21:48:01 +0100 Subject: [PATCH] LibraryPage: add subclass of TagListPage We'll move some code from ArtistBrowserPage there, so TagListPage can call into ArtistBrowserPage. --- src/LibraryPage.cxx | 13 +++++++++++-- src/TagListPage.hxx | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/LibraryPage.cxx b/src/LibraryPage.cxx index 855a130d..1f6b4a6a 100644 --- a/src/LibraryPage.cxx +++ b/src/LibraryPage.cxx @@ -107,9 +107,18 @@ SongListPage::Update(struct mpdclient &c, unsigned events) noexcept } } +class LibraryTagListPage final : public TagListPage { +public: + LibraryTagListPage(ScreenManager &_screen, Page *_parent, + const enum mpd_tag_type _tag, + const char *_all_text, + WINDOW *_w, Size size) noexcept + :TagListPage(_screen, _parent, _tag, _all_text, _w, size) {} +}; + class ArtistBrowserPage final : public ProxyPage { - std::list tag_list_pages; - std::list::iterator current_tag_list_page; + std::list tag_list_pages; + std::list::iterator current_tag_list_page; SongListPage song_list_page; diff --git a/src/TagListPage.hxx b/src/TagListPage.hxx index ab85a9b0..90f01e6d 100644 --- a/src/TagListPage.hxx +++ b/src/TagListPage.hxx @@ -30,7 +30,7 @@ class ScreenManager; -class TagListPage final : public ListPage, ListRenderer, ListText { +class TagListPage : public ListPage, ListRenderer, ListText { ScreenManager &screen; Page *const parent;