changeset 2060:0803fba87da8

hook shit
author William Pitcock <nenolod@atheme.org>
date Sun, 14 Oct 2007 03:14:20 -0500
parents 70b1f1fc4804
children 2f62797aba22
files src/aosd/aosd_trigger.c src/dockalbumart/dockalbumart.c src/scrobbler/plugin.c src/song_change/song_change.c src/statusicon/si_ui.c
diffstat 5 files changed, 43 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/src/aosd/aosd_trigger.c	Sat Oct 13 23:48:00 2007 -0500
+++ b/src/aosd/aosd_trigger.c	Sun Oct 14 03:14:20 2007 -0500
@@ -169,9 +169,9 @@
 aosd_trigger_func_pb_start_onoff ( gboolean turn_on )
 {
   if ( turn_on == TRUE )
-    hook_associate( "playback begin" , aosd_trigger_func_pb_start_cb , NULL );
+    aud_hook_associate( "playback begin" , aosd_trigger_func_pb_start_cb , NULL );
   else
-    hook_dissociate( "playback begin" , aosd_trigger_func_pb_start_cb );
+    aud_hook_dissociate( "playback begin" , aosd_trigger_func_pb_start_cb );
   return;
 }
 
@@ -228,11 +228,11 @@
     prevs = g_malloc0(sizeof(aosd_pb_titlechange_prevs_t));
     prevs->title = NULL;
     prevs->filename = NULL;
-    hook_associate( "playlist set info" , aosd_trigger_func_pb_titlechange_cb , prevs );
+    aud_hook_associate( "playlist set info" , aosd_trigger_func_pb_titlechange_cb , prevs );
   }
   else
   {
-    hook_dissociate( "playlist set info" , aosd_trigger_func_pb_titlechange_cb );
+    aud_hook_dissociate( "playlist set info" , aosd_trigger_func_pb_titlechange_cb );
     if ( prevs != NULL )
     {
       if ( prevs->title != NULL ) g_free( prevs->title );
@@ -301,9 +301,9 @@
 aosd_trigger_func_vol_change_onoff ( gboolean turn_on )
 {
   if ( turn_on == TRUE )
-    hook_associate( "volume set" , aosd_trigger_func_vol_change_cb , NULL );
+    aud_hook_associate( "volume set" , aosd_trigger_func_vol_change_cb , NULL );
   else
-    hook_dissociate( "volume set" , aosd_trigger_func_vol_change_cb );
+    aud_hook_dissociate( "volume set" , aosd_trigger_func_vol_change_cb );
   return;
 }
 
@@ -358,9 +358,9 @@
 aosd_trigger_func_pb_pauseon_onoff ( gboolean turn_on )
 {
   if ( turn_on == TRUE )
-    hook_associate( "playback pause" , aosd_trigger_func_pb_pauseon_cb , NULL );
+    aud_hook_associate( "playback pause" , aosd_trigger_func_pb_pauseon_cb , NULL );
   else
-    hook_dissociate( "playback pause" , aosd_trigger_func_pb_pauseon_cb );
+    aud_hook_dissociate( "playback pause" , aosd_trigger_func_pb_pauseon_cb );
   return;
 }
 
@@ -379,9 +379,9 @@
 aosd_trigger_func_pb_pauseoff_onoff ( gboolean turn_on )
 {
   if ( turn_on == TRUE )
-    hook_associate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb , NULL );
+    aud_hook_associate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb , NULL );
   else
-    hook_dissociate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb );
+    aud_hook_dissociate( "playback unpause" , aosd_trigger_func_pb_pauseoff_cb );
   return;
 }
 
--- a/src/dockalbumart/dockalbumart.c	Sat Oct 13 23:48:00 2007 -0500
+++ b/src/dockalbumart/dockalbumart.c	Sun Oct 14 03:14:20 2007 -0500
@@ -136,8 +136,8 @@
 static void
 dockart_init(void)
 {
-    hook_associate("playback begin", dockart_trigger_func_pb_start_cb, NULL);
-    hook_associate("playback end", dockart_trigger_func_pb_end_cb, NULL);
+    aud_hook_associate("playback begin", dockart_trigger_func_pb_start_cb, NULL);
+    aud_hook_associate("playback end", dockart_trigger_func_pb_end_cb, NULL);
 }
 
 static void
