changeset 2623:0ad10a95ed10 trunk

[svn] - plugin reloading.
author nenolod
date Thu, 15 Mar 2007 19:25:27 -0700
parents 06e4bbdb6c45
children 840fb578a834
files ChangeLog src/audacious/build_stamp.c src/audacious/glade/prefswin.glade src/audacious/pluginenum.c src/audacious/ui_preferences.c src/audacious/vfs.c
diffstat 6 files changed, 137 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Mar 15 18:44:52 2007 -0700
+++ b/ChangeLog	Thu Mar 15 19:25:27 2007 -0700
@@ -1,3 +1,11 @@
+2007-03-16 01:44:52 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [4256]
+  - due to some bug in buffer management, bump the buffer side of things up to ~40kb instead of 32kb for now.
+  
+  trunk/src/audacious/vfs_buffered_file.c |    4 ++--
+  1 file changed, 2 insertions(+), 2 deletions(-)
+
+
 2007-03-13 20:32:56 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4254]
   - add Doxygen files
--- a/src/audacious/build_stamp.c	Thu Mar 15 18:44:52 2007 -0700
+++ b/src/audacious/build_stamp.c	Thu Mar 15 19:25:27 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070313-4254";
+const gchar *svn_stamp = "20070316-4256";
--- a/src/audacious/glade/prefswin.glade	Thu Mar 15 18:44:52 2007 -0700
+++ b/src/audacious/glade/prefswin.glade	Thu Mar 15 19:25:27 2007 -0700
@@ -4541,7 +4541,82 @@
 	    <widget class="GtkHButtonBox" id="prefswin_button_box">
 	      <property name="visible">True</property>
 	      <property name="layout_style">GTK_BUTTONBOX_END</property>
-	      <property name="spacing">0</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkButton" id="reload_plugins">
+		  <property name="visible">True</property>
+		  <property name="can_default">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <signal name="clicked" handler="on_reload_plugins_clicked" last_modification_time="Fri, 16 Mar 2007 02:06:25 GMT"/>
+
+		  <child>
+		    <widget class="GtkAlignment" id="alignment93">
+		      <property name="visible">True</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xscale">0</property>
+		      <property name="yscale">0</property>
+		      <property name="top_padding">0</property>
+		      <property name="bottom_padding">0</property>
+		      <property name="left_padding">0</property>
+		      <property name="right_padding">0</property>
+
+		      <child>
+			<widget class="GtkHBox" id="hbox11">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">2</property>
+
+			  <child>
+			    <widget class="GtkImage" id="image10">
+			      <property name="visible">True</property>
+			      <property name="stock">gtk-refresh</property>
+			      <property name="icon_size">4</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkLabel" id="label102">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Reload Plugins</property>
+			      <property name="use_underline">True</property>
+			      <property name="use_markup">False</property>
+			      <property name="justify">GTK_JUSTIFY_LEFT</property>
+			      <property name="wrap">False</property>
+			      <property name="selectable">False</property>
+			      <property name="xalign">0.5</property>
+			      <property name="yalign">0.5</property>
+			      <property name="xpad">0</property>
+			      <property name="ypad">0</property>
+			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			      <property name="width_chars">-1</property>
+			      <property name="single_line_mode">False</property>
+			      <property name="angle">0</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
 
 	      <child>
 		<widget class="GtkButton" id="close">
@@ -4552,7 +4627,7 @@
 		  <property name="use_stock">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
 		  <property name="focus_on_click">True</property>
-		  <signal name="clicked" handler="gtk_widget_hide" object="prefswin"/>
+		  <signal name="clicked" handler="gtk_widget_hide" object="prefswin" last_modification_time="Fri, 16 Mar 2007 02:05:32 GMT"/>
 		</widget>
 	      </child>
 	    </widget>
--- a/src/audacious/pluginenum.c	Thu Mar 15 18:44:52 2007 -0700
+++ b/src/audacious/pluginenum.c	Thu Mar 15 19:25:27 2007 -0700
@@ -58,6 +58,8 @@
 GHashTable *plugin_matrix = NULL;
 GList *lowlevel_list = NULL;
 
