changeset 1027:ef86db6345e4 trunk

[svn] - some more work here
author nenolod
date Fri, 11 May 2007 22:52:07 -0700
parents ff0487e9d00d
children b5de3b4129a6
files ChangeLog src/scrobbler/plugin.c
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 11 22:49:11 2007 -0700
+++ b/ChangeLog	Fri May 11 22:52:07 2007 -0700
@@ -1,3 +1,12 @@
+2007-05-12 05:49:11 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [2216]
+  - first attempt at implementing AudioScrobbler 1.2 protocol
+  
+  trunk/src/scrobbler/plugin.c    |  331 +++++-----------------------------------
+  trunk/src/scrobbler/scrobbler.c |    4 
+  2 files changed, 50 insertions(+), 285 deletions(-)
+
+
 2007-05-12 03:59:58 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [2214]
   - make scrobbler work again.
--- a/src/scrobbler/plugin.c	Fri May 11 22:49:11 2007 -0700
+++ b/src/scrobbler/plugin.c	Fri May 11 22:52:07 2007 -0700
@@ -11,7 +11,7 @@
 #include <audacious/ui_preferences.h>
 #include <audacious/playlist.h>
 #include <audacious/configdb.h>
-#include <audacious/beepctrl.h>
+#include <audacious/hook.h>
 #include <audacious/strings.h>
 #include <audacious/main.h>
 
@@ -72,8 +72,10 @@
 	return str_has_prefix_nocase(a, "http://") || str_has_prefix_nocase(a, "https://");
 }
 
-static void hook_playback_begin(PlaylistEntry *entry)
+static void hook_playback_begin(gpointer hook_data, gpointer user_data)
 {
+	PlaylistEntry *entry = (PlaylistEntry *) hook_data;
+
 	g_return_if_fail(entry != NULL);
 
 	if (entry->length < 30)
@@ -167,6 +169,8 @@
 		return;
 	}
 
+	hook_associate("playback begin", hook_playback_begin, NULL);
+
 	pdebug("plugin started", DEBUG);
 }
 
@@ -206,6 +210,8 @@
 
 	sc_cleaner();
 	gerpok_sc_cleaner();
+
+	hook_dissociate("playback begin", hook_playback_begin);
 }
 
 static void *xs_thread(void *data __attribute__((unused)))