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 *****************************************************************************/
24 #include "lv2filter.h"
25 //#define LOG_LEVEL LOG_LEVEL_DEBUG
28 static LV2_Descriptor g_lv2_plugins
[] =
31 .URI
= LV2FILTER_MONO_URI
,
32 .instantiate
= lv2filter_instantiate
,
33 .connect_port
= lv2filter_connect_port
,
35 .cleanup
= lv2filter_cleanup
,
36 .extension_data
= lv2filter_extension_data
39 .URI
= LV2FILTER_STEREO_URI
,
40 .instantiate
= lv2filter_instantiate
,
41 .connect_port
= lv2filter_connect_port
,
43 .cleanup
= lv2filter_cleanup
,
44 .extension_data
= lv2filter_extension_data
51 static int g_lv2_plugins_count
;
53 void lv2_initialise() __attribute__((constructor
));
56 const LV2_Descriptor
* descr_ptr
;
58 LOG_DEBUG("lv2_initialise() called.");
60 descr_ptr
= g_lv2_plugins
;
62 while (descr_ptr
->URI
!= NULL
)
64 g_lv2_plugins_count
++;
69 const LV2_Descriptor
* lv2_descriptor(uint32_t index
)
71 LOG_DEBUG("lv2_descriptor(%u) called.", (unsigned int)index
);
73 if (index
>= g_lv2_plugins_count
)
75 LOG_DEBUG("plugin at index %u not found.", (unsigned int)index
);
79 LOG_DEBUG("<%s> found.", g_lv2_plugins
[index
].URI
);
80 return g_lv2_plugins
+ index
;