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.

carla-native-base.cpp 4.4KB

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