Skip to content

Commit

Permalink
LibraryPage: add subclass of TagListPage
Browse files Browse the repository at this point in the history
We'll move some code from ArtistBrowserPage there, so TagListPage can
call into ArtistBrowserPage.
  • Loading branch information
MaxKellermann committed Oct 28, 2020
1 parent b3138a6 commit 1450401
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/LibraryPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<TagListPage> tag_list_pages;
std::list<TagListPage>::iterator current_tag_list_page;
std::list<LibraryTagListPage> tag_list_pages;
std::list<LibraryTagListPage>::iterator current_tag_list_page;

SongListPage song_list_page;

Expand Down
2 changes: 1 addition & 1 deletion src/TagListPage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class ScreenManager;

class TagListPage final : public ListPage, ListRenderer, ListText {
class TagListPage : public ListPage, ListRenderer, ListText {
ScreenManager &screen;
Page *const parent;

Expand Down

0 comments on commit 1450401

Please sign in to comment.