1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 |
#include <gst/gst.h>
...
typedef struct {
gfloat freq;
gfloat width;
gfloat gain;
} GstEqualizerBandState;
...
GstElement *equalizer;
GstObject *band;
gint i;
GstEqualizerBandState state[] = {
{ 120.0, 50.0, - 3.0},
{ 500.0, 20.0, 12.0},
{1503.0, 2.0, -20.0},
{6000.0, 1000.0, 6.0},
{3000.0, 120.0, 2.0}
};
...
equalizer = gst_element_factory_make ("equalizer-nbands", "equalizer");
g_object_set (G_OBJECT (equalizer), "num-bands", 5, NULL);
...
for (i = 0; i < 5; i++) {
band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
g_object_set (G_OBJECT (band), "freq", state[i].freq,
"bandwidth", state[i].width,
"gain", state[i].gain);
g_object_unref (G_OBJECT (band));
}
... |