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

mpd_sentinel bool mpd_send_command ( struct mpd_connection connection,
const char *  command,
  ... 
)

Sends a command with arguments to the MPD server. The argument list must be terminated with a NULL.

Parameters:
connection the connection to the MPD server
command the command to be sent
Returns:
true on success

Definition at line 68 of file send.c.

References mpd_connection::async, mpd_connection::command_list_remaining, mpd_send_command(), mpd_connection::receiving, mpd_connection::sending_command_list, and mpd_connection::sending_command_list_ok.

Referenced by mpd_command_list_end(), mpd_search_commit(), mpd_send_add(), mpd_send_add_id(), mpd_send_allowed_commands(), mpd_send_clear(), mpd_send_command(), mpd_send_current_song(), mpd_send_disallowed_commands(), mpd_send_idle(), mpd_send_idle_mask(), mpd_send_list_all(), mpd_send_list_all_meta(), mpd_send_list_meta(), mpd_send_list_playlist(), mpd_send_list_playlist_meta(), mpd_send_list_queue_meta(), mpd_send_list_tag_types(), mpd_send_list_url_schemes(), mpd_send_noidle(), mpd_send_outputs(), mpd_send_password(), mpd_send_play(), mpd_send_rescan(), mpd_send_shuffle(), mpd_send_stats(), mpd_send_status(), mpd_send_sticker_delete(), mpd_send_sticker_find(), mpd_send_sticker_get(), mpd_send_sticker_list(), mpd_send_sticker_set(), mpd_send_toggle_pause(), and mpd_send_update().

{
      va_list ap;
      bool success;

      if (!send_check(connection))
            return false;

      va_start(ap, command);

      success = mpd_sync_send_command_v(connection->async,
                                mpd_connection_timeout(connection),
                                command, ap);

      va_end(ap);

      if (!success) {
            mpd_connection_sync_error(connection);
            return false;
      }

      if (!connection->sending_command_list) {
            /* the caller might expect that we have flushed the
               output buffer when this function returns */
            if (!mpd_flush(connection))
                  return false;

            connection->receiving = true;
      } else if (connection->sending_command_list_ok)
            ++connection->command_list_remaining;

      return true;
}


Generated by  Doxygen 1.6.0   Back to index