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.

87 lines
3.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 6 End-User License
  8. Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  9. End User License Agreement: www.juce.com/juce-6-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. namespace juce
  19. {
  20. //==============================================================================
  21. /** Create a derived implementation of this class and pass it to
  22. AudioPluginInstance::getExtensions() to retrieve format-specific
  23. information about a plugin instance.
  24. Note that the references passed to the visit member functions are only
  25. guaranteed to live for the duration of the function call, so don't
  26. store pointers to these objects! If you need to store and reuse
  27. format-specific information, it is recommended to copy the result
  28. of the function calls that you care about. For example, you should
  29. store the result of VST::getAEffectPtr() rather than storing a pointer
  30. to the VST instance.
  31. */
  32. struct ExtensionsVisitor
  33. {
  34. /** Indicates that there is no platform specific information available. */
  35. struct Unknown {};
  36. /** Can be used to retrieve information about a VST3 that is wrapped by an AudioProcessor. */
  37. struct VST3Client
  38. {
  39. virtual ~VST3Client() = default;
  40. virtual void* getIComponentPtr() const noexcept = 0;
  41. virtual MemoryBlock getPreset() const = 0;
  42. virtual bool setPreset (const MemoryBlock&) const = 0;
  43. };
  44. /** Can be used to retrieve information about an AudioUnit that is wrapped by an AudioProcessor. */
  45. struct AudioUnitClient
  46. {
  47. virtual ~AudioUnitClient() = default;
  48. virtual void* getAudioUnitHandle() const noexcept = 0;
  49. };
  50. /** Can be used to retrieve information about a VST that is wrapped by an AudioProcessor. */
  51. struct VSTClient
  52. {
  53. virtual ~VSTClient() = default;
  54. virtual void* getAEffectPtr() const noexcept = 0;
  55. };
  56. virtual ~ExtensionsVisitor() = default;
  57. /** Will be called if there is no platform specific information available. */
  58. virtual void visitUnknown (const Unknown&) {}
  59. /** Called with VST3-specific information. */
  60. virtual void visitVST3Client (const VST3Client&) {}
  61. /** Called with VST-specific information. */
  62. virtual void visitVSTClient (const VSTClient&) {}
  63. /** Called with AU-specific information. */
  64. virtual void visitAudioUnitClient (const AudioUnitClient&) {}
  65. };
  66. } // namespace juce