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

int mpd_recv_song_id ( struct mpd_connection connection  ) 

Returns the id of the new song in the playlist. To be called after mpd_send_add_id().

Returns:
the new song id, -1 on error or if MPD did not send an id

Definition at line 181 of file queue.c.

References mpd_recv_pair_named(), mpd_recv_song_id(), mpd_return_pair(), and mpd_pair::value.

Referenced by mpd_recv_song_id(), mpd_run_add_id(), and mpd_run_add_id_to().

{
      struct mpd_pair *pair;
      int id = -1;

      pair = mpd_recv_pair_named(connection, "Id");
      if (pair != NULL) {
            id = atoi(pair->value);
            mpd_return_pair(connection, pair);
      }

      return id;
}


Generated by  Doxygen 1.6.0   Back to index