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

bool mpd_count_db_songs ( struct mpd_connection connection  ) 

Gathers statistics on a set of songs in the database. Constraints may be specified with mpd_search_add_tag_constraint(). Send the command with mpd_search_commit(), and read the response with mpd_recv_stats().

connection the connection to MPD
true on success, false on error

Definition at line 129 of file search.c.

References mpd_connection::error, mpd_count_db_songs(), MPD_ERROR_OOM, MPD_ERROR_STATE, and mpd_connection::request.

Referenced by mpd_count_db_songs().

      assert(connection != NULL);

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

      if (connection->request) {
            mpd_error_code(&connection->error, MPD_ERROR_STATE);
                          "search already in progress");
            return false;

      connection->request = strdup("count");
      if (connection->request == NULL) {
            mpd_error_code(&connection->error, MPD_ERROR_OOM);
            return false;

      return true;

Generated by  Doxygen 1.6.0   Back to index