@@ -145,8 +145,8 @@
 {
     GdkPixbuf *new;
 
-    hook_dissociate("playback begin", dockart_trigger_func_pb_start_cb);
-    hook_dissociate("playback end", dockart_trigger_func_pb_end_cb);
+    aud_hook_dissociate("playback begin", dockart_trigger_func_pb_start_cb);
+    aud_hook_dissociate("playback end", dockart_trigger_func_pb_end_cb);
 
     /* reset dock tile */
     new = gdk_pixbuf_new_from_xpm_data((const gchar **) audacious_player_xpm);
--- a/src/scrobbler/plugin.c	Sat Oct 13 23:48:00 2007 -0500
+++ b/src/scrobbler/plugin.c	Sun Oct 14 03:14:20 2007 -0500
@@ -68,9 +68,9 @@
 	return aud_str_has_prefix_nocase(a, "http://") || aud_str_has_prefix_nocase(a, "https://");
 }
 
-static void hook_playback_begin(gpointer hook_data, gpointer user_data)
+static void aud_hook_playback_begin(gpointer aud_hook_data, gpointer user_data)
 {
-	PlaylistEntry *entry = (PlaylistEntry *) hook_data;
+	PlaylistEntry *entry = (PlaylistEntry *) aud_hook_data;
 
 	g_return_if_fail(entry != NULL);
 
@@ -165,7 +165,7 @@
 		return;
 	}
 
-	hook_associate("playback begin", hook_playback_begin, NULL);
+	aud_hook_associate("playback begin", aud_hook_playback_begin, NULL);
 
 	pdebug("plugin started", DEBUG);
 }
@@ -204,7 +204,7 @@
 	sc_cleaner();
 	gerpok_sc_cleaner();
 
-	hook_dissociate("playback begin", hook_playback_begin);
+	aud_hook_dissociate("playback begin", aud_hook_playback_begin);
 }
 
 static void *xs_thread(void *data __attribute__((unused)))
--- a/src/song_change/song_change.c	Sat Oct 13 23:48:00 2007 -0500
+++ b/src/song_change/song_change.c	Sun Oct 14 03:14:20 2007 -0500
@@ -183,10 +183,10 @@
 
 static void cleanup(void)
 {
-	hook_dissociate("playback begin", songchange_playback_begin);
-	hook_dissociate("playback end", songchange_playback_end);
-	hook_dissociate("playlist end reached", songchange_playlist_eof);
-      hook_dissociate( "playlist set info" , songchange_playback_ttc);
+	aud_hook_dissociate("playback begin", songchange_playback_begin);
+	aud_hook_dissociate("playback end", songchange_playback_end);
+	aud_hook_dissociate("playlist end reached", songchange_playlist_eof);
+      aud_hook_dissociate( "playlist set info" , songchange_playback_ttc);
 
 	if ( ttc_prevs != NULL )
 	{
@@ -452,14 +452,14 @@
 	configure_vbox = configure();
 	prefswin_page_new(configure_vbox, "Song Change", DATA_DIR "/images/plugins.png");
 
-	hook_associate("playback begin", songchange_playback_begin, NULL);
-	hook_associate("playback end", songchange_playback_end, NULL);
-	hook_associate("playlist end reached", songchange_playlist_eof, NULL);
+	aud_hook_associate("playback begin", songchange_playback_begin, NULL);
+	aud_hook_associate("playback end", songchange_playback_end, NULL);
+	aud_hook_associate("playlist end reached", songchange_playlist_eof, NULL);
 
 	ttc_prevs = g_malloc0(sizeof(songchange_playback_ttc_prevs_t));
 	ttc_prevs->title = NULL;
 	ttc_prevs->filename = NULL;
-	hook_associate( "playlist set info" , songchange_playback_ttc , ttc_prevs );
+	aud_hook_associate( "playlist set info" , songchange_playback_ttc , ttc_prevs );
 
 	configure_ok_cb(NULL, NULL);
 }
--- a/src/statusicon/si_ui.c	Sat Oct 13 23:48:00 2007 -0500
+++ b/src/statusicon/si_ui.c	Sun Oct 14 03:14:20 2007 -0500
@@ -51,7 +51,7 @@
   gchar *filename;
   gpointer evbox;
 }
