~ubuntu-branches/ubuntu/trusty/lmms/trusty

« back to all changes in this revision

Viewing changes to plugins/ladspa_effect/swh/triple_para_1204.c

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
#include <string.h>
 
3
#ifndef WIN32
 
4
#include "config.h"
 
5
#endif
 
6
 
 
7
#ifdef ENABLE_NLS
 
8
#include <libintl.h>
 
9
#endif
 
10
 
 
11
#define         _ISOC9X_SOURCE  1
 
12
#define         _ISOC99_SOURCE  1
 
13
#define         __USE_ISOC99    1
 
14
#define         __USE_ISOC9X    1
 
15
 
 
16
#include <math.h>
 
17
 
 
18
#include "ladspa.h"
 
19
 
 
20
#ifdef WIN32
 
21
#define _WINDOWS_DLL_EXPORT_ __declspec(dllexport)
 
22
int bIsFirstTime = 1; 
 
23
void _init(); // forward declaration
 
24
#else
 
25
#define _WINDOWS_DLL_EXPORT_ 
 
26
#endif
 
27
 
 
28
#line 10 "triple_para_1204.xml"
 
29
 
 
30
#include "util/biquad.h"
 
31
 
 
32
#define TRIPLEPARA_GAIN_L              0
 
33
#define TRIPLEPARA_FC_L                1
 
34
#define TRIPLEPARA_BW_L                2
 
35
#define TRIPLEPARA_GAIN_1              3
 
36
#define TRIPLEPARA_FC_1                4
 
37
#define TRIPLEPARA_BW_1                5
 
38
#define TRIPLEPARA_GAIN_2              6
 
39
#define TRIPLEPARA_FC_2                7
 
40
#define TRIPLEPARA_BW_2                8
 
41
#define TRIPLEPARA_GAIN_3              9
 
42
#define TRIPLEPARA_FC_3                10
 
43
#define TRIPLEPARA_BW_3                11
 
44
#define TRIPLEPARA_GAIN_H              12
 
45
#define TRIPLEPARA_FC_H                13
 
46
#define TRIPLEPARA_BW_H                14
 
47
#define TRIPLEPARA_INPUT               15
 
48
#define TRIPLEPARA_OUTPUT              16
 
49
 
 
50
static LADSPA_Descriptor *tripleParaDescriptor = NULL;
 
51
 
 
52
typedef struct {
 
53
        LADSPA_Data *gain_L;
 
54
        LADSPA_Data *fc_L;
 
55
        LADSPA_Data *bw_L;
 
56
        LADSPA_Data *gain_1;
 
57
        LADSPA_Data *fc_1;
 
58
        LADSPA_Data *bw_1;
 
59
        LADSPA_Data *gain_2;
 
60
        LADSPA_Data *fc_2;
 
61
        LADSPA_Data *bw_2;
 
62
        LADSPA_Data *gain_3;
 
63
        LADSPA_Data *fc_3;
 
64
        LADSPA_Data *bw_3;
 
65
        LADSPA_Data *gain_H;
 
66
        LADSPA_Data *fc_H;
 
67
        LADSPA_Data *bw_H;
 
68
        LADSPA_Data *input;
 
69
        LADSPA_Data *output;
 
70
        biquad *     filters;
 
71
        float        fs;
 
72
        LADSPA_Data run_adding_gain;
 
73
} TriplePara;
 
74
 
 
75
_WINDOWS_DLL_EXPORT_
 
76
const LADSPA_Descriptor *ladspa_descriptor(unsigned long index) {
 
77
 
 
78
#ifdef WIN32
 
79
        if (bIsFirstTime) {
 
80
                _init();
 
81
                bIsFirstTime = 0;
 
82
        }
 
83
#endif
 
84
        switch (index) {
 
85
        case 0:
 
86
                return tripleParaDescriptor;
 
87
        default:
 
88
                return NULL;
 
89
        }
 
90
}
 
