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.

163 lines
5.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  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 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #ifdef JUCE_AUDIO_PROCESSORS_H_INCLUDED
  20. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  21. already included any other headers - just put it inside a file on its own, possibly with your config
  22. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  23. header files that the compiler may be using.
  24. */
  25. #error "Incorrect use of JUCE cpp file"
  26. #endif
  27. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  28. #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
  29. #include "juce_audio_processors.h"
  30. #include <juce_gui_extra/juce_gui_extra.h>
  31. //==============================================================================
  32. #if JUCE_MAC
  33. #if JUCE_SUPPORT_CARBON && (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_AU)
  34. #include <Carbon/Carbon.h>
  35. #include "../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h"
  36. #endif
  37. #endif
  38. #if JUCE_PLUGINHOST_VST && JUCE_LINUX
  39. #include <X11/Xlib.h>
  40. #include <X11/Xutil.h>
  41. #undef KeyPress
  42. #endif
  43. #if ! JUCE_WINDOWS && ! JUCE_MAC
  44. #undef JUCE_PLUGINHOST_VST3
  45. #define JUCE_PLUGINHOST_VST3 0
  46. #endif
  47. #if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)
  48. #include <AudioUnit/AudioUnit.h>
  49. #endif
  50. //==============================================================================
  51. namespace juce
  52. {
  53. static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
  54. const PluginDescription& desc)
  55. {
  56. for (auto* p : list)
  57. if (p->isDuplicateOf (desc))
  58. return true;
  59. return false;
  60. }
  61. #if JUCE_MAC || JUCE_IOS
  62. #if JUCE_IOS
  63. #define JUCE_IOS_MAC_VIEW UIView
  64. using ViewComponentBaseClass = UIViewComponent;
  65. #else
  66. #define JUCE_IOS_MAC_VIEW NSView
  67. using ViewComponentBaseClass = NSViewComponent;
  68. #endif
  69. //==============================================================================
  70. struct AutoResizingNSViewComponent : public ViewComponentBaseClass,
  71. private AsyncUpdater
  72. {
  73. void childBoundsChanged (Component*) override { triggerAsyncUpdate(); }
  74. void handleAsyncUpdate() override { resizeToFitView(); }
  75. };
  76. //==============================================================================
  77. struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent,
  78. private Timer
  79. {
  80. AutoResizingNSViewComponentWithParent()
  81. {
  82. JUCE_IOS_MAC_VIEW* v = [[JUCE_IOS_MAC_VIEW alloc] init];
  83. setView (v);
  84. [v release];
  85. startTimer (30);
  86. }
  87. JUCE_IOS_MAC_VIEW* getChildView() const
  88. {
  89. if (JUCE_IOS_MAC_VIEW* parent = (JUCE_IOS_MAC_VIEW*) getView())
  90. if ([[parent subviews] count] > 0)
  91. return [[parent subviews] objectAtIndex: 0];
  92. return nil;
  93. }
  94. void timerCallback() override
  95. {
  96. if (JUCE_IOS_MAC_VIEW* child = getChildView())
  97. {
  98. stopTimer();
  99. setView (child);
  100. }
  101. }
  102. };
  103. #endif
  104. } // namespace juce
  105. #if JUCE_CLANG
  106. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  107. #if __has_warning("-Wcast-align")
  108. #pragma clang diagnostic ignored "-Wcast-align"
  109. #endif
  110. #endif
  111. #include "format/juce_AudioPluginFormat.cpp"
  112. #include "format/juce_AudioPluginFormatManager.cpp"
  113. #include "format_types/juce_LegacyAudioParameter.cpp"
  114. #include "processors/juce_AudioProcessor.cpp"
  115. #include "processors/juce_AudioPluginInstance.cpp"
  116. #include "processors/juce_AudioProcessorEditor.cpp"
  117. #include "processors/juce_AudioProcessorGraph.cpp"
  118. #include "processors/juce_GenericAudioProcessorEditor.cpp"
  119. #include "processors/juce_PluginDescription.cpp"
  120. #include "format_types/juce_LADSPAPluginFormat.cpp"
  121. #include "format_types/juce_VSTPluginFormat.cpp"
  122. #include "format_types/juce_VST3PluginFormat.cpp"
  123. #include "format_types/juce_AudioUnitPluginFormat.mm"
  124. #include "scanning/juce_KnownPluginList.cpp"
  125. #include "scanning/juce_PluginDirectoryScanner.cpp"
  126. #include "scanning/juce_PluginListComponent.cpp"
  127. #include "processors/juce_AudioProcessorParameterGroup.cpp"
  128. #include "utilities/juce_AudioProcessorParameterWithID.cpp"
  129. #include "utilities/juce_RangedAudioParameter.cpp"
  130. #include "utilities/juce_AudioParameterFloat.cpp"
  131. #include "utilities/juce_AudioParameterInt.cpp"
  132. #include "utilities/juce_AudioParameterBool.cpp"
  133. #include "utilities/juce_AudioParameterChoice.cpp"
  134. #include "utilities/juce_AudioProcessorValueTreeState.cpp"