diff src/audacious/visualization.c @ 3437:3092a8b3fe34 trunk

Big plugin system changes (part 1 of who knows, it's still a big mess): - remove plugin_matrix, replacing it with a mowgli.dictionary of all loaded plugins pointing back to their handles - input_is_enabled() craq -> gboolean plugin::enabled (this craq was pointed out by ccr) - consolidate a lot of crap in ui_preferences.c (a LOT more to come) - introduce probably countless loads of bugs and SIGSEGVs. - you WILL need to recompile plugins after this, and some which do not use C99-style struct initialisers will likely fail to build.
author William Pitcock <nenolod@atheme.org>
date Fri, 07 Sep 2007 03:20:28 -0500
parents f02623377013
children b0f4ab42dd3b
line wrap: on
line diff
--- a/src/audacious/visualization.c	Fri Sep 07 02:02:53 2007 -0500
+++ b/src/audacious/visualization.c	Fri Sep 07 03:20:28 2007 -0500
@@ -124,20 +124,22 @@
         return;
     vp = node->data;
 
-    if (enable && !g_list_find(vp_data.enabled_list, vp)) {
+    if (enable && !vp->enabled) {
         vp_data.enabled_list = g_list_append(vp_data.enabled_list, vp);
         if (vp->init)
             vp->init();
         if (playback_get_playing() && vp->playback_start)
             vp->playback_start();
     }
-    else if (!enable && g_list_find(vp_data.enabled_list, vp)) {
+    else if (!enable && vp->enabled) {
         vp_data.enabled_list = g_list_remove(vp_data.enabled_list, vp);
         if (playback_get_playing() && vp->playback_stop)
             vp->playback_stop();
         if (vp->cleanup)
             vp->cleanup();
     }
+
+    vp->enabled = enable;
 }
 
 gboolean
@@ -189,6 +191,7 @@
                     vp->init();
                 if (playback_get_playing() && vp->playback_start)
                     vp->playback_start();
+                vp->enabled = TRUE;
             }
             g_free(base);
         }