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

bool mpd_command_list_begin ( struct mpd_connection connection,
bool  discrete_ok 

Starts a command list, i.e. a group of pipelined commands which are transferred in one block. If one command fails, the rest of the command list is canceled.

Note that there is no guarantee on atomicity.

connection the connection to MPD
discrete_ok tells MPD whether to acknowledge every list command with an "list_OK" response
true on success

Definition at line 41 of file list.c.

References mpd_connection::command_list_remaining, mpd_connection::discrete_finished, mpd_connection::error, mpd_command_list_begin(), MPD_ERROR_STATE, mpd_connection::sending_command_list, and mpd_connection::sending_command_list_ok.

Referenced by mpd_command_list_begin().

      bool success;

      assert(connection != NULL);

      if (connection->sending_command_list) {
            mpd_error_code(&connection->error, MPD_ERROR_STATE);
                          "already in command list mode");
            return false;

      success = mpd_send_command2(connection,
                            ? "command_list_ok_begin"
                            : "command_list_begin");
      if (!success)
            return false;

      connection->sending_command_list = true;
      connection->sending_command_list_ok = discrete_ok;
      connection->command_list_remaining = 0;
      connection->discrete_finished = false;

      return true;

Generated by  Doxygen 1.6.0   Back to index