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.

104 lines
2.5KB

  1. /*
  2. * Carla Juce Plugin
  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 "CarlaPluginInternal.hpp"
  18. #include "CarlaEngine.hpp"
  19. #ifdef HAVE_JUCE
  20. //#include "JuceHeader.h"
  21. //using juce::VSTPluginFormat;
  22. CARLA_BACKEND_START_NAMESPACE
  23. #if 0
  24. class JucePlugin : public CarlaPlugin
  25. {
  26. public:
  27. JucePlugin(CarlaEngine* const engine, const unsigned short id)
  28. : CarlaPlugin(engine, id)
  29. {
  30. carla_debug("JucePlugin::JucePlugin(%p, %i)", engine, id);
  31. }
  32. ~Vst3Plugin() override
  33. {
  34. carla_debug("JucePlugin::~JucePlugin()");
  35. pData->singleMutex.lock();
  36. pData->masterMutex.lock();
  37. if (pData->client != nullptr && pData->client->isActive())
  38. pData->client->deactivate();
  39. }
  40. // -------------------------------------------------------------------
  41. // Information (base)
  42. PluginType getType() const override
  43. {
  44. return PLUGIN_CSOUND;
  45. }
  46. private:
  47. VSTPluginFormat format;
  48. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JucePlugin)
  49. };
  50. #endif
  51. CARLA_BACKEND_END_NAMESPACE
  52. #endif
  53. CARLA_BACKEND_START_NAMESPACE
  54. CarlaPlugin* CarlaPlugin::newJuce(const Initializer& init, const char* const format)
  55. {
  56. carla_debug("CarlaPlugin::newJuce({%p, \"%s\", \"%s\", \"%s\"}, %s)", init.engine, init.filename, init.name, init.label, format);
  57. #if 0 //def HAVE_JUCE
  58. JucePlugin* const plugin(new JucePlugin(init.engine, init.id));
  59. //if (! plugin->init(init.filename, init.name, init.label))
  60. {
  61. delete plugin;
  62. return nullptr;
  63. }
  64. plugin->reload();
  65. if (init.engine->getProccessMode() == ENGINE_PROCESS_MODE_CONTINUOUS_RACK && ! plugin->canRunInRack())
  66. {
  67. init.engine->setLastError("Carla's rack mode can only work with Stereo VST3 plugins, sorry!");
  68. delete plugin;
  69. return nullptr;
  70. }
  71. return plugin;
  72. #else
  73. init.engine->setLastError("Juce support not available");
  74. return nullptr;
  75. // unused
  76. (void)format;
  77. #endif
  78. }
  79. CARLA_BACKEND_END_NAMESPACE