Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

bool mpd_search_commit ( struct mpd_connection connection  ) 

Starts the real search with constraints added with mpd_search_add_constraint().

Parameters:
connection the connection to MPD
Returns:
true on success, false on error

Definition at line 266 of file search.c.

References mpd_connection::error, MPD_ERROR_STATE, mpd_search_cancel(), mpd_search_commit(), mpd_send_command(), and mpd_connection::request.

Referenced by mpd_search_commit().

{
      bool success;

      assert(connection != NULL);

      if (mpd_error_is_defined(&connection->error)) {
            mpd_search_cancel(connection);
            return false;
      }

      if (connection->request == NULL) {
            mpd_error_code(&connection->error, MPD_ERROR_STATE);
            mpd_error_message(&connection->error,
                          "no search in progress");
            return false;
      }

      success = mpd_send_command(connection, connection->request, NULL);
      free(connection->request);
      connection->request = NULL;

      return success;
}


Generated by  Doxygen 1.6.0   Back to index