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.

144 lines
4.0KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2013 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. #include "CarlaNative.h"
  18. #include "RtList.hpp"
  19. #include "lv2/lv2.h"
  20. // -----------------------------------------------------------------------
  21. // Plugin register calls
  22. extern "C" {
  23. // Simple plugins (C)
  24. void carla_register_native_plugin_bypass();
  25. void carla_register_native_plugin_lfo();
  26. void carla_register_native_plugin_midiGain();
  27. void carla_register_native_plugin_midiSplit();
  28. void carla_register_native_plugin_midiThrough();
  29. void carla_register_native_plugin_midiTranspose();
  30. void carla_register_native_plugin_nekofilter();
  31. // Simple plugins (C++)
  32. void carla_register_native_plugin_vex();
  33. #ifdef WANT_AUDIOFILE
  34. // AudioFile
  35. void carla_register_native_plugin_audiofile();
  36. #endif
  37. #ifdef WANT_MIDIFILE
  38. // MidiFile
  39. void carla_register_native_plugin_midifile();
  40. #endif
  41. #ifdef WANT_OPENGL
  42. // DISTRHO plugins (OpenGL)
  43. void carla_register_native_plugin_3BandEQ();
  44. void carla_register_native_plugin_3BandSplitter();
  45. void carla_register_native_plugin_Nekobi();
  46. void carla_register_native_plugin_PingPongPan();
  47. // void carla_register_native_plugin_StereoEnhancer();
  48. #endif
  49. // DISTRHO plugins (PyQt)
  50. void carla_register_native_plugin_Notes();
  51. #ifdef WANT_ZYNADDSUBFX
  52. // ZynAddSubFX
  53. void carla_register_native_plugin_zynaddsubfx();
  54. #endif
  55. }
  56. // -----------------------------------------------------------------------
  57. // Plugin List
  58. struct PluginListManager {
  59. PluginListManager()
  60. {
  61. // Simple plugins (C)
  62. carla_register_native_plugin_bypass();
  63. carla_register_native_plugin_lfo();
  64. carla_register_native_plugin_midiGain();
  65. carla_register_native_plugin_midiSplit();
  66. carla_register_native_plugin_midiThrough();
  67. carla_register_native_plugin_midiTranspose();
  68. carla_register_native_plugin_nekofilter();
  69. // Simple plugins (C++)
  70. carla_register_native_plugin_vex();
  71. #ifdef WANT_AUDIOFILE
  72. // AudioFile
  73. carla_register_native_plugin_audiofile();
  74. #endif
  75. #ifdef WANT_MIDIFILE
  76. // MidiFile
  77. carla_register_native_plugin_midifile();
  78. #endif
  79. #ifdef WANT_OPENGL
  80. // DISTRHO plugins (OpenGL)
  81. carla_register_native_plugin_3BandEQ();
  82. carla_register_native_plugin_3BandSplitter();
  83. carla_register_native_plugin_Nekobi();
  84. carla_register_native_plugin_PingPongPan();
  85. //carla_register_native_plugin_StereoEnhancer(); // unfinished
  86. #endif
  87. // DISTRHO plugins (PyQt)
  88. carla_register_native_plugin_Notes(); // unfinished
  89. #ifdef WANT_ZYNADDSUBFX
  90. // ZynAddSubFX
  91. carla_register_native_plugin_zynaddsubfx();
  92. #endif
  93. }
  94. ~PluginListManager()
  95. {
  96. for (NonRtList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next())
  97. {
  98. const LV2_Descriptor*& lv2Desc(*it);
  99. delete[] lv2Desc->URI;
  100. delete lv2Desc;
  101. }
  102. descs.clear();
  103. lv2Descs.clear();
  104. }
  105. NonRtList<const PluginDescriptor*> descs;
  106. NonRtList<const LV2_Descriptor*> lv2Descs;
  107. };
  108. static PluginListManager sPluginDescsMgr;
  109. void carla_register_native_plugin(const PluginDescriptor* desc)
  110. {
  111. #ifdef CARLA_NATIVE_PLUGIN_LV2
  112. // LV2 MIDI Out and Open/Save are not implemented yet
  113. if (desc->midiOuts > 0 || (desc->hints & PLUGIN_NEEDS_UI_OPEN_SAVE) != 0)
  114. return;
  115. #endif
  116. sPluginDescsMgr.descs.append(desc);
  117. }
  118. // -----------------------------------------------------------------------