File: interface.cc

package info (click to toggle)
caps 0.9.26-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 924 kB
  • sloc: cpp: 10,867; ansic: 1,324; makefile: 78; python: 38
file content (130 lines) | stat: -rw-r--r-- 3,213 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
  interface.cc

	Copyright 2004-14 Tim Goetze <tim@quitte.de>
	
	http://quitte.de/dsp/

	LADSPA descriptor factory, host interface.

*/
/*
	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 3
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
	02111-1307, USA or point your web browser to http://www.gnu.org.
*/
/*
	LADSPA ID ranges 1761 - 1800 and 2581 - 2660 
	(2541 - 2580 donated to artemio@kdemail.net)
*/

#include "version.h"
#include "basics.h"

#include "Cabinet.h"
#include "Chorus.h"
#include "Phaser.h"
#include "Sin.h"
#include "Fractals.h"
#include "Reverb.h"
#include "Compress.h"
#include "Click.h"
#include "Eq.h"
#include "Saturate.h"
#include "White.h"
#include "AutoFilter.h"
#include "Amp.h"
#include "Pan.h"
#include "Scape.h"
#include "ToneStack.h" 
#include "Noisegate.h" 
#ifdef SUMMER
#include "AmpVI.h"
#endif

#include "Descriptor.h"

#define N 36 

static DescriptorStub * descriptors[N+1];

extern "C" {

const LADSPA_Descriptor * 
ladspa_descriptor (unsigned long i) { return i < N ? descriptors[i] : 0; }

__attribute__ ((constructor)) 
void caps_so_init()
{
	DescriptorStub ** d = descriptors;
	/* make sure uninitialised array members are safe to pass to the host */
	memset (d, 0, sizeof (descriptors));

	*d++ = new Descriptor<Noisegate>(2602);
	*d++ = new Descriptor<Compress>(1772);
	*d++ = new Descriptor<CompressX2>(2598);

	*d++ = new Descriptor<ToneStack>(2589);
	*d++ = new Descriptor<AmpVTS>(2592);
	#ifdef SUMMER
	*d++ = new Descriptor<AmpVI>(1789);
	#endif
	*d++ = new Descriptor<CabinetIII>(2601);
	*d++ = new Descriptor<CabinetIV>(2606);

	#ifdef WITH_JVREV
	*d++ = new Descriptor<JVRev>(1778);
	#endif
	*d++ = new Descriptor<Plate>(1779);
	*d++ = new Descriptor<PlateX2>(1795);

	*d++ = new Descriptor<Saturate>(1771);
	*d++ = new Descriptor<Spice>(2603);
	*d++ = new Descriptor<SpiceX2>(2607);

	*d++ = new Descriptor<ChorusI>(1767);
	*d++ = new Descriptor<PhaserII>(2586);

	*d++ = new Descriptor<AutoFilter>(2593);
	*d++ = new Descriptor<Scape>(2588);
	#if 0
	*d++ = new Descriptor<DDDelay>(2610);
	#endif

	*d++ = new Descriptor<Eq10>(1773);
	*d++ = new Descriptor<Eq10X2>(2594);
	*d++ = new Descriptor<Eq4p>(2608);
	*d++ = new Descriptor<EqFA4p>(2609);

	*d++ = new Descriptor<Wider>(1788);
	*d++ = new Descriptor<Narrower>(2595);

	*d++ = new Descriptor<Sin>(1781);
	*d++ = new Descriptor<White>(1785);
	*d++ = new Descriptor<Fractal>(1774);

	*d++ = new Descriptor<Click>(1769);
	*d++ = new Descriptor<CEO>(1770);
	
	assert (d - descriptors <= N);
}

__attribute__ ((destructor)) 
void caps_so_fini()
{
	DescriptorStub ** d = descriptors;
	while (*d) delete *d++;
}

}; /* extern "C" */