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

int mpd_run_add_id_to ( struct mpd_connection connection,
const char *  uri,
unsigned  to 

Executes the "addid" command and reads the response.

connection the connection to MPD
uri the URI of the song to be added
to the desired position of the song
the new song id, -1 on error or if MPD did not send an id

Definition at line 213 of file queue.c.

References mpd_recv_song_id(), mpd_response_finish(), mpd_run_add_id_to(), and mpd_send_add_id_to().

Referenced by mpd_run_add_id_to().

      int id;

      if (!mpd_run_check(connection) ||
          !mpd_send_add_id_to(connection, uri, to))
            return -1;

      id = mpd_recv_song_id(connection);

      if (!mpd_response_finish(connection))
            id = -1;

      return id;

Generated by  Doxygen 1.6.0   Back to index