Mercurial > audlegacy-plugins
diff src/scrobbler/plugin.c @ 1027:ef86db6345e4 trunk
[svn] - some more work here
author | nenolod |
---|---|
date | Fri, 11 May 2007 22:52:07 -0700 |
parents | ff0487e9d00d |
children | 2649ba83333b |
line wrap: on
line diff
--- 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)))