The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

86 lines
3.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. //==============================================================================
  19. /**
  20. Base class for an active instance of a plugin.
  21. This derives from the AudioProcessor class, and adds some extra functionality
  22. that helps when wrapping dynamically loaded plugins.
  23. This class is not needed when writing plugins, and you should never need to derive
  24. your own sub-classes from it. The plugin hosting classes use it internally and will
  25. return AudioPluginInstance objects which wrap external plugins.
  26. @see AudioProcessor, AudioPluginFormat
  27. */
  28. class JUCE_API AudioPluginInstance : public AudioProcessor
  29. {
  30. public:
  31. //==============================================================================
  32. /** Destructor.
  33. Make sure that you delete any UI components that belong to this plugin before
  34. deleting the plugin.
  35. */
  36. virtual ~AudioPluginInstance() {}
  37. //==============================================================================
  38. /** Fills-in the appropriate parts of this plugin description object. */
  39. virtual void fillInPluginDescription (PluginDescription& description) const = 0;
  40. /** Returns a PluginDescription for this plugin.
  41. This is just a convenience method to avoid calling fillInPluginDescription.
  42. */
  43. PluginDescription getPluginDescription() const
  44. {
  45. PluginDescription desc;
  46. fillInPluginDescription (desc);
  47. return desc;
  48. }
  49. /** Returns a pointer to some kind of platform-specific data about the plugin.
  50. E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be
  51. cast to an AudioUnit handle.
  52. */
  53. virtual void* getPlatformSpecificData() { return nullptr; }
  54. /** For some formats (currently AudioUnit), this forces a reload of the list of
  55. available parameters.
  56. */
  57. virtual void refreshParameterList() {}
  58. protected:
  59. //==============================================================================
  60. AudioPluginInstance() {}
  61. AudioPluginInstance (const BusesProperties& ioLayouts) : AudioProcessor (ioLayouts) {}
  62. template <int numLayouts>
  63. AudioPluginInstance (const short channelLayoutList[numLayouts][2]) : AudioProcessor (channelLayoutList) {}
  64. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginInstance)
  65. };