summaryrefslogtreecommitdiff
path: root/src/playlist.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2014-11-06 23:22:55 +0100
committerAndrzej Rybczak <electricityispower@gmail.com>2014-11-07 12:59:00 +0100
commit6a5f46a4589ddbe43ba00feeb95f10f8b467dbe2 (patch)
tree8d4859116ba0b503e28d6251b76600f0243b6cdc /src/playlist.cpp
parent7c71df8dc7e64a27a310d7929e9c6b0db831cec0 (diff)
actions: make find forward/backward incremental
Diffstat (limited to 'src/playlist.cpp')
-rw-r--r--src/playlist.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/playlist.cpp b/src/playlist.cpp
index 9204e30c..bdb99ea4 100644
--- a/src/playlist.cpp
+++ b/src/playlist.cpp
@@ -155,30 +155,21 @@ bool Playlist::allowsSearching()
return true;
}
-bool Playlist::setSearchConstraint(const std::string &constraint)
+void Playlist::setSearchConstraint(const std::string &constraint)
{
- if (constraint.empty())
- {
- m_search_predicate.clear();
- return false;
- }
- else
- {
- m_search_predicate = RegexFilter<MPD::Song>(
- boost::regex(constraint, Config.regex_type), playlistEntryMatcher
- );
- return true;
- }
+ m_search_predicate = RegexFilter<MPD::Song>(
+ boost::regex(constraint, Config.regex_type), playlistEntryMatcher
+ );
}
-void Playlist::findForward(bool wrap)
+void Playlist::clearConstraint()
{
- searchForward(w, m_search_predicate, wrap);
+ m_search_predicate.clear();
}
-void Playlist::findBackward(bool wrap)
+bool Playlist::find(SearchDirection direction, bool wrap, bool skip_current)
{
- searchBackward(w, m_search_predicate, wrap);
+ return search(w, m_search_predicate, direction, wrap, skip_current);
}
/***********************************************************************/