implement ProxySongList for handling general operations on lists

This commit is contained in:
Andrzej Rybczak
2012-09-02 20:51:20 +02:00
parent 0cfe5d8f01
commit 5e8d1673e0
22 changed files with 297 additions and 220 deletions

View File

@@ -318,6 +318,16 @@ void Playlist::prevFound(bool wrap)
/***********************************************************************/
std::shared_ptr<ProxySongList> Playlist::getProxySongList()
{
auto ptr = nullProxySongList();
if (w == Items)
ptr = mkProxySongList(*Items, [](NC::Menu<MPD::Song>::Item &item) {
return &item.value();
});
return ptr;
}
MPD::Song *Playlist::getSong(size_t pos)
{
MPD::Song *ptr = 0;
@@ -339,11 +349,6 @@ bool Playlist::allowsSelection()
return w == Items;
}
void Playlist::removeSelection()
{
removeSelectionHelper(Items->Begin(), Items->End());
}
void Playlist::reverseSelection()
{
reverseSelectionHelper(Items->Begin(), Items->End());