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

@@ -301,6 +301,16 @@ void Browser::prevFound(bool wrap)
/***********************************************************************/
std::shared_ptr<ProxySongList> Browser::getProxySongList()
{
return mkProxySongList(*w, [](NC::Menu<MPD::Item>::Item &item) {
MPD::Song *ptr = 0;
if (item.value().type == itSong)
ptr = item.value().song.get();
return ptr;
});
}
MPD::Song *Browser::getSong(size_t pos)
{
MPD::Song *ptr = 0;
@@ -322,11 +332,6 @@ bool Browser::allowsSelection()
return true;
}
void Browser::removeSelection()
{
removeSelectionHelper(w->Begin(), w->End());
}
void Browser::reverseSelection()
{
reverseSelectionHelper(w->Begin()+(itsBrowsedDir == "/" ? 0 : 1), w->End());