annotate src/audacious/effect.c @ 2313:3149d4b1a9a9 trunk

[svn] - objective-make autodepend fixes - move all sourcecode into src/ and adjust Makefiles accordingly
author nenolod
date Fri, 12 Jan 2007 11:43:40 -0800
parents
children cfc8431aceb5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Audacious - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 * Copyright (C) 2005-2007 Audacious dvelopment team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 * Copyright (C) 2003-2004 BMP development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 * Copyright (C) 1998-2003 XMMS development team.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 * the Free Software Foundation; under version 2 of the License.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
23 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25 #include "effect.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #include "plugin.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 EffectPluginData ep_data = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 FALSE,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 FALSE
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 effect_do_mod_samples(gpointer * data, gint length,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 AFormat fmt, gint srate, gint nch)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 GList *l = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 while (l) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 if (l->data) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 EffectPlugin *ep = l->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 if (ep->mod_samples)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 length = ep->mod_samples(data, length, fmt, srate, nch);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 l = g_list_next(l);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
52
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 return length;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 effect_do_query_format(AFormat * fmt, gint * rate, gint * nch)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 GList *l = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 while (l) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 if (l->data) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 EffectPlugin *ep = l->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 if (ep->query_format)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 ep->query_format(fmt, rate, nch);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 l = g_list_next(l);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 static EffectPlugin pseudo_effect_plugin = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 "XMMS Multiple Effects Support",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 NULL,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 effect_do_mod_samples,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 effect_do_query_format
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83 /* get_current_effect_plugin() and effects_enabled() are still to be used by
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 * output plugins as they were when we only supported one effects plugin at
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85 * a time. We now had a pseudo-effects-plugin that chains all the enabled
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 * plugins. -- Jakdaw */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
87
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 EffectPlugin *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89 get_current_effect_plugin(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91 return &pseudo_effect_plugin;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94 gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 effects_enabled(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97 return TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
98 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 get_effect_enabled_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103 return ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107 effect_about(int i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109 EffectPlugin *effect;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110 GList *node = g_list_nth(ep_data.effect_list, i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
111 if (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 effect = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113 if (effect && effect->about)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114 effect->about();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119 effect_configure(int i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 GList *node = g_list_nth(ep_data.effect_list, i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 EffectPlugin *effect;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 if (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 effect = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125 if (effect && effect->configure)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 effect->configure();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 enable_effect_plugin(int i, gboolean enable)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 GList *node = g_list_nth(ep_data.effect_list, i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 EffectPlugin *ep;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 if (!node || !(node->data))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 ep = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 if (enable && !g_list_find(ep_data.enabled_list, ep)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142 ep_data.enabled_list = g_list_append(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 if (ep->init)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 ep->init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 else if (!enable && g_list_find(ep_data.enabled_list, ep)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 ep_data.enabled_list = g_list_remove(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 if (ep->cleanup)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 ep->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 get_effect_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 return ep_data.effect_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159 gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 effect_enabled(int i)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 return (g_list_find
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 (ep_data.enabled_list,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 (EffectPlugin *) g_list_nth(ep_data.effect_list,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 i)->data) ? TRUE : FALSE);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
166 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
167
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 gchar *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
169 effect_stringify_enabled_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 gchar *enalist = NULL, *temp, *temp2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 GList *node = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 if (g_list_length(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 enalist =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 g_strdup(g_basename(((EffectPlugin *) node->data)->filename));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178 while (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
179 temp = enalist;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 temp2 =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181 g_strdup(g_basename(((EffectPlugin *) node->data)->filename));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 enalist = g_strconcat(temp, ",", temp2, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
183 g_free(temp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 g_free(temp2);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 return enalist;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192 effect_enable_from_stringified_list(const gchar * list)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
193 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 gchar **plugins, *base;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
195 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
196 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
197 EffectPlugin *ep;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
198
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
199 if (!list || !strcmp(list, ""))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
200 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
201 plugins = g_strsplit(list, ",", 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
202 for (i = 0; plugins[i]; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
203 node = ep_data.effect_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
204 while (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
205 base =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
206 g_path_get_basename((char *) ((EffectPlugin *) node->
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
207 data)->filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
208 if (!strcmp(plugins[i], base)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
209 ep = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
210 ep_data.enabled_list =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
211 g_list_append(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
212 if (ep->init)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
213 ep->init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
214 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
215 g_free(base);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
216 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
217 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
218 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
219 g_strfreev(plugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
220 }