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.

166 lines
5.1KB

  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. #ifdef JUCE_AUDIO_PROCESSORS_H_INCLUDED
  18. /* When you add this cpp file to your project, you mustn't include it in a file where you've
  19. already included any other headers - just put it inside a file on its own, possibly with your config
  20. flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
  21. header files that the compiler may be using.
  22. */
  23. #error "Incorrect use of JUCE cpp file"
  24. #endif
  25. #define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
  26. #include "juce_audio_processors.h"
  27. #include <juce_gui_extra/juce_gui_extra.h>
  28. //==============================================================================
  29. #if JUCE_MAC
  30. #if JUCE_SUPPORT_CARBON \
  31. && ((JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_AU) \
  32. || ! (defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6))
  33. #include <Carbon/Carbon.h>
  34. #endif
  35. #endif
  36. #if JUCE_PLUGINHOST_VST && JUCE_LINUX
  37. #include <X11/Xlib.h>
  38. #include <X11/Xutil.h>
  39. #undef KeyPress
  40. #endif
  41. #if ! JUCE_WINDOWS && ! JUCE_MAC
  42. #undef JUCE_PLUGINHOST_VST3
  43. #define JUCE_PLUGINHOST_VST3 0
  44. #endif
  45. #if JUCE_IOS
  46. #define IOS_MAC_VIEW UIView
  47. #elif JUCE_MAC
  48. #define IOS_MAC_VIEW NSView
  49. #endif
  50. //==============================================================================
  51. namespace juce
  52. {
  53. static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
  54. const PluginDescription& desc)
  55. {
  56. for (int i = list.size(); --i >= 0;)
  57. if (list.getUnchecked(i)->isDuplicateOf (desc))
  58. return true;
  59. return false;
  60. }
  61. #if JUCE_MAC || JUCE_IOS
  62. //==============================================================================
  63. struct AutoResizingNSViewComponent :
  64. #if JUCE_MAC
  65. public NSViewComponent,
  66. #else
  67. public UIViewComponent,
  68. #endif
  69. private AsyncUpdater
  70. {
  71. AutoResizingNSViewComponent() : recursive (false) {}
  72. void childBoundsChanged (Component*) override
  73. {
  74. if (recursive)
  75. {
  76. triggerAsyncUpdate();
  77. }
  78. else
  79. {
  80. recursive = true;
  81. resizeToFitView();
  82. recursive = true;
  83. }
  84. }
  85. void handleAsyncUpdate() override { resizeToFitView(); }
  86. bool recursive;
  87. };
  88. //==============================================================================
  89. struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent,
  90. private Timer
  91. {
  92. AutoResizingNSViewComponentWithParent()
  93. {
  94. IOS_MAC_VIEW* v = [[IOS_MAC_VIEW alloc] init];
  95. setView (v);
  96. [v release];
  97. startTimer (30);
  98. }
  99. IOS_MAC_VIEW* getChildView() const
  100. {
  101. if (IOS_MAC_VIEW* parent = (IOS_MAC_VIEW*) getView())
  102. if ([[parent subviews] count] > 0)
  103. return [[parent subviews] objectAtIndex: 0];
  104. return nil;
  105. }
  106. void timerCallback() override
  107. {
  108. if (IOS_MAC_VIEW* child = getChildView())
  109. {
  110. stopTimer();
  111. setView (child);
  112. }
  113. }
  114. };
  115. #endif
  116. #if JUCE_CLANG
  117. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  118. #endif
  119. #include "format/juce_AudioPluginFormat.cpp"
  120. #include "format/juce_AudioPluginFormatManager.cpp"
  121. #include "processors/juce_AudioProcessor.cpp"
  122. #include "processors/juce_AudioChannelSet.cpp"
  123. #include "processors/juce_AudioProcessorEditor.cpp"
  124. #include "processors/juce_AudioProcessorGraph.cpp"
  125. #include "processors/juce_GenericAudioProcessorEditor.cpp"
  126. #include "processors/juce_PluginDescription.cpp"
  127. #include "format_types/juce_LADSPAPluginFormat.cpp"
  128. #include "format_types/juce_VSTPluginFormat.cpp"
  129. #include "format_types/juce_VST3PluginFormat.cpp"
  130. #include "format_types/juce_AudioUnitPluginFormat.mm"
  131. #include "scanning/juce_KnownPluginList.cpp"
  132. #include "scanning/juce_PluginDirectoryScanner.cpp"
  133. #include "scanning/juce_PluginListComponent.cpp"
  134. #include "utilities/juce_AudioProcessorValueTreeState.cpp"
  135. #include "utilities/juce_AudioProcessorParameters.cpp"
  136. }