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.

158 lines
5.0KB

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