git subrepo clone --branch=sono6good https://github.com/essej/JUCE.git deps/juce

subrepo:
  subdir:   "deps/juce"
  merged:   "b13f9084e"
upstream:
  origin:   "https://github.com/essej/JUCE.git"
  branch:   "sono6good"
  commit:   "b13f9084e"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
essej
2022-04-18 17:51:22 -04:00
parent 63e175fee6
commit 25bd5d8adb
3210 changed files with 1045392 additions and 0 deletions
deps/juce
.gitattributes
.github
.gitignore.gitlab-ci.yml.gitrepoBREAKING-CHANGES.txtCMakeLists.txtChangeList.txtLICENSE.mdREADME.md
docs
examples
Assets
Audio
CMake
CMakeLists.txt
DSP
DemoRunner
Builds
Android
app
CMakeLists.txtbuild.gradle
src
debug
res
main
AndroidManifest.xml
assets
res
drawable-hdpi
drawable-ldpi
drawable-mdpi
drawable-xhdpi
release
res
build.gradle
gradle
gradlewgradlew.batsettings.gradle
LinuxMakefile
MacOSX
VisualStudio2015
VisualStudio2017
VisualStudio2019
iOS
CMakeLists.txtDemoRunner.jucer
JuceLibraryCode
Source
GUI
Plugins
Utilities
extras
AudioPerformanceTest
AudioPerformanceTest.jucer
Builds
CMakeLists.txt
JuceLibraryCode
Source
AudioPluginHost
AudioPluginHost.jucer
Builds
Android
app
CMakeLists.txtbuild.gradle
src
debug
res
main
AndroidManifest.xml
assets
res
drawable-hdpi
drawable-ldpi
drawable-mdpi
drawable-xhdpi
release
res
build.gradle
gradle
gradlewgradlew.batsettings.gradle
LinuxMakefile
MacOSX
VisualStudio2015
VisualStudio2017
VisualStudio2019
iOS
CMakeLists.txt
JuceLibraryCode
Source
BinaryBuilder
Build
CMakeLists.txt
NetworkGraphicsDemo
Builds
CMakeLists.txt
JuceLibraryCode
NetworkGraphicsDemo.jucerREADME.txt
Source
Projucer
Builds
CMakeLists.txt
JuceLibraryCode
Projucer.jucer
Source
Application
BinaryData
CodeEditor
ComponentEditor
Components
Documents
PaintElements
Properties
UI
jucer_BinaryResources.cppjucer_BinaryResources.hjucer_ComponentLayout.cppjucer_ComponentLayout.hjucer_GeneratedCode.cppjucer_GeneratedCode.hjucer_JucerDocument.cppjucer_JucerDocument.hjucer_ObjectTypes.cppjucer_ObjectTypes.hjucer_PaintRoutine.cppjucer_PaintRoutine.hjucer_UtilityFunctions.h
Licenses
LiveBuildEngine
Project
ProjectSaving
Settings
Utility
UnitTestRunner
WindowsDLL
modules
CMakeLists.txt
juce_analytics
juce_audio_basics
audio_play_head
buffers
juce_audio_basics.cppjuce_audio_basics.hjuce_audio_basics.mm
midi
mpe
native
sources
synthesisers
utilities
juce_audio_devices
audio_io
juce_audio_devices.cppjuce_audio_devices.hjuce_audio_devices.mm
midi_io
native
java
app
juce_android_Audio.cppjuce_android_HighPerformanceAudioHelpers.hjuce_android_Midi.cppjuce_android_Oboe.cppjuce_android_OpenSL.cppjuce_ios_Audio.cppjuce_ios_Audio.hjuce_linux_ALSA.cppjuce_linux_Bela.cppjuce_linux_JackAudio.cppjuce_linux_Midi.cppjuce_mac_CoreAudio.cppjuce_mac_CoreMidi.mmjuce_win32_ASIO.cppjuce_win32_DirectSound.cppjuce_win32_Midi.cppjuce_win32_WASAPI.cpp
oboe
CMakeLists.txtLICENSEREADME.md
include
src
aaudio
common
fifo
flowgraph
opensles
sources
juce_audio_formats
codecs
flac
juce_AiffAudioFormat.cppjuce_AiffAudioFormat.hjuce_CoreAudioFormat.cppjuce_CoreAudioFormat.hjuce_FlacAudioFormat.cppjuce_FlacAudioFormat.hjuce_LAMEEncoderAudioFormat.cppjuce_LAMEEncoderAudioFormat.hjuce_MP3AudioFormat.cppjuce_MP3AudioFormat.hjuce_OggVorbisAudioFormat.cppjuce_OggVorbisAudioFormat.hjuce_WavAudioFormat.cppjuce_WavAudioFormat.hjuce_WindowsMediaAudioFormat.cppjuce_WindowsMediaAudioFormat.h
oggvorbis
format
juce_audio_formats.cppjuce_audio_formats.hjuce_audio_formats.mm
sampler
juce_audio_plugin_client
AAX
AU
AUResources.r
RTAS
Standalone
Unity
VST
VST3
juce_audio_plugin_client.hjuce_audio_plugin_client_AAX.cppjuce_audio_plugin_client_AAX.mmjuce_audio_plugin_client_AU.rjuce_audio_plugin_client_AU_1.mmjuce_audio_plugin_client_AU_2.mmjuce_audio_plugin_client_AUv3.mmjuce_audio_plugin_client_RTAS.rjuce_audio_plugin_client_RTAS_1.cppjuce_audio_plugin_client_RTAS_2.cppjuce_audio_plugin_client_RTAS_3.cppjuce_audio_plugin_client_RTAS_4.cppjuce_audio_plugin_client_RTAS_utils.cppjuce_audio_plugin_client_RTAS_utils.mmjuce_audio_plugin_client_Standalone.cppjuce_audio_plugin_client_Unity.cppjuce_audio_plugin_client_VST2.cppjuce_audio_plugin_client_VST3.cppjuce_audio_plugin_client_VST_utils.mmjuce_audio_plugin_client_utils.cpp
utility
juce_audio_processors
format
format_types
VST3_SDK
JUCE_README.mdLICENSE.txtREADME.mdVST3_License_Agreement.pdfVST3_Usage_Guidelines.pdf
base
pluginterfaces
public.sdk
juce_AU_Shared.hjuce_AudioUnitPluginFormat.hjuce_AudioUnitPluginFormat.mmjuce_LADSPAPluginFormat.cppjuce_LADSPAPluginFormat.hjuce_LegacyAudioParameter.cppjuce_VST3Common.hjuce_VST3Headers.hjuce_VST3PluginFormat.cppjuce_VST3PluginFormat.hjuce_VSTCommon.hjuce_VSTMidiEventList.hjuce_VSTPluginFormat.cppjuce_VSTPluginFormat.h
juce_audio_processors.cppjuce_audio_processors.hjuce_audio_processors.mm
processors
scanning
utilities
juce_audio_utils
juce_box2d
box2d
Box2D.h
Collision
Common
Dynamics
README.txt
Rope
juce_box2d.cppjuce_box2d.h
utils
juce_core
containers
files
javascript
juce_core.cppjuce_core.hjuce_core.mm
logging
maths
memory
misc
native
network
streams
system
text
threads
time
unit_tests
xml
zip
juce_cryptography
juce_data_structures
juce_dsp
containers
filter_design
frequency
juce_dsp.cppjuce_dsp.hjuce_dsp.mm
maths
native
processors
widgets
juce_events
juce_graphics
colour
contexts
effects
fonts
geometry
image_formats
images
juce_graphics.cppjuce_graphics.hjuce_graphics.mm
native
placement
juce_gui_basics
accessibility
application
buttons
commands
components
desktop
drawables
filebrowser
juce_gui_basics.cppjuce_gui_basics.hjuce_gui_basics.mm
keyboard
layout
lookandfeel
menus
misc
mouse
native
accessibility
java
javaopt
juce_MultiTouchMapper.hjuce_ScopedDPIAwarenessDisabler.hjuce_android_ContentSharer.cppjuce_android_FileChooser.cppjuce_android_Windowing.cppjuce_common_MimeTypes.cppjuce_ios_ContentSharer.cppjuce_ios_FileChooser.mmjuce_ios_UIViewComponentPeer.mmjuce_ios_Windowing.mmjuce_linux_FileChooser.cppjuce_linux_Windowing.cppjuce_mac_FileChooser.mmjuce_mac_MainMenu.mmjuce_mac_MouseCursor.mmjuce_mac_NSViewComponentPeer.mmjuce_mac_Windowing.mmjuce_win32_DragAndDrop.cppjuce_win32_FileChooser.cppjuce_win32_ScopedThreadDPIAwarenessSetter.hjuce_win32_Windowing.cpp
x11
positioning
properties
widgets
windows
juce_gui_extra
code_editor
documents
embedding
juce_gui_extra.cppjuce_gui_extra.hjuce_gui_extra.mm
misc
native
juce_opengl
juce_osc
juce_product_unlocking
juce_video