+extern GList *vfs_transports;
+
 static gint
 inputlist_compare_func(gconstpointer a, gconstpointer b)
 {
@@ -219,6 +221,8 @@
     if (plugin_is_duplicate(filename))
         return;
 
+    g_message("Loaded plugin (%s)", filename);
+
     if (!(module = g_module_open(filename, G_MODULE_BIND_LOCAL))) {
         printf("Failed to load plugin (%s): %s\n", 
                   filename, g_module_error());
@@ -397,6 +401,9 @@
         ip_data.stop = FALSE;
     }
 
+    /* FIXME: race condition -nenolod */
+    op_data.current_output_plugin = NULL;
+
     for (node = get_input_list(); node; node = g_list_next(node)) {
         ip = INPUT_PLUGIN(node->data);
         if (ip && ip->cleanup) {
@@ -408,8 +415,11 @@
         g_module_close(ip->handle);
     }
 
-    if (ip_data.input_list)
+    if (ip_data.input_list != NULL)
+    {
         g_list_free(ip_data.input_list);
+        ip_data.input_list = NULL;
+    }
 
     for (node = get_output_list(); node; node = g_list_next(node)) {
         op = OUTPUT_PLUGIN(node->data);
@@ -422,8 +432,11 @@
         g_module_close(op->handle);
     }
     
-    if (op_data.output_list)
+    if (op_data.output_list != NULL)
+    {
         g_list_free(op_data.output_list);
+        op_data.output_list = NULL;
+    }
 
     for (node = get_effect_list(); node; node = g_list_next(node)) {
         ep = EFFECT_PLUGIN(node->data);
@@ -436,23 +449,12 @@
         g_module_close(ep->handle);
     }
 
-    if (ep_data.effect_list)
+    if (ep_data.effect_list != NULL)
+    {
         g_list_free(ep_data.effect_list);
-
-#if 0
-    for (node = get_general_enabled_list(); node; node = g_list_next(node)) {
-        gp = GENERAL_PLUGIN(node->data);
-        enable_general_plugin(g_list_index(gp_data.general_list, gp), FALSE);
+        ep_data.effect_list = NULL;
     }
 
-    if (gp_data.enabled_list)
-        g_list_free(gp_data.enabled_list);
-
-    GDK_THREADS_LEAVE();
-    while (g_main_context_iteration(NULL, FALSE));
-    GDK_THREADS_ENTER();
-#endif
-
     for (node = get_general_list(); node; node = g_list_next(node)) {
         gp = GENERAL_PLUGIN(node->data);
         if (gp && gp->cleanup) {
@@ -464,23 +466,12 @@
         g_module_close(gp->handle);
     }
 
-    if (gp_data.general_list)
+    if (gp_data.general_list != NULL)
+    {
         g_list_free(gp_data.general_list);
-
-#if 0
-    for (node = get_vis_enabled_list(); node; node = g_list_next(node)) {
-        vp = VIS_PLUGIN(node->data);
-        enable_vis_plugin(g_list_index(vp_data.vis_list, vp), FALSE);
+        gp_data.general_list = NULL;
     }
 
-    if (vp_data.enabled_list)
-        g_list_free(vp_data.enabled_list);
-
-    GDK_THREADS_LEAVE();
-    while (g_main_context_iteration(NULL, FALSE));
-    GDK_THREADS_ENTER();
-#endif
-
     for (node = get_vis_list(); node; node = g_list_next(node)) {
         vp = VIS_PLUGIN(node->data);
         if (vp && vp->cleanup) {
@@ -492,8 +483,11 @@
         g_module_close(vp->handle);
     }
 
-    if (vp_data.vis_list)
+    if (vp_data.vis_list != NULL)
+    {
         g_list_free(vp_data.vis_list);
+        vp_data.vis_list = NULL;
+    }
 
     for (node = lowlevel_list; node; node = g_list_next(node)) {
         lp = LOWLEVEL_PLUGIN(node->data);
@@ -506,6 +500,16 @@
         g_module_close(lp->handle);
     }
 
-    if (lowlevel_list)
+    if (lowlevel_list != NULL)
+    {
         g_list_free(lowlevel_list);
+        lowlevel_list = NULL;
+    }
+
+    /* XXX: vfs will crash otherwise. -nenolod */
+    if (vfs_transports != NULL)
+    {
+        g_list_free(vfs_transports);
+        vfs_transports = NULL;
+    }
 }
--- a/src/audacious/ui_preferences.c	Thu Mar 15 18:44:52 2007 -0700
+++ b/src/audacious/ui_preferences.c	Thu Mar 15 19:25:27 2007 -0700
@@ -2327,7 +2327,18 @@
     gtk_window_set_decorated(GTK_WINDOW(mainwin), cfg.show_wm_decorations);
     gtk_window_set_decorated(GTK_WINDOW(playlistwin), cfg.show_wm_decorations);
     gtk_window_set_decorated(GTK_WINDOW(equalizerwin), cfg.show_wm_decorations);
-
+}
+
+static void
+on_reload_plugins_clicked(GtkButton * button, gpointer data)
+{
+    /* TBD: should every playlist entry have to be reprobed?
+     * Pointers could come back stale if new plugins are added or
+     * symbol sizes change.                       - nenolod
+     */
+
+    plugin_system_cleanup();
+    plugin_system_init();
 }
 
 /* FIXME: complete the map */
@@ -2432,6 +2443,8 @@
     FUNC_MAP_ENTRY(on_green_scale_value_changed)
     FUNC_MAP_ENTRY(on_blue_scale_value_changed)
     FUNC_MAP_ENTRY(on_colorize_close_clicked)
+
+    FUNC_MAP_ENTRY(on_reload_plugins_clicked)
 FUNC_MAP_END
 
 void
--- a/src/audacious/vfs.c	Thu Mar 15 18:44:52 2007 -0700
+++ b/src/audacious/vfs.c	Thu Mar 15 19:25:27 2007 -0700
@@ -27,7 +27,7 @@
 
 #include "urldecode.h"
 
-static GList *vfs_transports = NULL;
+GList *vfs_transports = NULL; /* temporary. -nenolod */
 
 #ifdef VFS_DEBUG
 # define DBG(x, args...) g_print(x, ## args);