searchable: retrieve currently applied search constraint

This commit is contained in:
Andrzej Rybczak
2016-11-11 20:26:42 +01:00
parent cbba364685
commit 60e66b47b6
19 changed files with 168 additions and 84 deletions

View File

@@ -153,21 +153,27 @@ bool Playlist::allowsSearching()
return true;
}
const std::string &Playlist::searchConstraint()
{
return m_search_predicate.constraint();
}
void Playlist::setSearchConstraint(const std::string &constraint)
{
m_search_predicate = Regex::Filter<MPD::Song>(
Regex::make(constraint, Config.regex_type), playlistEntryMatcher
);
constraint,
Config.regex_type,
playlistEntryMatcher);
}
void Playlist::clearConstraint()
void Playlist::clearSearchConstraint()
{
m_search_predicate.clear();
}
bool Playlist::find(SearchDirection direction, bool wrap, bool skip_current)
bool Playlist::search(SearchDirection direction, bool wrap, bool skip_current)
{
return search(w, m_search_predicate, direction, wrap, skip_current);
return ::search(w, m_search_predicate, direction, wrap, skip_current);
}
/***********************************************************************/