@ -0,0 +1,80 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
#if JUCE_SUPPORT_CARBON && JUCE_MAC_WINDOW_VISIBITY_BODGE
/* When you wrap a WindowRef as an NSWindow, it seems to bugger up the HideWindow
function, so when the host tries (and fails) to hide the window, this stuff catches
the event and forces it to update.
*/
static pascal OSStatus windowVisibilityBodge (EventHandlerCallRef, EventRef e, void* user)
{
NSWindow* hostWindow = (NSWindow*) user;
switch (GetEventKind (e))
{
case kEventWindowInit: [hostWindow display]; break;
case kEventWindowShown: [hostWindow orderFront: nil]; break;
case kEventWindowHidden: [hostWindow orderOut: nil]; break;
}
return eventNotHandledErr;
}
inline void attachWindowHidingHooks (Component* comp, void* hostWindowRef, NSWindow* nsWindow)
{
const EventTypeSpec eventsToCatch[] =
{
{ kEventClassWindow, kEventWindowInit },
{ kEventClassWindow, kEventWindowShown },
{ kEventClassWindow, kEventWindowHidden }
};
EventHandlerRef ref;
InstallWindowEventHandler ((WindowRef) hostWindowRef,
NewEventHandlerUPP (windowVisibilityBodge),
GetEventTypeCount (eventsToCatch), eventsToCatch,
(void*) nsWindow, &ref);
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
}
inline void removeWindowHidingHooks (Component* comp)
{
if (comp != nullptr)
RemoveEventHandler ((EventHandlerRef) (void*) (pointer_sized_int)
comp->getProperties() ["carbonEventRef"].toString().getHexValue64());
}
#elif JUCE_MAC
inline void attachWindowHidingHooks (void*, void*, void*) {}
inline void removeWindowHidingHooks (void*) {}
#endif
} // namespace juce

