cmake: Install host-plugin/native-plugin/standalone pkgconfig files
[carla.git] / source / plugin / carla-lv2-bundles.cpp
blobd01efd6a6fe0e5ee0018fc7682b1fcf5f01746e2
1 /*
2 * Carla Native Plugins
3 * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
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 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef CARLA_BUNDLE_TYPE
19 # error CARLA_BUNDLE_TYPE undefined
20 #endif
22 // --------------------------------------------------------------------------------------------------------------------
24 #include "carla-lv2.cpp"
26 // --------------------------------------------------------------------------------------------------------------------
28 #define MAX_PLUGIN_DESCRIPTORS 8
29 static const NativePluginDescriptor* sDescs[MAX_PLUGIN_DESCRIPTORS];
30 static std::size_t sDescsUsed = 0;
32 std::size_t carla_getNativePluginCount() noexcept
34 return sDescsUsed;
37 const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept
39 CARLA_SAFE_ASSERT_RETURN(index < sDescsUsed, nullptr);
41 return sDescs[index];
44 void carla_register_native_plugin(const NativePluginDescriptor* desc)
46 CARLA_SAFE_ASSERT_RETURN(sDescsUsed < MAX_PLUGIN_DESCRIPTORS,);
48 sDescs[sDescsUsed++] = desc;
51 // --------------------------------------------------------------------------------------------------------------------
53 static void carla_register_bundled_native_plugins(void);
55 static const struct PluginRegisterer {
56 PluginRegisterer() {
57 carla_register_bundled_native_plugins();
59 } sPluginRegisterer;
61 // --------------------------------------------------------------------------------------------------------------------
63 extern "C" {
65 // Simple plugins
66 void carla_register_native_plugin_audiogain(void);
67 void carla_register_native_plugin_bypass(void);
68 void carla_register_native_plugin_lfo(void);
69 void carla_register_native_plugin_midichanab(void);
70 void carla_register_native_plugin_midichanfilter(void);
71 void carla_register_native_plugin_midichannelize(void);
72 void carla_register_native_plugin_midigain(void);
73 void carla_register_native_plugin_midijoin(void);
74 void carla_register_native_plugin_midisplit(void);
75 void carla_register_native_plugin_midithrough(void);
76 void carla_register_native_plugin_miditranspose(void);
78 // Audio file
79 void carla_register_native_plugin_audiofile(void);
81 // MIDI file and sequencer
82 void carla_register_native_plugin_midifile(void);
83 void carla_register_native_plugin_midipattern(void);
85 // Carla
86 void carla_register_native_plugin_carla(void);
88 // External-UI plugins
89 void carla_register_native_plugin_bigmeter(void);
90 void carla_register_native_plugin_notes(void);
92 #ifdef HAVE_EXTERNAL_PLUGINS
93 void carla_register_all_native_external_plugins(void);
94 #endif
98 static void carla_register_bundled_native_plugins(void)
100 #if CARLA_BUNDLE_TYPE == 1
101 carla_register_native_plugin_audiogain();
102 #elif CARLA_BUNDLE_TYPE == 2
103 carla_register_native_plugin_audiofile();
104 carla_register_native_plugin_midifile();
105 #elif CARLA_BUNDLE_TYPE == 3
106 carla_register_native_plugin_midichanab();
107 carla_register_native_plugin_midichannelize();
108 carla_register_native_plugin_midichanfilter();
109 carla_register_native_plugin_midigain();
110 carla_register_native_plugin_midijoin();
111 carla_register_native_plugin_midisplit();
112 carla_register_native_plugin_miditranspose();
113 #endif
116 // --------------------------------------------------------------------------------------------------------------------