-si_hook_tchange_prevs_t;
+si_aud_hook_tchange_prevs_t;
 
 
 static AudGtkTrayIcon *
@@ -204,7 +204,7 @@
 
 
 static void
-si_ui_statusicon_cb_hook_pbstart ( gpointer plentry_gp , gpointer evbox )
+si_ui_statusicon_cb_aud_hook_pbstart ( gpointer plentry_gp , gpointer evbox )
 {
   if ( ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) &&
        ( plentry_gp != NULL ) )
@@ -216,9 +216,9 @@
 
 
 static void
-si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp )
+si_ui_statusicon_cb_aud_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp )
 {
-  si_hook_tchange_prevs_t *prevs = prevs_gp;
+  si_aud_hook_tchange_prevs_t *prevs = prevs_gp;
   PlaylistEntry *pl_entry = plentry_gp;
   gboolean upd_pop = FALSE;
 
@@ -464,7 +464,7 @@
 si_ui_statusicon_enable ( gboolean enable )
 {
   static GtkWidget *si_evbox = NULL;
-  static si_hook_tchange_prevs_t *si_hook_tchange_prevs = NULL;
+  static si_aud_hook_tchange_prevs_t *si_aud_hook_tchange_prevs = NULL;
 
   if (( enable == TRUE ) && ( si_evbox == NULL ))
   {
@@ -522,12 +522,12 @@
     si_smenu = si_ui_statusicon_smallmenu_create();
     g_object_set_data( G_OBJECT(si_evbox) , "smenu" , si_smenu );
 
-    hook_associate( "playback begin" , si_ui_statusicon_cb_hook_pbstart , si_evbox );
-    si_hook_tchange_prevs = g_malloc0(sizeof(si_hook_tchange_prevs_t));
-    si_hook_tchange_prevs->title = NULL;
-    si_hook_tchange_prevs->filename = NULL;
-    si_hook_tchange_prevs->evbox = si_evbox;
-    hook_associate( "playlist set info" , si_ui_statusicon_cb_hook_tchange , si_hook_tchange_prevs );
+    aud_hook_associate( "playback begin" , si_ui_statusicon_cb_aud_hook_pbstart , si_evbox );
+    si_aud_hook_tchange_prevs = g_malloc0(sizeof(si_aud_hook_tchange_prevs_t));
+    si_aud_hook_tchange_prevs->title = NULL;
+    si_aud_hook_tchange_prevs->filename = NULL;
+    si_aud_hook_tchange_prevs->evbox = si_evbox;
+    aud_hook_associate( "playlist set info" , si_ui_statusicon_cb_aud_hook_tchange , si_aud_hook_tchange_prevs );
 
     return;
   }
@@ -541,12 +541,12 @@
       gtk_widget_destroy( GTK_WIDGET(si_evbox) );
       gtk_widget_destroy( GTK_WIDGET(si_applet) );
       gtk_widget_destroy( GTK_WIDGET(si_smenu) );
-      hook_dissociate( "playback begin" , si_ui_statusicon_cb_hook_pbstart );
-      hook_dissociate( "playlist set info" , si_ui_statusicon_cb_hook_tchange );
-      if ( si_hook_tchange_prevs->title != NULL ) g_free( si_hook_tchange_prevs->title );
-      if ( si_hook_tchange_prevs->filename != NULL ) g_free( si_hook_tchange_prevs->filename );
-      g_free( si_hook_tchange_prevs );
-      si_hook_tchange_prevs = NULL;
+      aud_hook_dissociate( "playback begin" , si_ui_statusicon_cb_aud_hook_pbstart );
+      aud_hook_dissociate( "playlist set info" , si_ui_statusicon_cb_aud_hook_tchange );
+      if ( si_aud_hook_tchange_prevs->title != NULL ) g_free( si_aud_hook_tchange_prevs->title );
+      if ( si_aud_hook_tchange_prevs->filename != NULL ) g_free( si_aud_hook_tchange_prevs->filename );
+      g_free( si_aud_hook_tchange_prevs );
+      si_aud_hook_tchange_prevs = NULL;
       si_smenu = NULL;
       si_evbox = NULL;
     }