@ -0,0 +1,93 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
// The following checks should cause a compile error if you've forgotten to
// define all your plugin settings properly..
#if ! (JucePlugin_Build_VST || JucePlugin_Build_VST3 \
|| JucePlugin_Build_AU || JucePlugin_Build_AUv3 \
||JucePlugin_Build_RTAS || JucePlugin_Build_AAX \
|| JucePlugin_Build_Standalone || JucePlugin_Build_LV2 \
|| JucePlugin_Build_Unity)
#error "You need to enable at least one plugin format!"
#endif
#ifdef JUCE_CHECKSETTINGMACROS_H
#error "This header should never be included twice! Otherwise something is wrong."
#endif
#define JUCE_CHECKSETTINGMACROS_H
#ifndef JucePlugin_IsSynth
#error "You need to define the JucePlugin_IsSynth value!"
#endif
#ifndef JucePlugin_ManufacturerCode
#error "You need to define the JucePlugin_ManufacturerCode value!"
#endif
#ifndef JucePlugin_PluginCode
#error "You need to define the JucePlugin_PluginCode value!"
#endif
#ifndef JucePlugin_ProducesMidiOutput
#error "You need to define the JucePlugin_ProducesMidiOutput value!"
#endif
#ifndef JucePlugin_WantsMidiInput
#error "You need to define the JucePlugin_WantsMidiInput value!"
#endif
#ifdef JucePlugin_Latency
#error "JucePlugin_Latency is now deprecated - instead, call the AudioProcessor::setLatencySamples() method if your plugin has a non-zero delay"
#endif
#ifndef JucePlugin_EditorRequiresKeyboardFocus
#error "You need to define the JucePlugin_EditorRequiresKeyboardFocus value!"
#endif
//==============================================================================
#if _WIN64 || (__LP64__ && (defined (__APPLE_CPP__) || defined (__APPLE_CC__)))
#undef JucePlugin_Build_RTAS
#define JucePlugin_Build_RTAS 0
#endif
#if ! (defined (_MSC_VER) || defined (__APPLE_CPP__) || defined (__APPLE_CC__) || defined (LINUX) || defined (__linux__))
#undef JucePlugin_Build_VST3
#define JucePlugin_Build_VST3 0
#endif
//==============================================================================
#if JucePlugin_Build_LV2 && ! defined (JucePlugin_LV2URI)
#error "You need to define the JucePlugin_LV2URI value!"
#endif
#if JucePlugin_Build_AAX && ! defined (JucePlugin_AAXIdentifier)
#error "You need to define the JucePlugin_AAXIdentifier value!"
#endif
#if defined (__ppc__)
#undef JucePlugin_Build_AAX
#define JucePlugin_Build_AAX 0
#endif

