summaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2012-09-02 20:51:20 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2012-09-02 20:51:20 +0200
commit5e8d1673e014e5d9af4c5538ae938d7c414a2ed3 (patch)
tree389d567eaa8a5e60a45b18048c6de1b5547ae914 /src/browser.cpp
parent0cfe5d8f01cae20ea0751f28bf16c8a6ff818fc2 (diff)
implement ProxySongList for handling general operations on lists
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index 57224466..f17a5364 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -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());