Minor detune bandwidth optimization
[zyn.git] / lv2plugin.c
blobb5493e86b85d587f11aa59998871ddfd189ab7df
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * Copyright (C) 2006,2007,2008,2009 Nedko Arnaudov <nedko@arnaudov.name>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *****************************************************************************/
21 //#include <stdio.h>
22 #include <lv2.h>
24 #include "common.h"
25 #include "lv2plugin.h"
26 #include "zynadd.h"
28 static LV2_Descriptor g_lv2_plugins[] =
31 .URI = "http://home.gna.org/zyn/zynadd/1",
32 .instantiate = zynadd_instantiate,
33 .connect_port = zynadd_connect_port,
34 .run = zynadd_run,
35 .cleanup = zynadd_cleanup,
36 .extension_data = zynadd_extension_data
39 .URI = NULL
43 static int g_lv2_plugins_count;
45 void lv2_initialise() __attribute__((constructor));
46 void lv2_initialise()
48 const LV2_Descriptor * descr_ptr;
50 // printf("lv2_initialise() called.\n");
52 descr_ptr = g_lv2_plugins;
54 while (descr_ptr->URI != NULL)
56 g_lv2_plugins_count++;
57 descr_ptr++;
61 const LV2_Descriptor* lv2_descriptor(uint32_t index)
63 /* printf("lv2_descriptor(%u) called.\n", (unsigned int)index); */
65 if (index >= g_lv2_plugins_count)
67 /* printf("plugin at index %u not found.\n", (unsigned int)index); */
68 return NULL;
71 /* printf("<%s> found.\n", g_lv2_plugins[index].URI); */
72 return g_lv2_plugins + index;