changeset 15:b88a5f934224

preliminary support for purple_util_set_current_song()
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Thu, 02 Oct 2008 17:12:04 +0900
parents 89bd98990fff
children 9e37b72309d4
files pidgin-audacious.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-audacious.c	Sun Sep 28 00:58:59 2008 +0900
+++ b/pidgin-audacious.c	Thu Oct 02 17:12:04 2008 +0900
@@ -121,6 +121,22 @@
     aud_process(song);
     g_free(song);
     song = NULL;
+
+    /* preliminary support for purple_util_set_current_song() */
+    gchar *artist = NULL, *title = NULL, *album = NULL;
+
+    artist = audacious_get_tuple_field_data(session, "artist", playpos);
+    title = audacious_get_tuple_field_data(session, "title", playpos);
+    album = audacious_get_tuple_field_data(session, "album", playpos);
+
+    purple_util_set_current_song(title ? title : "",
+                                 artist ? artist : "",
+                                 album ? album : "");
+
+    g_free(artist);
+    g_free(title);
+    g_free(album);
+
     return rv;
 }