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.

90 lines
3.4KB

  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. #ifndef JUCE_AUDIOPLUGININSTANCE_H_INCLUDED
  18. #define JUCE_AUDIOPLUGININSTANCE_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. Base class for an active instance of a plugin.
  22. This derives from the AudioProcessor class, and adds some extra functionality
  23. that helps when wrapping dynamically loaded plugins.
  24. This class is not needed when writing plugins, and you should never need to derive
  25. your own sub-classes from it. The plugin hosting classes use it internally and will
  26. return AudioPluginInstance objects which wrap external plugins.
  27. @see AudioProcessor, AudioPluginFormat
  28. */
  29. class JUCE_API AudioPluginInstance : public AudioProcessor
  30. {
  31. public:
  32. //==============================================================================
  33. /** Destructor.
  34. Make sure that you delete any UI components that belong to this plugin before
  35. deleting the plugin.
  36. */
  37. virtual ~AudioPluginInstance() {}
  38. //==============================================================================
  39. /** Fills-in the appropriate parts of this plugin description object. */
  40. virtual void fillInPluginDescription (PluginDescription& description) const = 0;
  41. /** Returns a PluginDescription for this plugin.
  42. This is just a convenience method to avoid calling fillInPluginDescription.
  43. */
  44. PluginDescription getPluginDescription() const
  45. {
  46. PluginDescription desc;
  47. fillInPluginDescription (desc);
  48. return desc;
  49. }
  50. /** Returns a pointer to some kind of platform-specific data about the plugin.
  51. E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be
  52. cast to an AudioUnit handle.
  53. */
  54. virtual void* getPlatformSpecificData() { return nullptr; }
  55. /** For some formats (currently AudioUnit), this forces a reload of the list of
  56. available parameters.
  57. */
  58. virtual void refreshParameterList() {}
  59. protected:
  60. //==============================================================================
  61. AudioPluginInstance() {}
  62. AudioPluginInstance (const BusesProperties& ioLayouts) : AudioProcessor (ioLayouts) {}
  63. template <int numLayouts>
  64. AudioPluginInstance (const short channelLayoutList[numLayouts][2]) : AudioProcessor (channelLayoutList) {}
  65. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginInstance)
  66. };
  67. #endif // JUCE_AUDIOPLUGININSTANCE_H_INCLUDED