annotate src/audacious/effect.c @ 4784:68f38592d757

pre-codechange indentation
author mf0102 <0102@gmx.at>
date Mon, 29 Sep 2008 20:45:37 +0200
parents aa79a84627b9
children
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
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2365
diff changeset
13 * the Free Software Foundation; under version 3 of the License.
2313
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
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2365
diff changeset
21 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
22 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
23 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
24 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 #include "effect.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 #include "plugin.h"
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
32 #include "pluginenum.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 EffectPluginData ep_data = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 NULL,
2365
cfc8431aceb5 [svn] cleanups in many regards
mf0102
parents: 2313
diff changeset
36 NULL
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38
3486
96baf555b449 Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents: 3455
diff changeset
39 gint
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 effect_do_mod_samples(gpointer * data, gint length,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 AFormat fmt, gint srate, gint nch)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43 GList *l = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45 while (l) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 if (l->data) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 EffectPlugin *ep = l->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 if (ep->mod_samples)
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
49 {
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
50 plugin_set_current((Plugin *)ep);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51 length = ep->mod_samples(data, length, fmt, srate, nch);
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
52 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 l = g_list_next(l);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 return length;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59
3486
96baf555b449 Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents: 3455
diff changeset
60 void
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 effect_do_query_format(AFormat * fmt, gint * rate, gint * nch)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63 GList *l = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
65 while (l) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 if (l->data) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 EffectPlugin *ep = l->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 if (ep->query_format)
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
69 {
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
70 plugin_set_current((Plugin *)ep);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 ep->query_format(fmt, rate, nch);
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
72 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
73 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 l = g_list_next(l);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
77
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 get_effect_enabled_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 return ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
83
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85 enable_effect_plugin(int i, gboolean enable)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
87 GList *node = g_list_nth(ep_data.effect_list, i);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 EffectPlugin *ep;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 if (!node || !(node->data))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 ep = node->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
94 if (enable && !ep->enabled) {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
95 ep_data.enabled_list = g_list_append(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 if (ep->init)
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
97 {
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
98 plugin_set_current((Plugin *)ep);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
99 ep->init();
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
100 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 }
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
102 else if (!enable && ep->enabled) {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103 ep_data.enabled_list = g_list_remove(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 if (ep->cleanup)
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
105 {
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
106 plugin_set_current((Plugin *)ep);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
107 ep->cleanup();
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
108 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109 }
3675
65b9207fb7b2 Make effect plugins work again.
William Pitcock <nenolod@atheme.org>
parents: 3556
diff changeset
110
65b9207fb7b2 Make effect plugins work again.
William Pitcock <nenolod@atheme.org>
parents: 3556
diff changeset
111 ep->enabled = enable;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114 GList *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 get_effect_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 return ep_data.effect_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
119
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 gchar *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121 effect_stringify_enabled_list(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
123 gchar *enalist = NULL, *temp, *temp2;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 GList *node = ep_data.enabled_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
126 if (g_list_length(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 enalist =
4779
aa79a84627b9 g_basename is deprecated, replace with g_path_get_basename.
Tony Vroon <chainsaw@gentoo.org>
parents: 4266
diff changeset
128 g_path_get_basename(((EffectPlugin *) node->data)->filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130 while (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
131 temp = enalist;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 temp2 =
4779
aa79a84627b9 g_basename is deprecated, replace with g_path_get_basename.
Tony Vroon <chainsaw@gentoo.org>
parents: 4266
diff changeset
133 g_path_get_basename(((EffectPlugin *) node->data)->filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 enalist = g_strconcat(temp, ",", temp2, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
135 g_free(temp);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 g_free(temp2);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 return enalist;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
143 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 effect_enable_from_stringified_list(const gchar * list)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 gchar **plugins, *base;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
147 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 gint i;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 EffectPlugin *ep;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 if (!list || !strcmp(list, ""))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 plugins = g_strsplit(list, ",", 0);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154 for (i = 0; plugins[i]; i++) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
155 node = ep_data.effect_list;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 while (node) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157 base =
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 g_path_get_basename((char *) ((EffectPlugin *) node->
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
159 data)->filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 if (!strcmp(plugins[i], base)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 ep = node->data;
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
162 ep->enabled = TRUE;
2313
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 g_list_append(ep_data.enabled_list, ep);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 if (ep->init)
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
166 {
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
167 plugin_set_current((Plugin *)ep);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 ep->init();
4266
2b7a74fce100 Implemented support for multiple subplugins inside a plugin (see bug #148) and PluginHeader finalization
stefano@zanga
parents: 3675
diff changeset
169 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
171 g_free(base);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 node = node->next;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 g_strfreev(plugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 }
3555
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
177
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
178 void
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
179 effect_flow(FlowContext *context)
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
180 {
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
181 AFormat new_format;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
182 gint new_rate;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
183 gint new_nch;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
184
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
185 new_format = context->fmt;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
186 new_rate = context->srate;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
187 new_nch = context->channels;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
188
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
189 effect_do_query_format(&new_format, &new_rate, &new_nch);
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
190
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
191 if (new_format != context->fmt ||
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
192 new_rate != context->srate ||
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
193 new_nch != context->channels)
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
194 {
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
195 /*
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
196 * The effect plugin changes the stream format. Reopen the
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
197 * audio device.
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
198 */
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
199 if (!output_open_audio(new_format, new_rate, new_nch))
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
200 return;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
201
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
202 context->fmt = new_format;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
203 context->srate = new_rate;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
204 context->channels = new_nch;
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
205 }
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
206
3556
23fcb140ee13 use ->len, not ->length.
William Pitcock <nenolod@atheme.org>
parents: 3555
diff changeset
207 context->len = effect_do_mod_samples(&context->data, context->len,
3555
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
208 context->fmt, context->srate, context->channels);
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
209 }
a73951b8cd9f effect processing -> flow manager API / attached to postproc_flow.
William Pitcock <nenolod@atheme.org>
parents: 3486
diff changeset
210