@ -0,0 +1,48 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#pragma once
/** Somewhere in the codebase of your plugin, you need to implement this function
and make it return a new instance of the filter subclass that you're building.
*/
juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter();
namespace juce
{
inline AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
{
AudioProcessor::setTypeOfNextNewPlugin (type);
AudioProcessor* const pluginInstance = ::createPluginFilter();
AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
// your createPluginFilter() method must return an object!
jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
return pluginInstance;
}
} // namespace juce

@ -0,0 +1,119 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
#ifndef DOXYGEN
#if JUCE_MAC
//==============================================================================
// Helper class to workaround windows not getting mouse-moves...
class FakeMouseMoveGenerator : private Timer
{
public:
FakeMouseMoveGenerator()
{
startTimer (1000 / 30);
}
static bool componentContainsAudioProcessorEditor (Component* comp) noexcept
{
if (dynamic_cast<AudioProcessorEditor*> (comp) != nullptr)
return true;
for (auto* child : comp->getChildren())
if (componentContainsAudioProcessorEditor (child))
return true;
return false;
}
void timerCallback() override
{
// Workaround for windows not getting mouse-moves...
auto screenPos = Desktop::getInstance().getMainMouseSource().getScreenPosition();
if (screenPos != lastScreenPos)
{
lastScreenPos = screenPos;
auto mods = ModifierKeys::currentModifiers;
if (! mods.isAnyMouseButtonDown())
{
if (auto* comp = Desktop::getInstance().findComponentAt (screenPos.roundToInt()))
{
if (componentContainsAudioProcessorEditor (comp->getTopLevelComponent()))
{
safeOldComponent = comp;
if (auto* peer = comp->getPeer())
{
if (! peer->isFocused())
{
peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse,
peer->globalToLocal (Desktop::getInstance().getMainMouseSource().getRawScreenPosition()),
mods,
MouseInputSource::invalidPressure,
MouseInputSource::invalidOrientation,
Time::currentTimeMillis());
}
}
return;
}
}
if (safeOldComponent != nullptr)
{
if (auto* peer = safeOldComponent->getPeer())
{
peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse,
MouseInputSource::offscreenMousePos,
mods,
MouseInputSource::invalidPressure,
MouseInputSource::invalidOrientation,
Time::currentTimeMillis());
}
}
safeOldComponent = nullptr;
}
}
}
private:
Point<float> lastScreenPos;
WeakReference<Component> safeOldComponent;
};
#else
struct FakeMouseMoveGenerator {};
#endif
#endif
} // namespace juce

@ -0,0 +1,44 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#include <juce_audio_plugin_client/juce_audio_plugin_client.h>
#include "juce_CreatePluginFilter.h"
namespace juce
{
#define Component juce::Component
#if JUCE_MAC
#define Point juce::Point
void repostCurrentNSEvent();
#endif
//==============================================================================
inline const PluginHostType& getHostType()
{
static PluginHostType hostType;
return hostType;
}
}

@ -0,0 +1,65 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#if JUCE_WINDOWS
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#undef STRICT
#define STRICT 1
#include <windows.h>
#include <float.h>
#if JUCE_MSVC
#pragma warning (disable : 4312 4355)
#endif
#ifdef __INTEL_COMPILER
#pragma warning (disable : 1899)
#endif
#elif JUCE_LINUX || JUCE_BSD
#include <float.h>
#include <sys/time.h>
#include <arpa/inet.h>
#elif JUCE_MAC || JUCE_IOS
#if ! (defined (JUCE_SUPPORT_CARBON) || defined (__LP64__))
#define JUCE_SUPPORT_CARBON 1
#endif
#ifdef __OBJC__
#if JUCE_MAC
#include <Cocoa/Cocoa.h>
#elif JUCE_IOS
#include <UIKit/UIKit.h>
#else
#error
#endif
#endif
#if JUCE_SUPPORT_CARBON && (! JUCE_IOS)
#include <Carbon/Carbon.h>
#endif
#include <objc/runtime.h>
#include <objc/objc.h>
#include <objc/message.h>
#endif

