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.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. //==============================================================================
  46. namespace juce
  47. {
  48. static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
  49. const PluginDescription& desc)
  50. {
  51. for (int i = list.size(); --i >= 0;)
  52. if (list.getUnchecked(i)->isDuplicateOf (desc))
  53. return true;
  54. return false;
  55. }
  56. #if JUCE_MAC || JUCE_IOS
  57. #if JUCE_IOS
  58. #define JUCE_IOS_MAC_VIEW UIView
  59. typedef UIViewComponent ViewComponentBaseClass;
  60. #else
  61. #define JUCE_IOS_MAC_VIEW NSView
  62. typedef NSViewComponent ViewComponentBaseClass;
  63. #endif
  64. //==============================================================================
  65. struct AutoResizingNSViewComponent : public ViewComponentBaseClass,
  66. private AsyncUpdater
  67. {
  68. AutoResizingNSViewComponent() : recursive (false) {}
  69. void childBoundsChanged (Component*) override
  70. {
  71. if (recursive)
  72. {
  73. triggerAsyncUpdate();
  74. }
  75. else
  76. {
  77. recursive = true;
  78. resizeToFitView();
  79. recursive = true;
  80. }
  81. }
  82. void handleAsyncUpdate() override { resizeToFitView(); }
  83. bool recursive;
  84. };
  85. //==============================================================================
  86. struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent,
  87. private Timer
  88. {
  89. AutoResizingNSViewComponentWithParent()
  90. {
  91. JUCE_IOS_MAC_VIEW* v = [[JUCE_IOS_MAC_VIEW alloc] init];
  92. setView (v);
  93. [v release];
  94. startTimer (30);
  95. }
  96. JUCE_IOS_MAC_VIEW* getChildView() const
  97. {
  98. if (JUCE_IOS_MAC_VIEW* parent = (JUCE_IOS_MAC_VIEW*) getView())
  99. if ([[parent subviews] count] > 0)
  100. return [[parent subviews] objectAtIndex: 0];
  101. return nil;
  102. }
  103. void timerCallback() override
  104. {
  105. if (JUCE_IOS_MAC_VIEW* child = getChildView())
  106. {
  107. stopTimer();
  108. setView (child);
  109. }
  110. }
  111. };
  112. #endif
  113. #if JUCE_CLANG
  114. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  115. #endif
  116. #include "format/juce_AudioPluginFormat.cpp"
  117. #include "format/juce_AudioPluginFormatManager.cpp"
  118. #include "processors/juce_AudioProcessor.cpp"
  119. #include "processors/juce_AudioProcessorEditor.cpp"
  120. #include "processors/juce_AudioProcessorGraph.cpp"
  121. #include "processors/juce_GenericAudioProcessorEditor.cpp"
  122. #include "processors/juce_PluginDescription.cpp"
  123. #include "format_types/juce_LADSPAPluginFormat.cpp"
  124. #include "format_types/juce_VSTPluginFormat.cpp"
  125. #include "format_types/juce_VST3PluginFormat.cpp"
  126. #include "format_types/juce_AudioUnitPluginFormat.mm"
  127. #include "scanning/juce_KnownPluginList.cpp"
  128. #include "scanning/juce_PluginDirectoryScanner.cpp"
  129. #include "scanning/juce_PluginListComponent.cpp"
  130. #include "utilities/juce_AudioProcessorValueTreeState.cpp"
  131. #include "utilities/juce_AudioProcessorParameters.cpp"
  132. }