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.

96 lines
3.0KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2013-2014 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 "CarlaEngine.hpp"
  18. #include "CarlaPlugin.hpp"
  19. #include "CarlaHost.h"
  20. #include "CarlaNative.h"
  21. #include "CarlaBackendUtils.hpp"
  22. #include "LinkedList.hpp"
  23. #ifdef CARLA_NATIVE_PLUGIN_LV2
  24. # include "lv2/lv2.h"
  25. #endif
  26. // -----------------------------------------------------------------------
  27. // Plugin List
  28. struct PluginListManager {
  29. PluginListManager()
  30. {
  31. for (size_t i=0, count = CarlaBackend::CarlaPlugin::getNativePluginCount(); i < count; ++i)
  32. {
  33. const NativePluginDescriptor* const desc(CarlaBackend::CarlaPlugin::getNativePluginDescriptor(i));
  34. // Open/Save not possible in plugins
  35. if (desc->hints & PLUGIN_NEEDS_UI_OPEN_SAVE)
  36. continue;
  37. // skip distrho plugins and Vex
  38. if (
  39. // distrho mini-series
  40. std::strcmp(desc->label, "3bandeq") == 0 || std::strcmp(desc->label, "3bandsplitter") == 0 ||
  41. std::strcmp(desc->label, "pingpongpan") == 0 || std::strcmp(desc->label, "stereoenhancer") == 0 ||
  42. // juice
  43. std::strstr(desc->label, "juice") != nullptr ||
  44. // zamaudio
  45. std::strncmp(desc->label, "zam", 3) == 0 ||
  46. // other synths
  47. std::strcmp(desc->label, "nekobi") == 0 || std::strcmp(desc->label, "vexsynth") == 0
  48. )
  49. {
  50. continue;
  51. }
  52. // skip midi plugins, not implemented yet
  53. if (desc->audioIns == 0 && desc->audioOuts == 0 && desc->midiIns == 1 && desc->midiOuts >= 1)
  54. continue;
  55. descs.append(desc);
  56. }
  57. }
  58. ~PluginListManager()
  59. {
  60. #ifdef CARLA_NATIVE_PLUGIN_LV2
  61. for (LinkedList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next())
  62. {
  63. const LV2_Descriptor* const lv2Desc(it.getValue());
  64. delete[] lv2Desc->URI;
  65. delete lv2Desc;
  66. }
  67. lv2Descs.clear();
  68. #endif
  69. descs.clear();
  70. }
  71. static PluginListManager& getInstance()
  72. {
  73. static PluginListManager plm;
  74. return plm;
  75. }
  76. #ifdef CARLA_NATIVE_PLUGIN_LV2
  77. LinkedList<const LV2_Descriptor*> lv2Descs;
  78. #endif
  79. LinkedList<const NativePluginDescriptor*> descs;
  80. };
  81. // -----------------------------------------------------------------------