static void add_constraint(struct mpd_connection *conn, const struct constraint *constraint) { if (constraint->type == (enum mpd_tag_type)SEARCH_TAG_ANY) mpd_search_add_any_tag_constraint(conn, MPD_OPERATOR_DEFAULT, charset_to_utf8(constraint->query)); else if (constraint->type == (enum mpd_tag_type)SEARCH_TAG_URI) mpd_search_add_uri_constraint(conn, MPD_OPERATOR_DEFAULT, charset_to_utf8(constraint->query)); #if LIBMPDCLIENT_CHECK_VERSION(2,9,0) else if (constraint->type == (enum mpd_tag_type)SEARCH_TAG_BASE) mpd_search_add_base_constraint(conn, MPD_OPERATOR_DEFAULT, charset_to_utf8(constraint->query)); #endif else mpd_search_add_tag_constraint(conn, MPD_OPERATOR_DEFAULT, constraint->type, charset_to_utf8(constraint->query)); }
void Connection::AddSearchURI(const std::string &str) const { checkConnection(); mpd_search_add_uri_constraint(m_connection.get(), MPD_OPERATOR_DEFAULT, str.c_str()); }