1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
/*
==============================================================================
This file is part of the JUCE framework.
Copyright (c) Raw Material Software Limited
JUCE is an open source framework subject to commercial or open source
licensing.
By downloading, installing, or using the JUCE framework, or combining the
JUCE framework with any other source code, object code, content or any other
copyrightable work, you agree to the terms of the JUCE End User Licence
Agreement, and all incorporated terms including the JUCE Privacy Policy and
the JUCE Website Terms of Service, as applicable, which will bind you. If you
do not agree to the terms of these agreements, we will not license the JUCE
framework to you, and you must discontinue the installation or download
process and cease use of the JUCE framework.
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
Or:
You may also use this code under the terms of the AGPLv3:
https://www.gnu.org/licenses/agpl-3.0.en.html
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
#ifdef JUCE_AUDIO_PROCESSORS_H_INCLUDED
/* When you add this cpp file to your project, you mustn't include it in a file where you've
already included any other headers - just put it inside a file on its own, possibly with your config
flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
header files that the compiler may be using.
*/
#error "Incorrect use of JUCE cpp file"
#endif
#define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
#define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
#define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1
#define JUCE_GUI_BASICS_INCLUDE_SCOPED_THREAD_DPI_AWARENESS_SETTER 1
#define JUCE_GRAPHICS_INCLUDE_COREGRAPHICS_HELPERS 1
#include "juce_audio_processors.h"
#include <juce_gui_extra/juce_gui_extra.h>
//==============================================================================
#if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && (JUCE_LINUX || JUCE_BSD)
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wvariadic-macros")
#include <X11/Xlib.h>
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#include <X11/Xutil.h>
#include <sys/utsname.h>
#undef KeyPress
#endif
#if ! JUCE_WINDOWS && ! JUCE_MAC && ! JUCE_LINUX
#undef JUCE_PLUGINHOST_VST3
#define JUCE_PLUGINHOST_VST3 0
#endif
#if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)
#include <AudioUnit/AudioUnit.h>
#endif
namespace juce
{
#if JUCE_PLUGINHOST_VST || (JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD))
static bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
const PluginDescription& desc)
{
for (auto* p : list)
if (p->isDuplicateOf (desc))
return true;
return false;
}
#endif
template <typename Callback>
void callOnMessageThread (Callback&& callback)
{
if (MessageManager::getInstance()->existsAndIsLockedByCurrentThread())
{
callback();
return;
}
WaitableEvent completionEvent;
MessageManager::callAsync ([&callback, &completionEvent]
{
callback();
completionEvent.signal();
});
completionEvent.wait();
}
#if JUCE_MAC
//==============================================================================
/* This is an NSViewComponent which holds a long-lived NSView which acts
as the parent view for plugin editors.
Note that this component does not auto-resize depending on the bounds
of the owned view. VST2 and VST3 plugins have dedicated interfaces to
request that the editor bounds are updated. We can call `setSize` on this
component from inside those dedicated callbacks.
*/
struct NSViewComponentWithParent : public NSViewComponent,
private AsyncUpdater
{
enum class WantsNudge { no, yes };
explicit NSViewComponentWithParent (WantsNudge shouldNudge)
: wantsNudge (shouldNudge)
{
auto* view = [[getViewClass().createInstance() init] autorelease];
object_setInstanceVariable (view, "owner", this);
setView (view);
}
explicit NSViewComponentWithParent (AudioPluginInstance& instance)
: NSViewComponentWithParent (getWantsNudge (instance)) {}
~NSViewComponentWithParent() override
{
if (auto* view = static_cast<NSView*> (getView()))
object_setInstanceVariable (view, "owner", nullptr);
cancelPendingUpdate();
}
JUCE_DECLARE_NON_COPYABLE (NSViewComponentWithParent)
JUCE_DECLARE_NON_MOVEABLE (NSViewComponentWithParent)
private:
WantsNudge wantsNudge = WantsNudge::no;
static WantsNudge getWantsNudge (AudioPluginInstance& instance)
{
PluginDescription pd;
instance.fillInPluginDescription (pd);
return pd.manufacturerName == "FabFilter" ? WantsNudge::yes : WantsNudge::no;
}
void handleAsyncUpdate() override
{
if (auto* peer = getTopLevelComponent()->getPeer())
{
auto* view = static_cast<NSView*> (getView());
const auto newArea = peer->getAreaCoveredBy (*this);
[view setFrame: makeNSRect (newArea.withHeight (newArea.getHeight() + 1))];
[view setFrame: makeNSRect (newArea)];
}
}
struct InnerNSView final : public ObjCClass<NSView>
{
InnerNSView()
: ObjCClass ("JuceInnerNSView_")
{
addIvar<NSViewComponentWithParent*> ("owner");
addMethod (@selector (isOpaque), [] (id, SEL) { return YES; });
addMethod (@selector (didAddSubview:), [] (id self, SEL, NSView*)
{
if (auto* owner = getIvar<NSViewComponentWithParent*> (self, "owner"))
if (owner->wantsNudge == WantsNudge::yes)
owner->triggerAsyncUpdate();
});
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector")
addMethod (@selector (clipsToBounds), [] (id, SEL) { return YES; });
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
registerClass();
}
};
static InnerNSView& getViewClass()
{
static InnerNSView result;
return result;
}
};
#endif
} // namespace juce
#include "utilities/juce_FlagCache.h"
#include "format/juce_AudioPluginFormat.cpp"
#include "format/juce_AudioPluginFormatManager.cpp"
#include "format_types/juce_LegacyAudioParameter.cpp"
#include "processors/juce_AudioProcessor.cpp"
#include "processors/juce_AudioPluginInstance.cpp"
#include "processors/juce_AudioProcessorEditor.cpp"
#include "processors/juce_AudioProcessorGraph.cpp"
#include "processors/juce_GenericAudioProcessorEditor.cpp"
#include "processors/juce_PluginDescription.cpp"
#include "format_types/juce_ARACommon.cpp"
#include "format_types/juce_LADSPAPluginFormat.cpp"
#include "format_types/juce_VSTPluginFormat.cpp"
#include "format_types/juce_VST3PluginFormat.cpp"
#include "format_types/juce_AudioUnitPluginFormat.mm"
#include "format_types/juce_ARAHosting.cpp"
#include "scanning/juce_KnownPluginList.cpp"
#include "scanning/juce_PluginDirectoryScanner.cpp"
#include "scanning/juce_PluginListComponent.cpp"
#include "processors/juce_AudioProcessorParameterGroup.cpp"
#include "utilities/juce_AudioProcessorParameterWithID.cpp"
#include "utilities/juce_RangedAudioParameter.cpp"
#include "utilities/juce_AudioParameterFloat.cpp"
#include "utilities/juce_AudioParameterInt.cpp"
#include "utilities/juce_AudioParameterBool.cpp"
#include "utilities/juce_AudioParameterChoice.cpp"
#include "utilities/juce_ParameterAttachments.cpp"
#include "utilities/juce_AudioProcessorValueTreeState.cpp"
#include "utilities/juce_PluginHostType.cpp"
#include "utilities/juce_AAXClientExtensions.cpp"
#include "utilities/juce_VST2ClientExtensions.cpp"
#include "utilities/juce_VST3ClientExtensions.cpp"
#include "utilities/ARA/juce_ARA_utils.cpp"
#include "format_types/juce_LV2PluginFormat.cpp"
#if JUCE_UNIT_TESTS
#if JUCE_PLUGINHOST_VST3
#include "format_types/juce_VST3PluginFormat_test.cpp"
#endif
#if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS))
#include "format_types/juce_LV2PluginFormat_test.cpp"
#endif
#endif
|