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.

148 lines
4.2KB

  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_BigMeter();
  51. void carla_register_native_plugin_BigMeterM();
  52. void carla_register_native_plugin_Notes();
  53. #ifdef WANT_ZYNADDSUBFX
  54. // ZynAddSubFX
  55. void carla_register_native_plugin_zynaddsubfx();
  56. #endif
  57. }
  58. // -----------------------------------------------------------------------
  59. // Plugin List
  60. struct PluginListManager {
  61. PluginListManager()
  62. {
  63. // Simple plugins (C)
  64. carla_register_native_plugin_bypass();
  65. carla_register_native_plugin_lfo();
  66. carla_register_native_plugin_midiGain();
  67. carla_register_native_plugin_midiSplit();
  68. carla_register_native_plugin_midiThrough();
  69. carla_register_native_plugin_midiTranspose();
  70. carla_register_native_plugin_nekofilter();
  71. // Simple plugins (C++)
  72. carla_register_native_plugin_vex();
  73. #ifdef WANT_AUDIOFILE
  74. // AudioFile
  75. carla_register_native_plugin_audiofile();
  76. #endif
  77. #ifdef WANT_MIDIFILE
  78. // MidiFile
  79. carla_register_native_plugin_midifile();
  80. #endif
  81. #ifdef WANT_OPENGL
  82. // DISTRHO plugins (OpenGL)
  83. carla_register_native_plugin_3BandEQ();
  84. carla_register_native_plugin_3BandSplitter();
  85. carla_register_native_plugin_Nekobi();
  86. carla_register_native_plugin_PingPongPan();
  87. //carla_register_native_plugin_StereoEnhancer(); // unfinished
  88. #endif
  89. // DISTRHO plugins (PyQt)
  90. carla_register_native_plugin_BigMeter();
  91. carla_register_native_plugin_BigMeterM();
  92. carla_register_native_plugin_Notes(); // unfinished
  93. #ifdef WANT_ZYNADDSUBFX
  94. // ZynAddSubFX
  95. carla_register_native_plugin_zynaddsubfx();
  96. #endif
  97. }
  98. ~PluginListManager()
  99. {
  100. for (NonRtList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next())
  101. {
  102. const LV2_Descriptor*& lv2Desc(*it);
  103. delete[] lv2Desc->URI;
  104. delete lv2Desc;
  105. }
  106. descs.clear();
  107. lv2Descs.clear();
  108. }
  109. NonRtList<const PluginDescriptor*> descs;
  110. NonRtList<const LV2_Descriptor*> lv2Descs;
  111. };
  112. static PluginListManager sPluginDescsMgr;
  113. void carla_register_native_plugin(const PluginDescriptor* desc)
  114. {
  115. #ifdef CARLA_NATIVE_PLUGIN_LV2
  116. // LV2 MIDI Out and Open/Save are not implemented yet
  117. if (desc->midiOuts > 0 || (desc->hints & PLUGIN_NEEDS_UI_OPEN_SAVE) != 0)
  118. return;
  119. #endif
  120. sPluginDescsMgr.descs.append(desc);
  121. }
  122. // -----------------------------------------------------------------------