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.

178 lines
5.5KB

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