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.

64 lines
1.8KB

  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 List
  22. struct PluginListManager {
  23. PluginListManager()
  24. {
  25. carla_register_all_plugins();
  26. }
  27. ~PluginListManager()
  28. {
  29. for (NonRtList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next())
  30. {
  31. const LV2_Descriptor*& lv2Desc(*it);
  32. delete[] lv2Desc->URI;
  33. delete lv2Desc;
  34. }
  35. descs.clear();
  36. lv2Descs.clear();
  37. }
  38. NonRtList<const PluginDescriptor*> descs;
  39. NonRtList<const LV2_Descriptor*> lv2Descs;
  40. };
  41. static PluginListManager sPluginDescsMgr;
  42. // -----------------------------------------------------------------------
  43. void carla_register_native_plugin(const PluginDescriptor* desc)
  44. {
  45. #ifdef CARLA_NATIVE_PLUGIN_LV2
  46. // LV2 MIDI Out and Open/Save are not implemented yet
  47. if (desc->midiOuts > 0 || (desc->hints & PLUGIN_NEEDS_UI_OPEN_SAVE) != 0)
  48. return;
  49. #endif
  50. sPluginDescsMgr.descs.append(desc);
  51. }
  52. // -----------------------------------------------------------------------