Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.7KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  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.
  9. *
  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.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_BUNDLE_TYPE
  18. # error CARLA_BUNDLE_TYPE undefined
  19. #endif
  20. // --------------------------------------------------------------------------------------------------------------------
  21. #include "carla-lv2.cpp"
  22. // --------------------------------------------------------------------------------------------------------------------
  23. #define MAX_PLUGIN_DESCRIPTORS 8
  24. static const NativePluginDescriptor* sDescs[MAX_PLUGIN_DESCRIPTORS];
  25. static std::size_t sDescsUsed = 0;
  26. std::size_t carla_getNativePluginCount() noexcept
  27. {
  28. return sDescsUsed;
  29. }
  30. const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept
  31. {
  32. CARLA_SAFE_ASSERT_RETURN(index < sDescsUsed, nullptr);
  33. return sDescs[index];
  34. }
  35. void carla_register_native_plugin(const NativePluginDescriptor* desc)
  36. {
  37. CARLA_SAFE_ASSERT_RETURN(sDescsUsed < MAX_PLUGIN_DESCRIPTORS,);
  38. sDescs[sDescsUsed++] = desc;
  39. }
  40. // --------------------------------------------------------------------------------------------------------------------
  41. static void carla_register_bundled_native_plugins(void);
  42. static const struct PluginRegisterer {
  43. PluginRegisterer() {
  44. carla_register_bundled_native_plugins();
  45. }
  46. } sPluginRegisterer;
  47. // --------------------------------------------------------------------------------------------------------------------
  48. extern "C" {
  49. // Simple plugins
  50. void carla_register_native_plugin_audiogain(void);
  51. void carla_register_native_plugin_bypass(void);
  52. void carla_register_native_plugin_lfo(void);
  53. void carla_register_native_plugin_midichanab(void);
  54. void carla_register_native_plugin_midichanfilter(void);
  55. void carla_register_native_plugin_midichannelize(void);
  56. void carla_register_native_plugin_midigain(void);
  57. void carla_register_native_plugin_midijoin(void);
  58. void carla_register_native_plugin_midisplit(void);
  59. void carla_register_native_plugin_midithrough(void);
  60. void carla_register_native_plugin_miditranspose(void);
  61. // Audio file
  62. void carla_register_native_plugin_audiofile(void);
  63. // MIDI file and sequencer
  64. void carla_register_native_plugin_midifile(void);
  65. void carla_register_native_plugin_midipattern(void);
  66. // Carla
  67. void carla_register_native_plugin_carla(void);
  68. // External-UI plugins
  69. void carla_register_native_plugin_bigmeter(void);
  70. void carla_register_native_plugin_notes(void);
  71. #ifdef HAVE_EXTERNAL_PLUGINS
  72. void carla_register_all_native_external_plugins(void);
  73. #endif
  74. }
  75. static void carla_register_bundled_native_plugins(void)
  76. {
  77. #if CARLA_BUNDLE_TYPE == 1
  78. carla_register_native_plugin_audiogain();
  79. #elif CARLA_BUNDLE_TYPE == 2
  80. carla_register_native_plugin_audiofile();
  81. carla_register_native_plugin_midifile();
  82. #elif CARLA_BUNDLE_TYPE == 3
  83. carla_register_native_plugin_midichanab();
  84. carla_register_native_plugin_midichannelize();
  85. carla_register_native_plugin_midichanfilter();
  86. carla_register_native_plugin_midigain();
  87. carla_register_native_plugin_midijoin();
  88. carla_register_native_plugin_midisplit();
  89. carla_register_native_plugin_miditranspose();
  90. #endif
  91. }
  92. // --------------------------------------------------------------------------------------------------------------------