@ -0,0 +1,104 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#if JUCE_LINUX || JUCE_BSD
#include <thread>
namespace juce
{
// Implemented in juce_linux_Messaging.cpp
bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages);
/** @internal */
class MessageThread
{
public:
MessageThread()
{
start();
}
~MessageThread()
{
MessageManager::getInstance()->stopDispatchLoop();
stop();
}
void start()
{
if (isRunning())
stop();
shouldExit = false;
thread = std::thread { [this]
{
Thread::setCurrentThreadPriority (7);
Thread::setCurrentThreadName ("JUCE Plugin Message Thread");
MessageManager::getInstance()->setCurrentThreadAsMessageThread();
XWindowSystem::getInstance();
threadInitialised.signal();
for (;;)
{
if (! dispatchNextMessageOnSystemQueue (true))
Thread::sleep (1);
if (shouldExit)
break;
}
} };
threadInitialised.wait();
}
void stop()
{
if (! isRunning())
return;
shouldExit = true;
thread.join();
}
bool isRunning() const noexcept { return thread.joinable(); }
private:
WaitableEvent threadInitialised;
std::thread thread;
std::atomic<bool> shouldExit { false };
JUCE_DECLARE_NON_MOVEABLE (MessageThread)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MessageThread)
};
} // namespace juce
#endif

@ -0,0 +1,152 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#if _MSC_VER || defined (__MINGW32__) || defined (__MINGW64__)
#include <windows.h>
#endif
#include <juce_core/system/juce_TargetPlatform.h>
#include "../utility/juce_CheckSettingMacros.h"
#include "juce_IncludeModuleHeaders.h"
namespace juce
{
#if JucePlugin_Build_Unity
bool juce_isRunningInUnity() { return PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_Unity; }
#endif
#ifndef JUCE_VST3_CAN_REPLACE_VST2
#define JUCE_VST3_CAN_REPLACE_VST2 1
#endif
#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD)
#define VST3_REPLACEMENT_AVAILABLE 1
// NB: Nasty old-fashioned code in here because it's copied from the Steinberg example code.
void JUCE_API getUUIDForVST2ID (bool forControllerUID, uint8 uuid[16])
{
#if JUCE_MSVC
const auto juce_sprintf = [] (auto&& head, auto&&... tail) { sprintf_s (head, numElementsInArray (head), tail...); };
const auto juce_strcpy = [] (auto&& head, auto&&... tail) { strcpy_s (head, numElementsInArray (head), tail...); };
const auto juce_strcat = [] (auto&& head, auto&&... tail) { strcat_s (head, numElementsInArray (head), tail...); };
const auto juce_sscanf = [] (auto&&... args) { sscanf_s (args...); };
#else
const auto juce_sprintf = [] (auto&&... args) { sprintf (args...); };
const auto juce_strcpy = [] (auto&&... args) { strcpy (args...); };
const auto juce_strcat = [] (auto&&... args) { strcat (args...); };
const auto juce_sscanf = [] (auto&&... args) { sscanf (args...); };
#endif
char uidString[33];
const int vstfxid = (('V' << 16) | ('S' << 8) | (forControllerUID ? 'E' : 'T'));
char vstfxidStr[7] = { 0 };
juce_sprintf (vstfxidStr, "%06X", vstfxid);
juce_strcpy (uidString, vstfxidStr);
char uidStr[9] = { 0 };
juce_sprintf (uidStr, "%08X", JucePlugin_VSTUniqueID);
juce_strcat (uidString, uidStr);
char nameidStr[3] = { 0 };
const size_t len = strlen (JucePlugin_Name);
for (size_t i = 0; i <= 8; ++i)
{
juce::uint8 c = i < len ? static_cast<juce::uint8> (JucePlugin_Name[i]) : 0;
if (c >= 'A' && c <= 'Z')
c += 'a' - 'A';
juce_sprintf (nameidStr, "%02X", c);
juce_strcat (uidString, nameidStr);
}
unsigned long p0;
unsigned int p1, p2;
unsigned int p3[8];
juce_sscanf (uidString, "%08lX%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
&p0, &p1, &p2, &p3[0], &p3[1], &p3[2], &p3[3], &p3[4], &p3[5], &p3[6], &p3[7]);
union q0_u {
uint32 word;
uint8 bytes[4];
} q0;
union q1_u {
uint16 half;
uint8 bytes[2];
} q1, q2;
q0.word = static_cast<uint32> (p0);
q1.half = static_cast<uint16> (p1);
q2.half = static_cast<uint16> (p2);
// VST3 doesn't use COM compatible UUIDs on non windows platforms
#if ! JUCE_WINDOWS
q0.word = ByteOrder::swap (q0.word);
q1.half = ByteOrder::swap (q1.half);
q2.half = ByteOrder::swap (q2.half);
#endif
for (int i = 0; i < 4; ++i)
uuid[i+0] = q0.bytes[i];
for (int i = 0; i < 2; ++i)
uuid[i+4] = q1.bytes[i];
for (int i = 0; i < 2; ++i)
uuid[i+6] = q2.bytes[i];
for (int i = 0; i < 8; ++i)
uuid[i+8] = static_cast<uint8> (p3[i]);
}
#else
#define VST3_REPLACEMENT_AVAILABLE 0
#endif
#if JucePlugin_Build_VST
bool JUCE_API handleManufacturerSpecificVST2Opcode (int32 index, pointer_sized_int value, void* ptr, float)
{
#if VST3_REPLACEMENT_AVAILABLE
if ((index == (int32) ByteOrder::bigEndianInt ("stCA") || index == (int32) ByteOrder::bigEndianInt ("stCa"))
&& value == (int32) ByteOrder::bigEndianInt ("FUID") && ptr != nullptr)
{
uint8 fuid[16];
getUUIDForVST2ID (false, fuid);
::memcpy (ptr, fuid, 16);
return true;
}
#else
ignoreUnused (index, value, ptr);
#endif
return false;
}
#endif
} // namespace juce