91
 
 
92
static void activateTriplePara(LADSPA_Handle instance) {
 
93
        TriplePara *plugin_data = (TriplePara *)instance;
 
94
        biquad *filters = plugin_data->filters;
 
95
        float fs = plugin_data->fs;
 
96
#line 32 "triple_para_1204.xml"
 
97
        biquad_init(&filters[0]);
 
98
        biquad_init(&filters[1]);
 
99
        biquad_init(&filters[2]);
 
100
        biquad_init(&filters[3]);
 
101
        biquad_init(&filters[4]);
 
102
        plugin_data->filters = filters;
 
103
        plugin_data->fs = fs;
 
104
 
 
105
}
 
106
 
 
107
static void cleanupTriplePara(LADSPA_Handle instance) {
 
108
#line 68 "triple_para_1204.xml"
 
109
        TriplePara *plugin_data = (TriplePara *)instance;
 
110
        free(plugin_data->filters);
 
111
        free(instance);
 
112
}
 
113
 
 
114
static void connectPortTriplePara(
 
115
 LADSPA_Handle instance,
 
116
 unsigned long port,
 
117
 LADSPA_Data *data) {
 
118
        TriplePara *plugin;
 
119
 
 
120
        plugin = (TriplePara *)instance;
 
121
        switch (port) {
 
122
        case TRIPLEPARA_GAIN_L:
 
123
                plugin->gain_L = data;
 
124
                break;
 
125
        case TRIPLEPARA_FC_L:
 
126
                plugin->fc_L = data;
 
127
                break;
 
128
        case TRIPLEPARA_BW_L:
 
129
                plugin->bw_L = data;
 
130
                break;
 
131
        case TRIPLEPARA_GAIN_1:
 
132
                plugin->gain_1 = data;
 
133
                break;
 
134
        case TRIPLEPARA_FC_1:
 
135
                plugin->fc_1 = data;
 
136
                break;
 
137
        case TRIPLEPARA_BW_1:
 
138
                plugin->bw_1 = data;
 
139
                break;
 
140
        case TRIPLEPARA_GAIN_2:
 
141
                plugin->gain_2 = data;
 
142
                break;
 
143
        case TRIPLEPARA_FC_2:
 
144
                plugin->fc_2 = data;
 
145
                break;
 
146
        case TRIPLEPARA_BW_2:
 
147
                plugin->bw_2 = data;
 
148
                break;
 
149
        case TRIPLEPARA_GAIN_3:
 
150
                plugin->gain_3 = data;
 
151
                break;
 
152
        case TRIPLEPARA_FC_3:
 
153
                plugin->fc_3 = data;
 
154
                break;
 
155
        case TRIPLEPARA_BW_3:
 
156
                plugin->bw_3 = data;
 
157
                break;
 
158
        case TRIPLEPARA_GAIN_H:
 
159
                plugin->gain_H = data;
 
160
                break;
 
161
        case TRIPLEPARA_FC_H:
 
162
                plugin->fc_H = data;
 
163
                break;
 
164
        case TRIPLEPARA_BW_H:
 
165
                plugin->bw_H = data;
 
166
                break;
 
167
        case TRIPLEPARA_INPUT:
 
168
                plugin->input = data;
 
169
                break;
 
170
        case TRIPLEPARA_OUTPUT:
 
171
                plugin->output = data;
 
172
                break;
 
173
        }
 
174
}
 
175
 
 
176
static LADSPA_Handle instantiateTriplePara(
 
177
 const LADSPA_Descriptor *descriptor,
 
178
 unsigned long s_rate) {
 
179
        TriplePara *plugin_data = (TriplePara *)malloc(sizeof(TriplePara));
 
180
        biquad *filters = NULL;
 
181
        float fs;
 
182
 
 
183
#line 21 "triple_para_1204.xml"
 
184
        fs = s_rate;
 
185
        
 
186
        filters = calloc(5, sizeof(biquad));
 
187
        biquad_init(&filters[0]);
 
188
        biquad_init(&filters[1]);
 
189
        biquad_init(&filters[2]);
 
190
        biquad_init(&filters[3]);
 
191
        biquad_init(&filters[4]);
 
192
 
 
193
        plugin_data->filters = filters;
 
194
        plugin_data->fs = fs;
 
195
 
 
196
        return (LADSPA_Handle)plugin_data;
 
197
}
 
