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.

175 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. #include <numeric>
  32. //==============================================================================
  33. #if JUCE_MAC
  34. #if JUCE_SUPPORT_CARBON \
  35. && ((JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_AU) \
  36. || ! (defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6))
  37. #include <Carbon/Carbon.h>
  38. #include "../juce_gui_extra/native/juce_mac_CarbonViewWrapperComponent.h"
  39. #endif
  40. #endif
  41. #if JUCE_PLUGINHOST_VST && JUCE_LINUX
  42. #include <X11/Xlib.h>
  43. #include <X11/Xutil.h>
  44. #undef KeyPress
  45. #endif
  46. #if ! JUCE_WINDOWS && ! JUCE_MAC
  47. #undef JUCE_PLUGINHOST_VST3
  48. #define JUCE_PLUGINHOST_VST3 0
  49. #endif
  50. #if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)
  51. #include <AudioUnit/AudioUnit.h>
  52. #include <map>
  53. #endif
  54. //==============================================================================
  55. namespace juce
  56. {
  57. static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
  58. const PluginDescription& desc)
  59. {
  60. for (auto* p : list)
  61. if (p->isDuplicateOf (desc))
  62. return true;
  63. return false;
  64. }
  65. #if JUCE_MAC || JUCE_IOS
  66. #if JUCE_IOS
  67. #define JUCE_IOS_MAC_VIEW UIView
  68. using ViewComponentBaseClass = UIViewComponent;
  69. #else
  70. #define JUCE_IOS_MAC_VIEW NSView
  71. using ViewComponentBaseClass = NSViewComponent;
  72. #endif
  73. //==============================================================================
  74. struct AutoResizingNSViewComponent : public ViewComponentBaseClass,
  75. private AsyncUpdater
  76. {
  77. void childBoundsChanged (Component*) override
  78. {
  79. if (recursive)
  80. {
  81. triggerAsyncUpdate();
  82. }
  83. else
  84. {
  85. recursive = true;
  86. resizeToFitView();
  87. recursive = false;
  88. }
  89. }
  90. void handleAsyncUpdate() override { resizeToFitView(); }
  91. bool recursive = false;
  92. };
  93. //==============================================================================
  94. struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent,
  95. private Timer
  96. {
  97. AutoResizingNSViewComponentWithParent()
  98. {
  99. JUCE_IOS_MAC_VIEW* v = [[JUCE_IOS_MAC_VIEW alloc] init];
  100. setView (v);
  101. [v release];
  102. startTimer (30);
  103. }
  104. JUCE_IOS_MAC_VIEW* getChildView() const
  105. {
  106. if (JUCE_IOS_MAC_VIEW* parent = (JUCE_IOS_MAC_VIEW*) getView())
  107. if ([[parent subviews] count] > 0)
  108. return [[parent subviews] objectAtIndex: 0];
  109. return nil;
  110. }
  111. void timerCallback() override
  112. {
  113. if (JUCE_IOS_MAC_VIEW* child = getChildView())
  114. {
  115. stopTimer();
  116. setView (child);
  117. }
  118. }
  119. };
  120. #endif
  121. } // namespace juce
  122. #if JUCE_CLANG
  123. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  124. #endif
  125. #include "format/juce_AudioPluginFormat.cpp"
  126. #include "format/juce_AudioPluginFormatManager.cpp"
  127. #include "format_types/juce_LegacyAudioParameter.cpp"
  128. #include "processors/juce_AudioProcessor.cpp"
  129. #include "processors/juce_AudioPluginInstance.cpp"
  130. #include "processors/juce_AudioProcessorEditor.cpp"
  131. #include "processors/juce_AudioProcessorGraph.cpp"
  132. #include "processors/juce_GenericAudioProcessorEditor.cpp"
  133. #include "processors/juce_PluginDescription.cpp"
  134. #include "format_types/juce_LADSPAPluginFormat.cpp"
  135. #include "format_types/juce_VSTPluginFormat.cpp"
  136. #include "format_types/juce_VST3PluginFormat.cpp"
  137. #include "format_types/juce_AudioUnitPluginFormat.mm"
  138. #include "scanning/juce_KnownPluginList.cpp"
  139. #include "scanning/juce_PluginDirectoryScanner.cpp"
  140. #include "scanning/juce_PluginListComponent.cpp"
  141. #include "utilities/juce_AudioProcessorParameters.cpp"
  142. #include "processors/juce_AudioProcessorParameterGroup.cpp"
  143. #include "utilities/juce_AudioProcessorValueTreeState.cpp"