/* interface.cc Copyright 2004-9 Tim Goetze 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 2 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. */ #include #include "basics.h" #include "Cabinet.h" #include "Chorus.h" #include "Phaser.h" #include "Sin.h" #include "Lorenz.h" #include "Roessler.h" #include "Reverb.h" #include "Compress.h" #include "Click.h" #include "Eq.h" #include "Clip.h" #include "White.h" #include "SweepVF.h" #include "VCO.h" #include "Amp.h" #include "HRTF.h" #include "Pan.h" #include "Scape.h" #include "ToneStack.h" #include "Descriptor.h" #define N 38 static DescriptorStub * descriptors [N]; /*static inline void seed() { static struct timeval tv; gettimeofday (&tv, 0); srand (tv.tv_sec ^ tv.tv_usec); }*/ extern "C" { __attribute__ ((constructor)) void _init() { DescriptorStub ** d = descriptors; *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); *d++ = new Descriptor(); /* make sure N is correct */ assert (d - descriptors == N); //seed(); } __attribute__ ((destructor)) void _fini() { for (ulong i = 0; i < N; ++i) delete descriptors[i]; } /* /////////////////////////////////////////////////////////////////////// */ const LADSPA_Descriptor * ladspa_descriptor (unsigned long i) { if (i < N) return descriptors[i]; return 0; } }; /* extern "C" */