198
 
 
199
#undef buffer_write
 
200
#undef RUN_ADDING
 
201
#undef RUN_REPLACING
 
202
 
 
203
#define buffer_write(b, v) (b = v)
 
204
#define RUN_ADDING    0
 
205
#define RUN_REPLACING 1
 
206
 
 
207
static void runTriplePara(LADSPA_Handle instance, unsigned long sample_count) {
 
208
        TriplePara *plugin_data = (TriplePara *)instance;
 
209
 
 
210
        /* Low-shelving gain (dB) (float value) */
 
211
        const LADSPA_Data gain_L = *(plugin_data->gain_L);
 
212
 
 
213
        /* Low-shelving frequency (Hz) (float value) */
 
214
        const LADSPA_Data fc_L = *(plugin_data->fc_L);
 
215
 
 
216
        /* Low-shelving slope (float value) */
 
217
        const LADSPA_Data bw_L = *(plugin_data->bw_L);
 
218
 
 
219
        /* Band 1 gain (dB) (float value) */
 
220
        const LADSPA_Data gain_1 = *(plugin_data->gain_1);
 
221
 
 
222
        /* Band 1 frequency (Hz) (float value) */
 
223
        const LADSPA_Data fc_1 = *(plugin_data->fc_1);
 
224
 
 
225
        /* Band 1 bandwidth (octaves) (float value) */
 
226
        const LADSPA_Data bw_1 = *(plugin_data->bw_1);
 
227
 
 
228
        /* Band 2 gain (dB) (float value) */
 
229
        const LADSPA_Data gain_2 = *(plugin_data->gain_2);
 
230
 
 
231
        /* Band 2 frequency (Hz) (float value) */
 
232
        const LADSPA_Data fc_2 = *(plugin_data->fc_2);
 
233
 
 
234
        /* Band 2 bandwidth (octaves) (float value) */
 
235
        const LADSPA_Data bw_2 = *(plugin_data->bw_2);
 
236
 
 
237
        /* Band 3 gain (dB) (float value) */
 
238
        const LADSPA_Data gain_3 = *(plugin_data->gain_3);
 
239
 
 
240
        /* Band 3 frequency (Hz) (float value) */
 
241
        const LADSPA_Data fc_3 = *(plugin_data->fc_3);
 
242
 
 
243
        /* Band 3 bandwidth (octaves) (float value) */
 
244
        const LADSPA_Data bw_3 = *(plugin_data->bw_3);
 
245
 
 
246
        /* High-shelving gain (dB) (float value) */
 
247
        const LADSPA_Data gain_H = *(plugin_data->gain_H);
 
248
 
 
249
        /* High-shelving frequency (Hz) (float value) */
 
250
        const LADSPA_Data fc_H = *(plugin_data->fc_H);
 
251
 
 
252
        /* High-shelving slope (float value) */
 
253
        const LADSPA_Data bw_H = *(plugin_data->bw_H);
 
254
 
 
255
        /* Input (array of floats of length sample_count) */
 
256
        const LADSPA_Data * const input = plugin_data->input;
 
257
 
 
258
        /* Output (array of floats of length sample_count) */
 
259
        LADSPA_Data * const output = plugin_data->output;
 
260
        biquad * filters = plugin_data->filters;
 
261
        float fs = plugin_data->fs;
 
262
 
 
263
#line 40 "triple_para_1204.xml"
 
264
        unsigned long pos;
 
265
        float in;
 
266
        
 
267
        ls_set_params(&filters[0], fc_L, gain_L, bw_L, fs);
 
268
        eq_set_params(&filters[1], fc_1, gain_1, bw_1, fs);
 
269
        eq_set_params(&filters[2], fc_2, gain_2, bw_2, fs);
 
270
        eq_set_params(&filters[3], fc_3, gain_3, bw_3, fs);
 
271
        hs_set_params(&filters[4], fc_H, gain_H, bw_H, fs);
 
272
        
 
273
        for (pos = 0; pos < sample_count; pos++) {
 
274
                in = biquad_run(&filters[0], input[pos]);
 
275
                in = biquad_run(&filters[1], in);
 
276
                in = biquad_run(&filters[2], in);
 
277
                in = biquad_run(&filters[3], in);
 
278
                in = biquad_run(&filters[4], in);
 
279
                buffer_write(output[pos], in);
 
280
        }
 
281
}
 
