Advertisement
freestyler7

test3.c

Sep 7th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <mpd/client.h>
  3.  
  4. int main(void) {
  5.  
  6.     struct mpd_connection *mpd;
  7.     struct mpd_song *song;
  8.  
  9.     mpd = mpd_connection_new("127.0.0.1", 6600, 0);
  10.     if (mpd_connection_get_error(mpd) != MPD_ERROR_SUCCESS)
  11.         return 1;
  12.  
  13.     if ((song = mpd_run_current_song(mpd)) == NULL)
  14.         return 1;
  15.  
  16.     puts(mpd_song_get_uri(song));
  17.  
  18.     mpd_song_free(song);
  19.     mpd_connection_free(mpd);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement