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.

159 lines
5.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software 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. #if defined (JUCE_AUDIO_PROCESSORS_H_INCLUDED) && ! JUCE_AMALGAMATED_INCLUDE
  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. // Your project must contain an AppConfig.h file with your project-specific settings in it,
  26. // and your header search path must make it accessible to the module's files.
  27. #include "AppConfig.h"
  28. #include "../juce_core/native/juce_BasicNativeHeaders.h"
  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. #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
  37. #define Component CarbonDummyCompName
  38. #include <Carbon/Carbon.h>
  39. #undef Point
  40. #undef Component
  41. #endif
  42. #endif
  43. #if JUCE_PLUGINHOST_VST && JUCE_LINUX
  44. #include <X11/Xlib.h>
  45. #include <X11/Xutil.h>
  46. #undef KeyPress
  47. #endif
  48. #if ! JUCE_WINDOWS && ! JUCE_MAC
  49. #undef JUCE_PLUGINHOST_VST3
  50. #define JUCE_PLUGINHOST_VST3 0
  51. #endif
  52. //==============================================================================
  53. namespace juce
  54. {
  55. static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
  56. const PluginDescription& desc)
  57. {
  58. for (int i = list.size(); --i >= 0;)
  59. if (list.getUnchecked(i)->isDuplicateOf (desc))
  60. return true;
  61. return false;
  62. }
  63. #if JUCE_MAC
  64. //==============================================================================
  65. struct AutoResizingNSViewComponent : public NSViewComponent,
  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. NSView* v = [[NSView alloc] init];
  92. setView (v);
  93. [v release];
  94. startTimer (30);
  95. }
  96. NSView* getChildView() const
  97. {
  98. if (NSView* parent = (NSView*) getView())
  99. if ([[parent subviews] count] > 0)
  100. return [[parent subviews] objectAtIndex: 0];
  101. return nil;
  102. }
  103. void timerCallback() override
  104. {
  105. if (NSView* 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. }