comparison 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
comparison
equal deleted inserted replaced
3436:a630ecae6708 3437:3092a8b3fe34
122 122
123 if (!node || !(node->data)) 123 if (!node || !(node->data))
124 return; 124 return;
125 vp = node->data; 125 vp = node->data;
126 126
127 if (enable && !g_list_find(vp_data.enabled_list, vp)) { 127 if (enable && !vp->enabled) {
128 vp_data.enabled_list = g_list_append(vp_data.enabled_list, vp); 128 vp_data.enabled_list = g_list_append(vp_data.enabled_list, vp);
129 if (vp->init) 129 if (vp->init)
130 vp->init(); 130 vp->init();
131 if (playback_get_playing() && vp->playback_start) 131 if (playback_get_playing() && vp->playback_start)
132 vp->playback_start(); 132 vp->playback_start();
133 } 133 }
134 else if (!enable && g_list_find(vp_data.enabled_list, vp)) { 134 else if (!enable && vp->enabled) {
135 vp_data.enabled_list = g_list_remove(vp_data.enabled_list, vp); 135 vp_data.enabled_list = g_list_remove(vp_data.enabled_list, vp);
136 if (playback_get_playing() && vp->playback_stop) 136 if (playback_get_playing() && vp->playback_stop)
137 vp->playback_stop(); 137 vp->playback_stop();
138 if (vp->cleanup) 138 if (vp->cleanup)
139 vp->cleanup(); 139 vp->cleanup();
140 } 140 }
141
142 vp->enabled = enable;
141 } 143 }
142 144
143 gboolean 145 gboolean
144 vis_enabled(gint i) 146 vis_enabled(gint i)
145 { 147 {
187 g_list_append(vp_data.enabled_list, vp); 189 g_list_append(vp_data.enabled_list, vp);
188 if (vp->init) 190 if (vp->init)
189 vp->init(); 191 vp->init();
190 if (playback_get_playing() && vp->playback_start) 192 if (playback_get_playing() && vp->playback_start)
191 vp->playback_start(); 193 vp->playback_start();
194 vp->enabled = TRUE;
192 } 195 }
193 g_free(base); 196 g_free(base);
194 } 197 }
195 } 198 }
196 g_strfreev(plugins); 199 g_strfreev(plugins);