282
#undef buffer_write
 
283
#undef RUN_ADDING
 
284
#undef RUN_REPLACING
 
285
 
 
286
#define buffer_write(b, v) (b += (v) * run_adding_gain)
 
287
#define RUN_ADDING    1
 
288
#define RUN_REPLACING 0
 
289
 
 
290
static void setRunAddingGainTriplePara(LADSPA_Handle instance, LADSPA_Data gain) {
 
291
        ((TriplePara *)instance)->run_adding_gain = gain;
 
292
}
 
293
 
 
294
static void runAddingTriplePara(LADSPA_Handle instance, unsigned long sample_count) {
 
295
        TriplePara *plugin_data = (TriplePara *)instance;
 
296
        LADSPA_Data run_adding_gain = plugin_data->run_adding_gain;
 
297
 
 
298
        /* Low-shelving gain (dB) (float value) */
 
299
        const LADSPA_Data gain_L = *(plugin_data->gain_L);
 
300
 
 
301
        /* Low-shelving frequency (Hz) (float value) */
 
302
        const LADSPA_Data fc_L = *(plugin_data->fc_L);
 
303
 
 
304
        /* Low-shelving slope (float value) */
 
305
        const LADSPA_Data bw_L = *(plugin_data->bw_L);
 
306
 
 
307
        /* Band 1 gain (dB) (float value) */
 
308
        const LADSPA_Data gain_1 = *(plugin_data->gain_1);
 
309
 
 
310
        /* Band 1 frequency (Hz) (float value) */
 
311
        const LADSPA_Data fc_1 = *(plugin_data->fc_1);
 
312
 
 
313
        /* Band 1 bandwidth (octaves) (float value) */
 
314
        const LADSPA_Data bw_1 = *(plugin_data->bw_1);
 
315
 
 
316
        /* Band 2 gain (dB) (float value) */
 
317
        const LADSPA_Data gain_2 = *(plugin_data->gain_2);
 
318
 
 
319
        /* Band 2 frequency (Hz) (float value) */
 
320
        const LADSPA_Data fc_2 = *(plugin_data->fc_2);
 
321
 
 
322
        /* Band 2 bandwidth (octaves) (float value) */
 
323
        const LADSPA_Data bw_2 = *(plugin_data->bw_2);
 
324
 
 
325
        /* Band 3 gain (dB) (float value) */
 
326
        const LADSPA_Data gain_3 = *(plugin_data->gain_3);
 
327
 
 
328
        /* Band 3 frequency (Hz) (float value) */
 
329
        const LADSPA_Data fc_3 = *(plugin_data->fc_3);
 
330
 
 
331
        /* Band 3 bandwidth (octaves) (float value) */
 
332
        const LADSPA_Data bw_3 = *(plugin_data->bw_3);
 
333
 
 
334
        /* High-shelving gain (dB) (float value) */
 
335
        const LADSPA_Data gain_H = *(plugin_data->gain_H);
 
336
 
 
337
        /* High-shelving frequency (Hz) (float value) */
 
338
        const LADSPA_Data fc_H = *(plugin_data->fc_H);
 
339
 
 
340
        /* High-shelving slope (float value) */
 
341
        const LADSPA_Data bw_H = *(plugin_data->bw_H);
 
342
 
 
343
        /* Input (array of floats of length sample_count) */
 
344
        const LADSPA_Data * const input = plugin_data->input;
 
345
 
 
346
        /* Output (array of floats of length sample_count) */
 
347
        LADSPA_Data * const output = plugin_data->output;
 
348
        biquad * filters = plugin_data->filters;
 
349
        float fs = plugin_data->fs;
 
350
 
 
351
#line 40 "triple_para_1204.xml"
 
352
        unsigned long pos;
 
353
        float in;
 
354
        
 
355
        ls_set_params(&filters[0], fc_L, gain_L, bw_L, fs);
 
356
        eq_set_params(&filters[1], fc_1, gain_1, bw_1, fs);
 
357
        eq_set_params(&filters[2], fc_2, gain_2, bw_2, fs);
 
358
        eq_set_params(&filters[3], fc_3, gain_3, bw_3, fs);
 
359
        hs_set_params(&filters[4], fc_H, gain_H, bw_H, fs);
 
360
        
 
361
        for (pos = 0; pos < sample_count; pos++) {
 
362
                in = biquad_run(&filters[0], input[pos]);
 
363
                in = biquad_run(&filters[1], in);
 
364
                in = biquad_run(&filters[2], in);
 
365
                in = biquad_run(&filters[3], in);
 
366
                in = biquad_run(&filters[4], in);
 
367
                buffer_write(output[pos], in);
 
368
        }
 
369
}
 