@ -0,0 +1,107 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
#if JUCE_WINDOWS
namespace juce
{
// This function is in juce_win32_Windowing.cpp
extern bool offerKeyMessageToJUCEWindow (MSG&);
static HHOOK mouseWheelHook = nullptr, keyboardHook = nullptr;
static int numHookUsers = 0;
struct WindowsHooks
{
WindowsHooks()
{
if (numHookUsers++ == 0)
{
mouseWheelHook = SetWindowsHookEx (WH_MOUSE, mouseWheelHookCallback,
(HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(),
GetCurrentThreadId());
keyboardHook = SetWindowsHookEx (WH_GETMESSAGE, keyboardHookCallback,
(HINSTANCE) juce::Process::getCurrentModuleInstanceHandle(),
GetCurrentThreadId());
}
}
~WindowsHooks()
{
if (--numHookUsers == 0)
{
if (mouseWheelHook != nullptr)
{
UnhookWindowsHookEx (mouseWheelHook);
mouseWheelHook = nullptr;
}
if (keyboardHook != nullptr)
{
UnhookWindowsHookEx (keyboardHook);
keyboardHook = nullptr;
}
}
}
static LRESULT CALLBACK mouseWheelHookCallback (int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode >= 0 && wParam == WM_MOUSEWHEEL)
{
// using a local copy of this struct to support old mingw libraries
struct MOUSEHOOKSTRUCTEX_ : public MOUSEHOOKSTRUCT { DWORD mouseData; };
auto& hs = *(MOUSEHOOKSTRUCTEX_*) lParam;
if (auto* comp = Desktop::getInstance().findComponentAt ({ hs.pt.x, hs.pt.y }))
if (comp->getWindowHandle() != nullptr)
return PostMessage ((HWND) comp->getWindowHandle(), WM_MOUSEWHEEL,
hs.mouseData & 0xffff0000, (hs.pt.x & 0xffff) | (hs.pt.y << 16));
}
return CallNextHookEx (mouseWheelHook, nCode, wParam, lParam);
}
static LRESULT CALLBACK keyboardHookCallback (int nCode, WPARAM wParam, LPARAM lParam)
{
MSG& msg = *(MSG*) lParam;
if (nCode == HC_ACTION && wParam == PM_REMOVE
&& offerKeyMessageToJUCEWindow (msg))
{
zerostruct (msg);
msg.message = WM_USER;
return 1;
}
return CallNextHookEx (keyboardHook, nCode, wParam, lParam);
}
};
} // namespace juce
#endif