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.

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