370
 
 
371
void _init() {
 
372
        char **port_names;
 
373
        LADSPA_PortDescriptor *port_descriptors;
 
374
        LADSPA_PortRangeHint *port_range_hints;
 
375
 
 
376
#ifdef ENABLE_NLS
 
377
#define D_(s) dgettext(PACKAGE, s)
 
378
        setlocale(LC_ALL, "");
 
379
        bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR);
 
380
#else
 
381
#define D_(s) (s)
 
382
#endif
 
383
 
 
384
 
 
385
        tripleParaDescriptor =
 
386
         (LADSPA_Descriptor *)malloc(sizeof(LADSPA_Descriptor));
 
387
 
 
388
        if (tripleParaDescriptor) {
 
389
                tripleParaDescriptor->UniqueID = 1204;
 
390
                tripleParaDescriptor->Label = "triplePara";
 
391
                tripleParaDescriptor->Properties =
 
392
                 LADSPA_PROPERTY_HARD_RT_CAPABLE;
 
393
                tripleParaDescriptor->Name =
 
394
                 D_("Triple band parametric with shelves");
 
395
                tripleParaDescriptor->Maker =
 
396
                 "Steve Harris <steve@plugin.org.uk>";
 
397
                tripleParaDescriptor->Copyright =
 
398
                 "GPL";
 
399
                tripleParaDescriptor->PortCount = 17;
 
400
 
 
401
                port_descriptors = (LADSPA_PortDescriptor *)calloc(17,
 
402
                 sizeof(LADSPA_PortDescriptor));
 
403
                tripleParaDescriptor->PortDescriptors =
 
404
                 (const LADSPA_PortDescriptor *)port_descriptors;
 
405
 
 
406
                port_range_hints = (LADSPA_PortRangeHint *)calloc(17,
 
407
                 sizeof(LADSPA_PortRangeHint));
 
408
                tripleParaDescriptor->PortRangeHints =
 
409
                 (const LADSPA_PortRangeHint *)port_range_hints;
 
410
 
 
411
                port_names = (char **)calloc(17, sizeof(char*));
 
412
                tripleParaDescriptor->PortNames =
 
413
                 (const char **)port_names;
 
414
 
 
415
                /* Parameters for Low-shelving gain (dB) */
 
416
                port_descriptors[TRIPLEPARA_GAIN_L] =
 
417
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
418
                port_names[TRIPLEPARA_GAIN_L] =
 
419
                 D_("Low-shelving gain (dB)");
 
420
                port_range_hints[TRIPLEPARA_GAIN_L].HintDescriptor =
 
421
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
 
422
                port_range_hints[TRIPLEPARA_GAIN_L].LowerBound = -70;
 
423
                port_range_hints[TRIPLEPARA_GAIN_L].UpperBound = +30;
 
424
 
 
425
                /* Parameters for Low-shelving frequency (Hz) */
 
426
                port_descriptors[TRIPLEPARA_FC_L] =
 
427
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
428
                port_names[TRIPLEPARA_FC_L] =
 
429
                 D_("Low-shelving frequency (Hz)");
 
430
                port_range_hints[TRIPLEPARA_FC_L].HintDescriptor =
 
431
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_SAMPLE_RATE | LADSPA_HINT_DEFAULT_MINIMUM;
 
432
                port_range_hints[TRIPLEPARA_FC_L].LowerBound = 0.0001;
 
433
                port_range_hints[TRIPLEPARA_FC_L].UpperBound = 0.49;
 
434
 
 
435
                /* Parameters for Low-shelving slope */
 
436
                port_descriptors[TRIPLEPARA_BW_L] =
 
437
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
438
                port_names[TRIPLEPARA_BW_L] =
 
439
                 D_("Low-shelving slope");
 
440
                port_range_hints[TRIPLEPARA_BW_L].HintDescriptor =
 
441
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_MIDDLE;
 
442
                port_range_hints[TRIPLEPARA_BW_L].LowerBound = 0;
 
443
                port_range_hints[TRIPLEPARA_BW_L].UpperBound = 1;
 
444
 
 
445
                /* Parameters for Band 1 gain (dB) */
 
446
                port_descriptors[TRIPLEPARA_GAIN_1] =
 
447
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
448
                port_names[TRIPLEPARA_GAIN_1] =
 
449
                 D_("Band 1 gain (dB)");
 
450
                port_range_hints[TRIPLEPARA_GAIN_1].HintDescriptor =
 
451
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
 
452
                port_range_hints[TRIPLEPARA_GAIN_1].LowerBound = -70;
 
453
                port_range_hints[TRIPLEPARA_GAIN_1].UpperBound = +30;
 
454
 
 
455
                /* Parameters for Band 1 frequency (Hz) */
 
456
                port_descriptors[TRIPLEPARA_FC_1] =
 
457
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
458
                port_names[TRIPLEPARA_FC_1] =
 
459
                 D_("Band 1 frequency (Hz)");
 
460
                port_range_hints[TRIPLEPARA_FC_1].HintDescriptor =
 
461
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_SAMPLE_RATE | LADSPA_HINT_DEFAULT_LOW;
 
462
                port_range_hints[TRIPLEPARA_FC_1].LowerBound = 0.0001;
 
463
                port_range_hints[TRIPLEPARA_FC_1].UpperBound = 0.49;
 
464
 
 
465
                /* Parameters for Band 1 bandwidth (octaves) */
 
466
                port_descriptors[TRIPLEPARA_BW_1] =
 
467
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
468
                port_names[TRIPLEPARA_BW_1] =
 
469
                 D_("Band 1 bandwidth (octaves)");
 
470
                port_range_hints[TRIPLEPARA_BW_1].HintDescriptor =
 
471
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_1;
 
472
                port_range_hints[TRIPLEPARA_BW_1].LowerBound = 0;
 
473
                port_range_hints[TRIPLEPARA_BW_1].UpperBound = 4;
 
474
 
 
475
                /* Parameters for Band 2 gain (dB) */
 
476
                port_descriptors[TRIPLEPARA_GAIN_2] =
 
477
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
478
                port_names[TRIPLEPARA_GAIN_2] =
 
479
                 D_("Band 2 gain (dB)");
 
480
                port_range_hints[TRIPLEPARA_GAIN_2].HintDescriptor =
 
481
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
 
482
                port_range_hints[TRIPLEPARA_GAIN_2].LowerBound = -70;
 
483
                port_range_hints[TRIPLEPARA_GAIN_2].UpperBound = +30;
 
484
 
 
485
                /* Parameters for Band 2 frequency (Hz) */
 
486
                port_descriptors[TRIPLEPARA_FC_2] =
 
487
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
488
                port_names[TRIPLEPARA_FC_2] =
 
489
                 D_("Band 2 frequency (Hz)");
 
490
                port_range_hints[TRIPLEPARA_FC_2].HintDescriptor =
 
491
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_SAMPLE_RATE | LADSPA_HINT_DEFAULT_MIDDLE;
 
492
                port_range_hints[TRIPLEPARA_FC_2].LowerBound = 0.0001;
 
493
                port_range_hints[TRIPLEPARA_FC_2].UpperBound = 0.49;
 
494
 
 
495
                /* Parameters for Band 2 bandwidth (octaves) */
 
496
                port_descriptors[TRIPLEPARA_BW_2] =
 
497
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
498
                port_names[TRIPLEPARA_BW_2] =
 
499
                 D_("Band 2 bandwidth (octaves)");
 
500
                port_range_hints[TRIPLEPARA_BW_2].HintDescriptor =
 
501
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_1;
 
502
                port_range_hints[TRIPLEPARA_BW_2].LowerBound = 0;
 
503
                port_range_hints[TRIPLEPARA_BW_2].UpperBound = 4;
 
504
 
 
505
                /* Parameters for Band 3 gain (dB) */
 
506
                port_descriptors[TRIPLEPARA_GAIN_3] =
 
507
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
508
                port_names[TRIPLEPARA_GAIN_3] =
 
509
                 D_("Band 3 gain (dB)");
 
510
                port_range_hints[TRIPLEPARA_GAIN_3].HintDescriptor =
 
511
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
 
512
                port_range_hints[TRIPLEPARA_GAIN_3].LowerBound = -70;
 
513
                port_range_hints[TRIPLEPARA_GAIN_3].UpperBound = +30;
 
514
 
 
515
                /* Parameters for Band 3 frequency (Hz) */
 
516
                port_descriptors[TRIPLEPARA_FC_3] =
 
517
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
518
                port_names[TRIPLEPARA_FC_3] =
 
519
                 D_("Band 3 frequency (Hz)");
 
520
                port_range_hints[TRIPLEPARA_FC_3].HintDescriptor =
 
521
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_SAMPLE_RATE | LADSPA_HINT_DEFAULT_HIGH;
 
522
                port_range_hints[TRIPLEPARA_FC_3].LowerBound = 0.0001;
 
523
                port_range_hints[TRIPLEPARA_FC_3].UpperBound = 0.49;
 
524
 
 
525
                /* Parameters for Band 3 bandwidth (octaves) */
 
526
                port_descriptors[TRIPLEPARA_BW_3] =
 
527
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
528
                port_names[TRIPLEPARA_BW_3] =
 
529
                 D_("Band 3 bandwidth (octaves)");
 
530
                port_range_hints[TRIPLEPARA_BW_3].HintDescriptor =
 
531
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_1;
 
532
                port_range_hints[TRIPLEPARA_BW_3].LowerBound = 0;
 
533
                port_range_hints[TRIPLEPARA_BW_3].UpperBound = 4;
 
534
 
 
535
                /* Parameters for High-shelving gain (dB) */
 
536
                port_descriptors[TRIPLEPARA_GAIN_H] =
 
537
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
538
                port_names[TRIPLEPARA_GAIN_H] =
 
539
                 D_("High-shelving gain (dB)");
 
540
                port_range_hints[TRIPLEPARA_GAIN_H].HintDescriptor =
 
541
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0;
 
542
                port_range_hints[TRIPLEPARA_GAIN_H].LowerBound = -70;
 
543
                port_range_hints[TRIPLEPARA_GAIN_H].UpperBound = +30;
 
544
 
 
545
                /* Parameters for High-shelving frequency (Hz) */
 
546
                port_descriptors[TRIPLEPARA_FC_H] =
 
547
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
548
                port_names[TRIPLEPARA_FC_H] =
 
549
                 D_("High-shelving frequency (Hz)");
 
550
                port_range_hints[TRIPLEPARA_FC_H].HintDescriptor =
 
551
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC | LADSPA_HINT_SAMPLE_RATE | LADSPA_HINT_DEFAULT_MAXIMUM;
 
552
                port_range_hints[TRIPLEPARA_FC_H].LowerBound = 0.0001;
 
553
                port_range_hints[TRIPLEPARA_FC_H].UpperBound = 0.49;
 
554
 
 
555
                /* Parameters for High-shelving slope */
 
556
                port_descriptors[TRIPLEPARA_BW_H] =
 
557
                 LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL;
 
558
                port_names[TRIPLEPARA_BW_H] =
 
559
                 D_("High-shelving slope");
 
560
                port_range_hints[TRIPLEPARA_BW_H].HintDescriptor =
 
561
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_MIDDLE;
 
562
                port_range_hints[TRIPLEPARA_BW_H].LowerBound = 0;
 
563
                port_range_hints[TRIPLEPARA_BW_H].UpperBound = 1;
 
564
 
 
565
                /* Parameters for Input */
 
566
                port_descriptors[TRIPLEPARA_INPUT] =
 
567
                 LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO;
 
568
                port_names[TRIPLEPARA_INPUT] =
 
569
                 D_("Input");
 
570
                port_range_hints[TRIPLEPARA_INPUT].HintDescriptor =
 
571
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE;
 
572
                port_range_hints[TRIPLEPARA_INPUT].LowerBound = -1.0;
 
573
                port_range_hints[TRIPLEPARA_INPUT].UpperBound = +1.0;
 
574
 
 
575
                /* Parameters for Output */
 
576
                port_descriptors[TRIPLEPARA_OUTPUT] =
 
577
                 LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO;
 
578
                port_names[TRIPLEPARA_OUTPUT] =
 
579
                 D_("Output");
 
580
                port_range_hints[TRIPLEPARA_OUTPUT].HintDescriptor =
 
581
                 LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE;
 
582
                port_range_hints[TRIPLEPARA_OUTPUT].LowerBound = -1.0;
 
583
                port_range_hints[TRIPLEPARA_OUTPUT].UpperBound = +1.0;
 
584
 
 
585
                tripleParaDescriptor->activate = activateTriplePara;
 
586
                tripleParaDescriptor->cleanup = cleanupTriplePara;
 
587
                tripleParaDescriptor->connect_port = connectPortTriplePara;
 
588
                tripleParaDescriptor->deactivate = NULL;
 
589
                tripleParaDescriptor->instantiate = instantiateTriplePara;
 
590
                tripleParaDescriptor->run = runTriplePara;
 
591
                tripleParaDescriptor->run_adding = runAddingTriplePara;
 
592
                tripleParaDescriptor->set_run_adding_gain = setRunAddingGainTriplePara;
 
593
        }
 
594
}
 
595
 
 
596
void _fini() {
 
597
        if (tripleParaDescriptor) {
 
598
                free((LADSPA_PortDescriptor *)tripleParaDescriptor->PortDescriptors);
 
599
                free((char **)tripleParaDescriptor->PortNames);
 
600
                free((LADSPA_PortRangeHint *)tripleParaDescriptor->PortRangeHints);
 
601
                free(tripleParaDescriptor);
 
602
        }
 
603
 
 
604
}