actions: make find forward/backward incremental

This commit is contained in:
Andrzej Rybczak
2014-11-06 23:22:55 +01:00
parent 7c71df8dc7
commit 6a5f46a458
21 changed files with 236 additions and 229 deletions

View File

@@ -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);
}
/***********************************************************************/