comparison src/audacious/effect.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 f1c756f39e6c
children b0f4ab42dd3b
comparison
equal deleted inserted replaced
3436:a630ecae6708 3437:3092a8b3fe34
74 "XMMS Multiple Effects Support", 74 "XMMS Multiple Effects Support",
75 NULL, 75 NULL,
76 NULL, 76 NULL,
77 NULL, 77 NULL,
78 NULL, 78 NULL,
79 TRUE,
79 effect_do_mod_samples, 80 effect_do_mod_samples,
80 effect_do_query_format 81 effect_do_query_format
81 }; 82 };
82 83
83 /* get_current_effect_plugin() and effects_enabled() are still to be used by 84 /* get_current_effect_plugin() and effects_enabled() are still to be used by
135 EffectPlugin *ep; 136 EffectPlugin *ep;
136 137
137 if (!node || !(node->data)) 138 if (!node || !(node->data))
138 return; 139 return;
139 ep = node->data; 140 ep = node->data;
140 141 ep->enabled = enable;
141 if (enable && !g_list_find(ep_data.enabled_list, ep)) { 142
143 if (enable && !ep->enabled) {
142 ep_data.enabled_list = g_list_append(ep_data.enabled_list, ep); 144 ep_data.enabled_list = g_list_append(ep_data.enabled_list, ep);
143 if (ep->init) 145 if (ep->init)
144 ep->init(); 146 ep->init();
145 } 147 }
146 else if (!enable && g_list_find(ep_data.enabled_list, ep)) { 148 else if (!enable && ep->enabled) {
147 ep_data.enabled_list = g_list_remove(ep_data.enabled_list, ep); 149 ep_data.enabled_list = g_list_remove(ep_data.enabled_list, ep);
148 if (ep->cleanup) 150 if (ep->cleanup)
149 ep->cleanup(); 151 ep->cleanup();
150 } 152 }
151 } 153 }
205 base = 207 base =
206 g_path_get_basename((char *) ((EffectPlugin *) node-> 208 g_path_get_basename((char *) ((EffectPlugin *) node->
207 data)->filename); 209 data)->filename);
208 if (!strcmp(plugins[i], base)) { 210 if (!strcmp(plugins[i], base)) {
209 ep = node->data; 211 ep = node->data;
212 ep->enabled = TRUE;
210 ep_data.enabled_list = 213 ep_data.enabled_list =
211 g_list_append(ep_data.enabled_list, ep); 214 g_list_append(ep_data.enabled_list, ep);
212 if (ep->init) 215 if (ep->init)
213 ep->init(); 216 ep->init();
214 } 217 }