Browse Source

Update to latest juce

tags/2018-04-16
falkTX 10 years ago
parent
commit
ca72eb2321
65 changed files with 3005 additions and 400 deletions
  1. +0
    -1
      libs/juce/source/modules/juce_audio_basics/juce_audio_basics.cpp
  2. +0
    -1
      libs/juce/source/modules/juce_audio_basics/juce_audio_basics.h
  3. +5
    -0
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  4. +3
    -0
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.h
  5. +1
    -1
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  6. +3
    -12
      libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  7. +2
    -2
      libs/juce/source/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  8. +1
    -8
      libs/juce/source/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  9. +2
    -2
      libs/juce/source/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm
  10. +1615
    -0
      libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  11. +269
    -0
      libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm
  12. +4
    -1
      libs/juce/source/modules/juce_audio_plugin_client/juce_module_info
  13. +8
    -2
      libs/juce/source/modules/juce_audio_plugin_client/utility/juce_CheckSettingMacros.h
  14. +16
    -9
      libs/juce/source/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h
  15. +42
    -31
      libs/juce/source/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h
  16. +49
    -23
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Common.h
  17. +3
    -4
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h
  18. +13
    -16
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  19. +2
    -9
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  20. +38
    -0
      libs/juce/source/modules/juce_audio_processors/juce_audio_processors.cpp
  21. +2
    -2
      libs/juce/source/modules/juce_audio_processors/juce_audio_processors.h
  22. +1
    -5
      libs/juce/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h
  23. +25
    -1
      libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp
  24. +18
    -3
      libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h
  25. +1
    -0
      libs/juce/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp
  26. +2
    -0
      libs/juce/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp
  27. +11
    -4
      libs/juce/source/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  28. +1
    -9
      libs/juce/source/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp
  29. +1
    -1
      libs/juce/source/modules/juce_core/containers/juce_HashMap.h
  30. +23
    -8
      libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.cpp
  31. +11
    -8
      libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.h
  32. +1
    -1
      libs/juce/source/modules/juce_core/juce_core.cpp
  33. +1
    -1
      libs/juce/source/modules/juce_core/native/juce_BasicNativeHeaders.h
  34. +17
    -18
      libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h
  35. +10
    -18
      libs/juce/source/modules/juce_core/native/juce_win32_Threads.cpp
  36. +4
    -0
      libs/juce/source/modules/juce_core/streams/juce_OutputStream.cpp
  37. +1
    -1
      libs/juce/source/modules/juce_core/text/juce_String.h
  38. +20
    -0
      libs/juce/source/modules/juce_core/threads/juce_ChildProcess.cpp
  39. +3
    -0
      libs/juce/source/modules/juce_core/threads/juce_ChildProcess.h
  40. +61
    -57
      libs/juce/source/modules/juce_core/threads/juce_ThreadPool.cpp
  41. +8
    -1
      libs/juce/source/modules/juce_core/threads/juce_ThreadPool.h
  42. +22
    -4
      libs/juce/source/modules/juce_core/xml/juce_XmlDocument.cpp
  43. +10
    -10
      libs/juce/source/modules/juce_core/xml/juce_XmlDocument.h
  44. +1
    -1
      libs/juce/source/modules/juce_core/xml/juce_XmlElement.cpp
  45. +11
    -8
      libs/juce/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp
  46. +259
    -0
      libs/juce/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp
  47. +179
    -0
      libs/juce/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.h
  48. +27
    -14
      libs/juce/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp
  49. +8
    -3
      libs/juce/source/modules/juce_events/interprocess/juce_InterprocessConnection.h
  50. +1
    -0
      libs/juce/source/modules/juce_events/juce_events.cpp
  51. +1
    -0
      libs/juce/source/modules/juce_events/juce_events.h
  52. +1
    -1
      libs/juce/source/modules/juce_events/messages/juce_Initialisation.h
  53. +13
    -11
      libs/juce/source/modules/juce_graphics/contexts/juce_GraphicsContext.cpp
  54. +14
    -0
      libs/juce/source/modules/juce_graphics/contexts/juce_GraphicsContext.h
  55. +18
    -12
      libs/juce/source/modules/juce_graphics/native/juce_RenderingHelpers.h
  56. +12
    -0
      libs/juce/source/modules/juce_gui_basics/drawables/juce_Drawable.cpp
  57. +5
    -0
      libs/juce/source/modules/juce_gui_basics/drawables/juce_Drawable.h
  58. +18
    -0
      libs/juce/source/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp
  59. +2
    -0
      libs/juce/source/modules/juce_gui_basics/drawables/juce_DrawableShape.h
  60. +4
    -2
      libs/juce/source/modules/juce_gui_basics/layout/juce_Viewport.h
  61. +1
    -1
      libs/juce/source/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
  62. +17
    -24
      libs/juce/source/modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  63. +4
    -6
      libs/juce/source/modules/juce_gui_basics/windows/juce_DialogWindow.cpp
  64. +2
    -4
      libs/juce/source/modules/juce_gui_basics/windows/juce_DialogWindow.h
  65. +77
    -39
      libs/juce/source/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm

+ 0
- 1
libs/juce/source/modules/juce_audio_basics/juce_audio_basics.cpp View File

@@ -70,7 +70,6 @@ namespace juce
#include "buffers/juce_AudioSampleBuffer.cpp"
#include "buffers/juce_FloatVectorOperations.cpp"
#include "effects/juce_IIRFilter.cpp"
#include "effects/juce_IIRFilterOld.cpp"
#include "effects/juce_LagrangeInterpolator.cpp"
#include "midi/juce_MidiBuffer.cpp"
#include "midi/juce_MidiFile.cpp"


+ 0
- 1
libs/juce/source/modules/juce_audio_basics/juce_audio_basics.h View File

@@ -36,7 +36,6 @@ namespace juce
#include "buffers/juce_FloatVectorOperations.h"
#include "effects/juce_Decibels.h"
#include "effects/juce_IIRFilter.h"
#include "effects/juce_IIRFilterOld.h"
#include "effects/juce_LagrangeInterpolator.h"
#include "effects/juce_Reverb.h"
#include "midi/juce_MidiMessage.h"


+ 5
- 0
libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp View File

@@ -941,6 +941,11 @@ double MidiMessage::getMidiNoteInHertz (int noteNumber, const double frequencyOf
return frequencyOfA * pow (2.0, (noteNumber - 69) / 12.0);
}
bool MidiMessage::isMidiNoteBlack (int noteNumber) noexcept
{
return ((1 << (noteNumber % 12)) & 0x054a) != 0;
}
const char* MidiMessage::getGMInstrumentName (const int n)
{
static const char* names[] =


+ 3
- 0
libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.h View File

@@ -889,6 +889,9 @@ public:
*/
static double getMidiNoteInHertz (int noteNumber, const double frequencyOfA = 440.0) noexcept;
/** Returns true if the given midi note number is a black key. */
static bool isMidiNoteBlack (int noteNumber) noexcept;
/** Returns the standard name of a GM instrument, or nullptr if unknown for this index.
@param midiInstrumentNumber the program number 0 to 127


+ 1
- 1
libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp View File

@@ -160,8 +160,8 @@ void AudioDeviceManager::createAudioDeviceTypes (OwnedArray <AudioIODeviceType>&
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ASIO());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_CoreAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_iOSAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_JACK());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ALSA());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_JACK());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_OpenSLES());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Android());
}


+ 3
- 12
libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp View File

@@ -231,24 +231,15 @@ public:
NSString* nameNSString = nil;
size = sizeof (nameNSString);
#if JUCE_CLANG
// Very irritating that AudioDeviceGetProperty is marked as deprecated, since
// there seems to be no replacement way of getting the channel names.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
pa.mSelector = kAudioObjectPropertyElementName;
pa.mElement = chanNum + 1;
if (AudioDeviceGetProperty (deviceID, chanNum + 1, input, kAudioDevicePropertyChannelNameCFString,
&size, &nameNSString) == noErr)
if (AudioObjectGetPropertyData (deviceID, &pa, 0, nullptr, &size, &nameNSString) == noErr)
{
name = nsStringToJuce (nameNSString);
[nameNSString release];
}
#if JUCE_CLANG
#pragma clang diagnostic pop
#endif
if ((input ? activeInputChans : activeOutputChans) [chanNum])
{
CallbackDetailsForChannel info = { i, (int) j, (int) b.mNumberChannels };


+ 2
- 2
libs/juce/source/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -535,7 +535,7 @@ public:
#if BUILD_AU_CARBON_UI
int GetNumCustomUIComponents() override
{
return PluginHostType().isDigitalPerformer() ? 0 : 1;
return getHostType().isDigitalPerformer() ? 0 : 1;
}
void GetUIComponentDescs (ComponentDescription* inDescArray) override
@@ -1095,7 +1095,7 @@ public:
bool keyPressed (const KeyPress&) override
{
if (PluginHostType().isAbletonLive())
if (getHostType().isAbletonLive())
{
static NSTimeInterval lastEventTime = 0; // check we're not recursively sending the same event
NSTimeInterval eventTime = [[NSApp currentEvent] timestamp];


+ 1
- 8
libs/juce/source/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -96,7 +96,6 @@
#include "../utility/juce_IncludeModuleHeaders.h"
#include "../utility/juce_FakeMouseMoveGenerator.h"
#include "modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h"
#ifdef _MSC_VER
#pragma pack (pop)
@@ -374,7 +373,7 @@ public:
//==============================================================================
bool getEffectName (char* name) override
{
String (filter->getName()).copyToUTF8 (name, 64);
String (JucePlugin_Name).copyToUTF8 (name, 64);
return true;
}
@@ -1282,12 +1281,6 @@ public:
}
}
static PluginHostType& getHostType()
{
static PluginHostType hostType;
return hostType;
}
//==============================================================================
// A component to hold the AudioProcessorEditor, and cope with some housekeeping
// chores when it changes or repaints.


+ 2
- 2
libs/juce/source/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm View File

@@ -28,7 +28,7 @@
#include "../utility/juce_CheckSettingMacros.h"
#if JucePlugin_Build_VST
#if JucePlugin_Build_VST || JucePlugin_Build_VST3
#define JUCE_MAC_WINDOW_VISIBITY_BODGE 1
@@ -204,7 +204,7 @@ void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView)
[hostWindow release];
static bool needToRunMessageLoop = ! PluginHostType().isReaper();
static bool needToRunMessageLoop = ! getHostType().isReaper();
// The event loop needs to be run between closing the window and deleting the plugin,
// presumably to let the cocoa objects get tidied up. Leaving out this line causes crashes


+ 1615
- 0
libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
File diff suppressed because it is too large
View File


+ 269
- 0
libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.mm View File

@@ -0,0 +1,269 @@
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
// Your project must contain an AppConfig.h file with your project-specific settings in it,
// and your header search path must make it accessible to the module's files.
#include "AppConfig.h"
#include "../utility/juce_CheckSettingMacros.h"
#if JucePlugin_Build_VST3
#define JUCE_MAC_WINDOW_VISIBITY_BODGE 1
#include "../utility/juce_IncludeSystemHeaders.h"
#include "../utility/juce_IncludeModuleHeaders.h"
#include "../utility/juce_FakeMouseMoveGenerator.h"
#include "../utility/juce_CarbonVisibility.h"
#undef Component
#undef Point
//==============================================================================
namespace juce
{
static void initialiseMac()
{
#if ! JUCE_64BIT
NSApplicationLoad();
#endif
}
#if ! JUCE_64BIT
static void updateComponentPos (Component* const comp)
{
DBG ("updateComponentPos()");
HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int)
comp->getProperties() ["dummyViewRef"].toString().getHexValue64();
HIRect r;
HIViewGetFrame (dummyView, &r);
HIViewRef root;
HIViewFindByID (HIViewGetRoot (HIViewGetWindow (dummyView)), kHIViewWindowContentID, &root);
HIViewConvertRect (&r, HIViewGetSuperview (dummyView), root);
Rect windowPos;
GetWindowBounds (HIViewGetWindow (dummyView), kWindowContentRgn, &windowPos);
comp->setTopLeftPosition ((int) (windowPos.left + r.origin.x),
(int) (windowPos.top + r.origin.y));
}
static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, void* user)
{
updateComponentPos ((Component*) user);
return noErr;
}
#endif
static void* attachComponentToWindowRef (Component* comp, void* windowRef, bool isHIView)
{
DBG ("attachComponentToWindowRef()");
JUCE_AUTORELEASEPOOL
{
#if JUCE_64BIT
NSView* parentView = (NSView*) windowRef;
#if JucePlugin_EditorRequiresKeyboardFocus
comp->addToDesktop (0, parentView);
#else
comp->addToDesktop (ComponentPeer::windowIgnoresKeyPresses, parentView);
#endif
// (this workaround is because Wavelab provides a zero-size parent view..)
if ([parentView frame].size.height == 0)
[((NSView*) comp->getWindowHandle()) setFrameOrigin: NSZeroPoint];
comp->setVisible (true);
comp->toFront (false);
[[parentView window] setAcceptsMouseMovedEvents: YES];
return parentView;
#else
//treat NSView like 64bit
if (! isHIView)
{
NSView* parentView = (NSView*) windowRef;
#if JucePlugin_EditorRequiresKeyboardFocus
comp->addToDesktop (0, parentView);
#else
comp->addToDesktop (ComponentPeer::windowIgnoresKeyPresses, parentView);
#endif
// (this workaround is because Wavelab provides a zero-size parent view..)
if ([parentView frame].size.height == 0)
[((NSView*) comp->getWindowHandle()) setFrameOrigin: NSZeroPoint];
comp->setVisible (true);
comp->toFront (false);
[[parentView window] setAcceptsMouseMovedEvents: YES];
return parentView;
}
NSWindow* hostWindow = [[NSWindow alloc] initWithWindowRef: windowRef];
[hostWindow retain];
[hostWindow setCanHide: YES];
[hostWindow setReleasedWhenClosed: YES];
HIViewRef parentView = nullptr;
WindowAttributes attributes;
GetWindowAttributes ((WindowRef) windowRef, &attributes);
if ((attributes & kWindowCompositingAttribute) != 0)
{
HIViewRef root = HIViewGetRoot ((WindowRef) windowRef);
HIViewFindByID (root, kHIViewWindowContentID, &parentView);
if (parentView == nullptr)
parentView = root;
}
else
{
GetRootControl ((WindowRef) windowRef, (ControlRef*) &parentView);
if (parentView == nullptr)
CreateRootControl ((WindowRef) windowRef, (ControlRef*) &parentView);
}
// It seems that the only way to successfully position our overlaid window is by putting a dummy
// HIView into the host's carbon window, and then catching events to see when it gets repositioned
HIViewRef dummyView = 0;
HIImageViewCreate (0, &dummyView);
HIRect r = { {0, 0}, { (float) comp->getWidth(), (float) comp->getHeight()} };
HIViewSetFrame (dummyView, &r);
HIViewAddSubview (parentView, dummyView);
comp->getProperties().set ("dummyViewRef", String::toHexString ((pointer_sized_int) (void*) dummyView));
EventHandlerRef ref;
const EventTypeSpec kControlBoundsChangedEvent = { kEventClassControl, kEventControlBoundsChanged };
InstallEventHandler (GetControlEventTarget (dummyView), NewEventHandlerUPP (viewBoundsChangedEvent), 1, &kControlBoundsChangedEvent, (void*) comp, &ref);
comp->getProperties().set ("boundsEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
updateComponentPos (comp);
#if ! JucePlugin_EditorRequiresKeyboardFocus
comp->addToDesktop (ComponentPeer::windowIsTemporary | ComponentPeer::windowIgnoresKeyPresses);
#else
comp->addToDesktop (ComponentPeer::windowIsTemporary);
#endif
comp->setVisible (true);
comp->toFront (false);
NSView* pluginView = (NSView*) comp->getWindowHandle();
NSWindow* pluginWindow = [pluginView window];
[pluginWindow setExcludedFromWindowsMenu: YES];
[pluginWindow setCanHide: YES];
[hostWindow addChildWindow: pluginWindow
ordered: NSWindowAbove];
[hostWindow orderFront: nil];
[pluginWindow orderFront: nil];
attachWindowHidingHooks (comp, (WindowRef) windowRef, hostWindow);
return hostWindow;
#endif
}
}
static void detachComponentFromWindowRef (Component* comp, void* nsWindow, bool isHIView)
{
#if JUCE_64BIT
comp->removeFromDesktop();
#else
//treat NSView like 64bit
if (! isHIView)
{
comp->removeFromDesktop();
}
else
{
JUCE_AUTORELEASEPOOL
{
EventHandlerRef ref = (EventHandlerRef) (void*) (pointer_sized_int)
comp->getProperties() ["boundsEventRef"].toString().getHexValue64();
RemoveEventHandler (ref);
removeWindowHidingHooks (comp);
HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int)
comp->getProperties() ["dummyViewRef"].toString().getHexValue64();
if (HIViewIsValid (dummyView))
CFRelease (dummyView);
NSWindow* hostWindow = (NSWindow*) nsWindow;
NSView* pluginView = (NSView*) comp->getWindowHandle();
NSWindow* pluginWindow = [pluginView window];
[hostWindow removeChildWindow: pluginWindow];
comp->removeFromDesktop();
[hostWindow release];
}
// The event loop needs to be run between closing the window and deleting the plugin,
// presumably to let the cocoa objects get tidied up. Leaving out this line causes crashes
// in Live and Reaper when you delete the plugin with its window open.
// (Doing it this way rather than using a single longer timout means that we can guarantee
// how many messages will be dispatched, which seems to be vital in Reaper)
for (int i = 20; --i >= 0;)
MessageManager::getInstance()->runDispatchLoopUntil (1);
}
#endif
}
static void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView)
{
JUCE_AUTORELEASEPOOL
{
#if JUCE_64BIT
component->setSize (newWidth, newHeight);
#else
if (! isHIView)
{ //Treat NSView like 64bit:
component->setSize (newWidth, newHeight);
}
else if (HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int)
component->getProperties() ["dummyViewRef"].toString().getHexValue64())
{
HIRect frameRect;
HIViewGetFrame (dummyView, &frameRect);
frameRect.size.width = newWidth;
frameRect.size.height = newHeight;
HIViewSetFrame (dummyView, &frameRect);
}
#endif
}
}
} // (juce namespace)
#endif

+ 4
- 1
libs/juce/source/modules/juce_audio_plugin_client/juce_module_info View File

@@ -2,7 +2,7 @@
"id": "juce_audio_plugin_client",
"name": "JUCE audio plugin wrapper classes",
"version": "3.0.2",
"description": "Classes for building VST, RTAS and AU plugins.",
"description": "Classes for building VST, VST3, RTAS, AAX and AU plugins.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",
@@ -14,6 +14,8 @@
"compile": [ { "file": "VST/juce_VST_Wrapper.cpp" },
{ "file": "VST/juce_VST_Wrapper.mm", "target": "xcode" },
{ "file": "VST3/juce_VST3_Wrapper.cpp" },
{ "file": "VST3/juce_VST3_Wrapper.mm", "target": "xcode" },
{ "file": "RTAS/juce_RTAS_DigiCode1.cpp", "warnings": "disabled", "stdcall": "1", "target": "xcode, msvc" },
{ "file": "RTAS/juce_RTAS_DigiCode2.cpp", "warnings": "disabled", "stdcall": "1", "target": "xcode, msvc" },
{ "file": "RTAS/juce_RTAS_DigiCode3.cpp", "warnings": "disabled", "stdcall": "1", "target": "xcode, msvc" },
@@ -36,6 +38,7 @@
"RTAS/*.mm",
"RTAS/*.h",
"VST/*",
"VST3/*",
"AAX/*",
"utility/*"
]


+ 8
- 2
libs/juce/source/modules/juce_audio_plugin_client/utility/juce_CheckSettingMacros.h View File

@@ -25,7 +25,8 @@
// 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_AU || JucePlugin_Build_RTAS || JucePlugin_Build_AAX \
#if ! (JucePlugin_Build_VST || JucePlugin_Build_VST3 \
|| JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_AAX \
|| JucePlugin_Build_Standalone || JucePlugin_Build_LV2)
#error "You need to enable at least one plugin format!"
#endif
@@ -75,11 +76,16 @@
#endif
//==============================================================================
#if _WIN64 || (__LP64__ && (defined(__APPLE_CPP__) || defined(__APPLE_CC__)))
#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__))
#undef JucePlugin_Build_VST3
#define JucePlugin_Build_VST3 0
#endif
//==============================================================================
#if JucePlugin_Build_RTAS && _MSC_VER && ! defined (JucePlugin_WinBag_path)
#error "You need to define the JucePlugin_WinBag_path value!"


+ 16
- 9
libs/juce/source/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h View File

@@ -26,14 +26,21 @@
using namespace juce;
#if JUCE_MAC && ! DOXYGEN
#define Point juce::Point
#define Component juce::Component
namespace juce
{
void repostCurrentNSEvent();
}
#endif
namespace juce
{
#if JUCE_MAC && ! DOXYGEN
#define Point juce::Point
#define Component juce::Component
void repostCurrentNSEvent();
#endif
//==============================================================================
inline const PluginHostType& getHostType()
{
static PluginHostType hostType;
return hostType;
}
}
extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType);

+ 42
- 31
libs/juce/source/modules/juce_audio_plugin_client/utility/juce_PluginHostType.h View File

@@ -39,14 +39,19 @@ public:
AbletonLive7,
AbletonLive8,
AbletonLiveGeneric,
AdobeAudition,
AdobePremierePro,
AppleLogic,
Ardour,
CakewalkSonar8,
CakewalkSonarGeneric,
DigidesignProTools,
DigitalPerformer,
FruityLoops,
MagixSamplitude,
MergingPyramix,
MuseReceptorGeneric,
Reaper,
Tracktion3,
TracktionGeneric,
SteinbergCubase4,
SteinbergCubase5,
SteinbergCubase5Bridged,
@@ -62,13 +67,11 @@ public:
SteinbergWavelab7,
SteinbergWavelab8,
SteinbergWavelabGeneric,
MuseReceptorGeneric,
MagixSamplitude,
FruityLoops,
WaveBurner,
DigitalPerformer,
SteinbergTestHost,
StudioOne,
MergingPyramix,
Tracktion3,
TracktionGeneric,
WaveBurner,
VBVSTScanner
};
@@ -76,25 +79,28 @@ public:
//==============================================================================
bool isAbletonLive() const noexcept { return type == AbletonLive6 || type == AbletonLive7 || type == AbletonLive8 || type == AbletonLiveGeneric; }
bool isNuendo() const noexcept { return type == SteinbergNuendo3 || type == SteinbergNuendo4 || type == SteinbergNuendo5 || type == SteinbergNuendoGeneric; }
bool isAdobeAudition() const noexcept { return type == AdobeAudition; }
bool isArdour() const noexcept { return type == Ardour; }
bool isDigitalPerformer() const noexcept { return type == DigitalPerformer; }
bool isCubase() const noexcept { return type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase5Bridged || type == SteinbergCubase6 || type == SteinbergCubase7 || type == SteinbergCubaseGeneric; }
bool isCubaseBridged() const noexcept { return type == SteinbergCubase5Bridged; }
bool isSteinberg() const noexcept { return isCubase() || isNuendo() || isWavelab(); }
bool isTracktion() const noexcept { return type == Tracktion3 || type == TracktionGeneric; }
bool isSonar() const noexcept { return type == CakewalkSonar8 || type == CakewalkSonarGeneric; }
bool isWavelab() const noexcept { return isWavelabLegacy() || type == SteinbergWavelab7 || type == SteinbergWavelab8 || type == SteinbergWavelabGeneric; }
bool isWavelabLegacy() const noexcept { return type == SteinbergWavelab5 || type == SteinbergWavelab6; }
bool isPremiere() const noexcept { return type == AdobePremierePro; }
bool isLogic() const noexcept { return type == AppleLogic; }
bool isReceptor() const noexcept { return type == MuseReceptorGeneric; }
bool isSamplitude() const noexcept { return type == MagixSamplitude; }
bool isFruityLoops() const noexcept { return type == FruityLoops; }
bool isWaveBurner() const noexcept { return type == WaveBurner; }
bool isDigitalPerformer() const noexcept { return type == DigitalPerformer; }
bool isNuendo() const noexcept { return type == SteinbergNuendo3 || type == SteinbergNuendo4 || type == SteinbergNuendo5 || type == SteinbergNuendoGeneric; }
bool isPremiere() const noexcept { return type == AdobePremierePro; }
bool isPyramix() const noexcept { return type == MergingPyramix; }
bool isReceptor() const noexcept { return type == MuseReceptorGeneric; }
bool isReaper() const noexcept { return type == Reaper; }
bool isSamplitude() const noexcept { return type == MagixSamplitude; }
bool isSonar() const noexcept { return type == CakewalkSonar8 || type == CakewalkSonarGeneric; }
bool isSteinbergTestHost() const noexcept{ return type == SteinbergTestHost; }
bool isSteinberg() const noexcept { return isCubase() || isNuendo() || isWavelab() || isSteinbergTestHost(); }
bool isStudioOne() const noexcept { return type == StudioOne; }
bool isPyramix() const noexcept { return type == MergingPyramix; }
bool isTracktion() const noexcept { return type == Tracktion3 || type == TracktionGeneric; }
bool isVBVSTScanner() const noexcept { return type == VBVSTScanner; }
bool isWaveBurner() const noexcept { return type == WaveBurner; }
bool isWavelab() const noexcept { return isWavelabLegacy() || type == SteinbergWavelab7 || type == SteinbergWavelab8 || type == SteinbergWavelabGeneric; }
bool isWavelabLegacy() const noexcept { return type == SteinbergWavelab5 || type == SteinbergWavelab6; }
//==============================================================================
const char* getHostDescription() const noexcept
@@ -105,14 +111,18 @@ public:
case AbletonLive7: return "Ableton Live 7";
case AbletonLive8: return "Ableton Live 8";
case AbletonLiveGeneric: return "Ableton Live";
case AdobeAudition: return "Adobe Audition";
case AdobePremierePro: return "Adobe Premiere";
case AppleLogic: return "Apple Logic";
case CakewalkSonar8: return "Cakewalk Sonar 8";
case CakewalkSonarGeneric: return "Cakewalk Sonar";
case DigidesignProTools: return "ProTools";
case DigitalPerformer: return "DigitalPerformer";
case FruityLoops: return "FruityLoops";
case MagixSamplitude: return "Magix Samplitude";
case MergingPyramix: return "Pyramix";
case MuseReceptorGeneric: return "Muse Receptor";
case Reaper: return "Reaper";
case Tracktion3: return "Tracktion 3";
case TracktionGeneric: return "Tracktion";
case SteinbergCubase4: return "Steinberg Cubase 4";
case SteinbergCubase5: return "Steinberg Cubase 5";
case SteinbergCubase5Bridged: return "Steinberg Cubase 5 Bridged";
@@ -128,14 +138,12 @@ public:
case SteinbergWavelab7: return "Steinberg Wavelab 7";
case SteinbergWavelab8: return "Steinberg Wavelab 8";
case SteinbergWavelabGeneric: return "Steinberg Wavelab";
case MuseReceptorGeneric: return "Muse Receptor";
case MagixSamplitude: return "Magix Samplitude";
case FruityLoops: return "FruityLoops";
case WaveBurner: return "WaveBurner";
case DigitalPerformer: return "DigitalPerformer";
case SteinbergTestHost: return "Steinberg TestHost";
case StudioOne: return "Studio One";
case MergingPyramix: return "Pyramix";
case Tracktion3: return "Tracktion 3";
case TracktionGeneric: return "Tracktion";
case VBVSTScanner: return "VBVSTScanner";
case WaveBurner: return "WaveBurner";
default: break;
}
@@ -155,7 +163,7 @@ private:
const String hostPath (getHostPath());
const String hostFilename (File (hostPath).getFileName());
#if JUCE_MAC
#if JUCE_MAC
if (hostPath.containsIgnoreCase ("Live 6.")) return AbletonLive6;
if (hostPath.containsIgnoreCase ("Live 7.")) return AbletonLive7;
if (hostPath.containsIgnoreCase ("Live 8.")) return AbletonLive8;
@@ -182,11 +190,12 @@ private:
if (hostPath.containsIgnoreCase ("Tracktion 3")) return Tracktion3;
if (hostFilename.containsIgnoreCase ("Tracktion")) return TracktionGeneric;
#elif JUCE_WINDOWS
#elif JUCE_WINDOWS
if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;
if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;
if (hostFilename.containsIgnoreCase ("Live 8.")) return AbletonLive8;
if (hostFilename.containsIgnoreCase ("Live ")) return AbletonLiveGeneric;
if (hostFilename.containsIgnoreCase ("Audition")) return AdobeAudition;
if (hostFilename.containsIgnoreCase ("Adobe Premiere")) return AdobePremierePro;
if (hostFilename.containsIgnoreCase ("ProTools")) return DigidesignProTools;
if (hostPath.containsIgnoreCase ("SONAR 8")) return CakewalkSonar8;
@@ -207,6 +216,7 @@ private:
if (hostPath.containsIgnoreCase ("Wavelab 8")) return SteinbergWavelab8;
if (hostPath.containsIgnoreCase ("Nuendo")) return SteinbergNuendoGeneric;
if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
if (hostFilename.containsIgnoreCase ("TestHost")) return SteinbergTestHost;
if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric;
if (hostFilename.startsWith ("FL")) return FruityLoops;
if (hostPath.containsIgnoreCase ("Studio One")) return StudioOne;
@@ -216,7 +226,8 @@ private:
if (hostFilename.startsWithIgnoreCase ("Sam")) return MagixSamplitude;
#elif JUCE_LINUX
jassertfalse // not yet done!
if (hostFilename.containsIgnoreCase ("Ardour")) return Ardour;
#else
#error
#endif


+ 49
- 23
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Common.h View File

@@ -59,7 +59,7 @@ static juce::String toString (const Steinberg::char16* string) noexcept { re
static juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
static juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast<const Steinberg::char16*> (string)); }
static void toString (Steinberg::Vst::String128 result, const juce::String& source)
static void toString128 (Steinberg::Vst::String128 result, const juce::String& source)
{
Steinberg::UString (result, 128).fromAscii (source.toUTF8());
}
@@ -69,6 +69,13 @@ static Steinberg::Vst::TChar* toString (const juce::String& source) noexcept
return reinterpret_cast<Steinberg::Vst::TChar*> (source.toUTF16().getAddress());
}
#if JUCE_WINDOWS
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeHWND;
#else
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeNSView;
#endif
//==============================================================================
/** The equivalent numChannels and speaker arrangements should always
match between this function and fillWithCorrespondingSpeakerArrangements().
@@ -81,22 +88,32 @@ static Steinberg::Vst::SpeakerArrangement getArrangementForNumChannels (int numC
{
using namespace Steinberg::Vst::SpeakerArr;
if (numChannels >= 14) return k131;
if (numChannels >= 13) return k130;
if (numChannels >= 12) return k111;
if (numChannels >= 11) return k101;
if (numChannels >= 10) return k91;
if (numChannels >= 9) return k90;
if (numChannels >= 8) return k71CineFullFront;
if (numChannels >= 7) return k61Cine;
if (numChannels >= 6) return k51;
if (numChannels >= 5) return k50;
if (numChannels >= 4) return k31Cine;
if (numChannels >= 3) return k30Cine;
if (numChannels >= 2) return kStereo;
if (numChannels >= 1) return kMono;
return kEmpty;
switch (numChannels)
{
case 0: return kEmpty;
case 1: return kMono;
case 2: return kStereo;
case 3: return k30Cine;
case 4: return k31Cine;
case 5: return k50;
case 6: return k51;
case 7: return k61Cine;
case 8: return k71CineFullFront;
case 9: return k90;
case 10: return k91;
case 11: return k101;
case 12: return k111;
case 13: return k130;
case 14: return k131;
case 24: return (Steinberg::Vst::SpeakerArrangement) 1929904127; // k222
default: break;
}
jassert (numChannels >= 0);
juce::BigInteger bi;
bi.setRange (0, jmin (numChannels, (int) (sizeof (Steinberg::Vst::SpeakerArrangement) * 8)), true);
return (Steinberg::Vst::SpeakerArrangement) bi.toInt64();
}
/** The equivalent numChannels and speaker arrangements should always
@@ -119,10 +136,17 @@ static void fillWithCorrespondingSpeakerArrangements (Array<Steinberg::Vst::Spea
return;
}
/*
The order of the arrangement checks must be descending, since most plugins test for
the first arrangement to match their number of specified channels.
*/
// The order of the arrangement checks must be descending, since most plugins test for
/// the first arrangement to match their number of specified channels.
if (numChannels > 24)
{
juce::BigInteger bi;
bi.setRange (0, jmin (numChannels, (int) (sizeof (Steinberg::Vst::SpeakerArrangement) * 8)), true);
destination.add ((Steinberg::Vst::SpeakerArrangement) bi.toInt64());
}
if (numChannels >= 24) destination.add ((Steinberg::Vst::SpeakerArrangement) 1929904127); // k222
if (numChannels >= 14) destination.add (k131);
if (numChannels >= 13) destination.add (k130);
if (numChannels >= 12) destination.add (k111);
@@ -225,7 +249,9 @@ public:
//==============================================================================
static void toMidiBuffer (MidiBuffer& result, Steinberg::Vst::IEventList& eventList)
{
for (Steinberg::int32 i = 0; i < eventList.getEventCount(); ++i)
const int32 numEvents = eventList.getEventCount();
for (Steinberg::int32 i = 0; i < numEvents; ++i)
{
Steinberg::Vst::Event e;
@@ -407,4 +433,4 @@ namespace VST3BufferExchange
}
}
#endif //JUCE_VST3COMMON_H_INCLUDED
#endif // JUCE_VST3COMMON_H_INCLUDED

+ 3
- 4
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h View File

@@ -22,8 +22,8 @@
==============================================================================
*/
#ifndef JUCE_VST3HEADER_H_INCLUDED
#define JUCE_VST3HEADER_H_INCLUDED
#ifndef JUCE_VST3HEADERS_H_INCLUDED
#define JUCE_VST3HEADERS_H_INCLUDED
#undef Point
#undef Component
@@ -159,7 +159,6 @@ namespace Steinberg
#undef OBJ_METHODS
#undef QUERY_INTERFACE
#undef LICENCE_UID
#undef DEF_CLASS_IID
#undef BEGIN_FACTORY
#undef DEF_CLASS
#undef DEF_CLASS1
@@ -169,4 +168,4 @@ namespace Steinberg
#undef Point
#undef Component
#endif //JUCE_VST3HEADER_H_INCLUDED
#endif // JUCE_VST3HEADERS_H_INCLUDED

+ 13
- 16
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -998,7 +998,8 @@ private:
void releaseFactory()
{
const Steinberg::FReleaser releaser (factory);
if (factory != nullptr)
factory->release();
}
#if JUCE_WINDOWS
@@ -1219,10 +1220,9 @@ public:
#if JUCE_MAC
dummyComponent.setView (nullptr);
[pluginHandle release];
#endif
const Steinberg::FReleaser releaser (view);
view = nullptr;
}
JUCE_DECLARE_VST3_COM_REF_METHODS
@@ -1284,7 +1284,8 @@ public:
dummyComponent.setBounds (0, 0, (int) rect.getWidth(), (int) rect.getHeight());
#endif
Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate(); // Some plugins don't update their cursor correctly when mousing out the window
// Some plugins don't update their cursor correctly when mousing out the window
Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
recursiveResize = false;
}
@@ -1316,7 +1317,7 @@ public:
private:
//==============================================================================
Atomic<int> refCount;
IPlugView* view; // N.B.: Don't use a ComSmartPtr here! The view should start with a refCount of 1, and does NOT need to be incremented!
ComSmartPtr<IPlugView> view;
#if JUCE_WINDOWS
class ChildComponent : public Component
@@ -1335,14 +1336,14 @@ private:
ScopedPointer<ComponentPeer> peer;
typedef HWND HandleFormat;
#elif JUCE_MAC
NSViewComponent dummyComponent;
AutoResizingNSViewComponentWithParent dummyComponent;
typedef NSView* HandleFormat;
#else
Component dummyComponent;
typedef void* HandleFormat;
#endif
HandleFormat pluginHandle; // Don't delete this
HandleFormat pluginHandle;
bool recursiveResize;
//==============================================================================
@@ -1368,17 +1369,12 @@ private:
#elif JUCE_MAC
dummyComponent.setBounds (getBounds().withZeroOrigin());
addAndMakeVisible (dummyComponent);
pluginHandle = [[NSView alloc] init];
dummyComponent.setView (pluginHandle);
pluginHandle = (NSView*) dummyComponent.getView();
jassert (pluginHandle != nil);
#endif
if (pluginHandle != nullptr)
view->attached (pluginHandle,
#if JUCE_WINDOWS
kPlatformTypeHWND);
#else
kPlatformTypeNSView);
#endif
warnOnFailure (view->attached (pluginHandle, defaultVST3WindowType));
}
}
@@ -1452,7 +1448,8 @@ public:
if (! fetchComponentAndController (factory, factory->countClasses()))
return false;
editController->initialize (host->getFUnknown()); // (May return an error if the plugin combines the IComponent and IEditController implementations)
// (May return an error if the plugin combines the IComponent and IEditController implementations)
editController->initialize (host->getFUnknown());
isControllerInitialised = true;
editController->setComponentHandler (host);


+ 2
- 9
libs/juce/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -1927,17 +1927,10 @@ public:
#elif JUCE_MAC
#if JUCE_SUPPORT_CARBON
if (! plug.usesCocoaNSView)
{
addAndMakeVisible (carbonWrapper = new CarbonWrapperComponent (*this));
}
else
#endif
{
addAndMakeVisible (cocoaWrapper = new AutoResizingNSViewComponent());
NSView* innerView = [[NSView alloc] init];
cocoaWrapper->setView (innerView);
[innerView release];
}
addAndMakeVisible (cocoaWrapper = new AutoResizingNSViewComponentWithParent());
#endif
activeVSTWindows.add (this);
@@ -2600,7 +2593,7 @@ private:
ScopedPointer<CarbonWrapperComponent> carbonWrapper;
#endif
ScopedPointer<NSViewComponent> cocoaWrapper;
ScopedPointer<AutoResizingNSViewComponentWithParent> cocoaWrapper;
void resized() override
{


+ 38
- 0
libs/juce/source/modules/juce_audio_processors/juce_audio_processors.cpp View File

@@ -57,6 +57,11 @@
#undef KeyPress
#endif
#if ! JUCE_WINDOWS && ! JUCE_MAC
#undef JUCE_PLUGINHOST_VST3
#define JUCE_PLUGINHOST_VST3 0
#endif
//==============================================================================
namespace juce
{
@@ -72,6 +77,7 @@ static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& lis
}
#if JUCE_MAC
//==============================================================================
struct AutoResizingNSViewComponent : public NSViewComponent,
private AsyncUpdater
{
@@ -95,6 +101,38 @@ struct AutoResizingNSViewComponent : public NSViewComponent,
bool recursive;
};
//==============================================================================
struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent,
private Timer
{
AutoResizingNSViewComponentWithParent()
{
NSView* v = [[NSView alloc] init];
setView (v);
[v release];
startTimer (100);
}
void timerCallback() override
{
if (NSView* parent = (NSView*) getView())
{
if (NSView* child = [[parent subviews] firstObject])
{
NSRect f = [parent frame];
NSSize newSize = [child frame].size;
if (f.size.width != newSize.width || f.size.height != newSize.height)
{
f.size = newSize;
[parent setFrame: f];
}
}
}
}
};
#endif
#if JUCE_CLANG


+ 2
- 2
libs/juce/source/modules/juce_audio_processors/juce_audio_processors.h View File

@@ -44,7 +44,7 @@
Enables the VST3 audio plugin hosting classes. This requires the Steinberg VST3 SDK to be
installed on your machine.
@see VSTPluginFormat, VVST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_AU
@see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_AU
*/
#ifndef JUCE_PLUGINHOST_VST3
#define JUCE_PLUGINHOST_VST3 0
@@ -60,7 +60,7 @@
#endif
#if ! (JUCE_PLUGINHOST_AU || JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3)
// #error "You need to set either the JUCE_PLUGINHOST_AU anr/or JUCE_PLUGINHOST_VST flags if you're using this module!"
// #error "You need to set either the JUCE_PLUGINHOST_AU and/or JUCE_PLUGINHOST_VST and/or JUCE_PLUGINHOST_VST3 flags if you're using this module!"
#endif
#if ! (defined (JUCE_SUPPORT_CARBON) || JUCE_64BIT)


+ 1
- 5
libs/juce/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -579,11 +579,6 @@ public:
/** This method is called when the number of input or output channels is changed. */
virtual void numChannelsChanged();
//==============================================================================
/** LV2 specific calls, saving/restore as string. */
virtual String getStateInformationString () { return String::empty; }
virtual void setStateInformationString (const String& data) {}
//==============================================================================
/** Adds a listener that will be called when an aspect of this processor changes. */
virtual void addListener (AudioProcessorListener* newListener);
@@ -614,6 +609,7 @@ public:
{
wrapperType_Undefined = 0,
wrapperType_VST,
wrapperType_VST3,
wrapperType_AudioUnit,
wrapperType_RTAS,
wrapperType_AAX,


+ 25
- 1
libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp View File

@@ -202,6 +202,14 @@ void KnownPluginList::scanAndAddDragAndDroppedFiles (AudioPluginFormatManager& f
}
}
}
scanFinished();
}
void KnownPluginList::scanFinished()
{
if (scanner != nullptr)
scanner->scanFinished();
}
const StringArray& KnownPluginList::getBlacklistedFiles() const
@@ -280,10 +288,16 @@ void KnownPluginList::sort (const SortMethod method, bool forwards)
{
if (method != defaultOrder)
{
Array<PluginDescription*> oldOrder, newOrder;
oldOrder.addArray (types);
PluginSorter sorter (method, forwards);
types.sort (sorter, true);
sendChangeMessage();
newOrder.addArray (types);
if (oldOrder != newOrder)
sendChangeMessage();
}
}
@@ -523,3 +537,13 @@ int KnownPluginList::getIndexChosenByMenu (const int menuResultCode) const
//==============================================================================
KnownPluginList::CustomScanner::CustomScanner() {}
KnownPluginList::CustomScanner::~CustomScanner() {}
void KnownPluginList::CustomScanner::scanFinished() {}
bool KnownPluginList::CustomScanner::shouldExit() const noexcept
{
if (ThreadPoolJob* job = ThreadPoolJob::getCurrentThreadPoolJob())
return job->shouldExit();
return false;
}

+ 18
- 3
libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h View File

@@ -97,6 +97,9 @@ public:
OwnedArray <PluginDescription>& typesFound,
AudioPluginFormat& formatToUse);
/** Tells a custom scanner that a scan has finished, and it can release any resources. */
void scanFinished();
/** Returns true if the specified file is already known about and if it
hasn't been modified since our entry was created.
*/
@@ -170,8 +173,8 @@ public:
struct PluginTree
{
String folder; /**< The name of this folder in the tree */
OwnedArray <PluginTree> subFolders;
Array <const PluginDescription*> plugins;
OwnedArray<PluginTree> subFolders;
Array<const PluginDescription*> plugins;
};
/** Creates a PluginTree object containing all the known plugins. */
@@ -190,9 +193,21 @@ public:
virtual bool findPluginTypesFor (AudioPluginFormat& format,
OwnedArray <PluginDescription>& result,
const String& fileOrIdentifier) = 0;
/** Called when a scan has finished, to allow clean-up of resources. */
virtual void scanFinished();
/** Returns true if the current scan should be abandoned.
Any blocking methods should check this value repeatedly and return if
if becomes true.
*/
bool shouldExit() const noexcept;
};
void setCustomScanner (CustomScanner* scanner);
/** Supplies a custom scanner to be used in future scans.
The KnownPluginList will take ownership of the object passed in.
*/
void setCustomScanner (CustomScanner*);
private:
//==============================================================================


+ 1
- 0
libs/juce/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp View File

@@ -63,6 +63,7 @@ PluginDirectoryScanner::PluginDirectoryScanner (KnownPluginList& listToAddTo,
PluginDirectoryScanner::~PluginDirectoryScanner()
{
list.scanFinished();
}
//==============================================================================


+ 2
- 0
libs/juce/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp View File

@@ -162,6 +162,7 @@ PluginListComponent::PluginListComponent (AudioPluginFormatManager& manager, Kno
setSize (400, 600);
list.addChangeListener (this);
updateList();
table.getHeader().reSortTable();
PluginDirectoryScanner::applyBlacklistingsFromDeadMansPedal (list, deadMansPedalFile);
deadMansPedalFile.deleteFile();
@@ -196,6 +197,7 @@ void PluginListComponent::resized()
void PluginListComponent::changeListenerCallback (ChangeBroadcaster*)
{
table.getHeader().reSortTable();
updateList();
}


+ 11
- 4
libs/juce/source/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp View File

@@ -40,12 +40,19 @@ public:
void timerCallback() override
{
const float newLevel = (float) manager.getCurrentInputLevel();
if (isShowing())
{
const float newLevel = (float) manager.getCurrentInputLevel();
if (std::abs (level - newLevel) > 0.005f)
if (std::abs (level - newLevel) > 0.005f)
{
level = newLevel;
repaint();
}
}
else
{
level = newLevel;
repaint();
level = 0;
}
}


+ 1
- 9
libs/juce/source/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp View File

@@ -211,19 +211,11 @@ void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyW
5.0f, 6 - blackNoteWidth * 0.3f,
6.0f };
static const float widths[] = { 1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f,
1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f, blackNoteWidth,
1.0f };
const int octave = midiNoteNumber / 12;
const int note = midiNoteNumber % 12;
x = roundToInt (octave * 7.0f * keyWidth_ + notePos [note] * keyWidth_);
w = roundToInt (widths [note] * keyWidth_);
w = roundToInt (MidiMessage::isMidiNoteBlack (note) ? blackNoteWidth * keyWidth_ : keyWidth_);
}
void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const


+ 1
- 1
libs/juce/source/modules/juce_core/containers/juce_HashMap.h View File

@@ -60,7 +60,7 @@ struct DefaultHashFunctions
@code
struct MyHashGenerator
{
int generateHash (MyKeyType key, int upperLimit)
int generateHash (MyKeyType key, int upperLimit) const
{
// The function must return a value 0 <= x < upperLimit
return someFunctionOfMyKeyType (key) % upperLimit;


+ 23
- 8
libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -141,7 +141,7 @@ int NamedValueSet::size() const noexcept
return values.size();
}
const var& NamedValueSet::operator[] (const Identifier name) const
const var& NamedValueSet::operator[] (Identifier name) const
{
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
if (i->name == name)
@@ -150,7 +150,7 @@ const var& NamedValueSet::operator[] (const Identifier name) const
return var::null;
}
var NamedValueSet::getWithDefault (const Identifier name, const var& defaultReturnValue) const
var NamedValueSet::getWithDefault (Identifier name, const var& defaultReturnValue) const
{
if (const var* const v = getVarPointer (name))
return *v;
@@ -158,7 +158,7 @@ var NamedValueSet::getWithDefault (const Identifier name, const var& defaultRetu
return defaultReturnValue;
}
var* NamedValueSet::getVarPointer (const Identifier name) const noexcept
var* NamedValueSet::getVarPointer (Identifier name) const noexcept
{
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
if (i->name == name)
@@ -168,7 +168,7 @@ var* NamedValueSet::getVarPointer (const Identifier name) const noexcept
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
bool NamedValueSet::set (const Identifier name, var&& newValue)
bool NamedValueSet::set (Identifier name, var&& newValue)
{
LinkedListPointer<NamedValue>* i = &values;
@@ -193,7 +193,7 @@ bool NamedValueSet::set (const Identifier name, var&& newValue)
}
#endif
bool NamedValueSet::set (const Identifier name, const var& newValue)
bool NamedValueSet::set (Identifier name, const var& newValue)
{
LinkedListPointer<NamedValue>* i = &values;
@@ -217,12 +217,27 @@ bool NamedValueSet::set (const Identifier name, const var& newValue)
return true;
}
bool NamedValueSet::contains (const Identifier name) const
bool NamedValueSet::contains (Identifier name) const
{
return getVarPointer (name) != nullptr;
}
bool NamedValueSet::remove (const Identifier name)
int NamedValueSet::indexOf (Identifier name) const noexcept
{
int index = 0;
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
{
if (i->name == name)
return index;
++index;
}
return -1;
}
bool NamedValueSet::remove (Identifier name)
{
LinkedListPointer<NamedValue>* i = &values;
@@ -245,7 +260,7 @@ bool NamedValueSet::remove (const Identifier name)
return false;
}
const Identifier NamedValueSet::getName (const int index) const
Identifier NamedValueSet::getName (const int index) const
{
const NamedValue* const v = values[index];
jassert (v != nullptr);


+ 11
- 8
libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -67,46 +67,49 @@ public:
If the name isn't found, this will return a void variant.
@see getProperty
*/
const var& operator[] (const Identifier name) const;
const var& operator[] (Identifier name) const;
/** Tries to return the named value, but if no such value is found, this will
instead return the supplied default value.
*/
var getWithDefault (const Identifier name, const var& defaultReturnValue) const;
var getWithDefault (Identifier name, const var& defaultReturnValue) const;
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
*/
bool set (const Identifier name, const var& newValue);
bool set (Identifier name, const var& newValue);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
*/
bool set (const Identifier name, var&& newValue);
bool set (Identifier name, var&& newValue);
#endif
/** Returns true if the set contains an item with the specified name. */
bool contains (const Identifier name) const;
bool contains (Identifier name) const;
/** Removes a value from the set.
@returns true if a value was removed; false if there was no value
with the name that was given.
*/
bool remove (const Identifier name);
bool remove (Identifier name);
/** Returns the name of the value at a given index.
The index must be between 0 and size() - 1.
*/
const Identifier getName (int index) const;
Identifier getName (int index) const;
/** Returns the value of the item at a given index.
The index must be between 0 and size() - 1.
*/
const var& getValueAt (int index) const;
/** Returns the index of the given name, or -1 if it's not found. */
int indexOf (Identifier name) const noexcept;
/** Removes all values. */
void clear();
@@ -117,7 +120,7 @@ public:
Do not use this method unless you really need access to the internal var object
for some reason - for normal reading and writing always prefer operator[]() and set().
*/
var* getVarPointer (const Identifier name) const noexcept;
var* getVarPointer (Identifier name) const noexcept;
//==============================================================================
/** Sets properties to the values of all of an XML element's attributes. */


+ 1
- 1
libs/juce/source/modules/juce_core/juce_core.cpp View File

@@ -151,7 +151,6 @@ namespace juce
#include "text/juce_StringPairArray.cpp"
#include "text/juce_StringPool.cpp"
#include "text/juce_TextDiff.cpp"
#include "threads/juce_ChildProcess.cpp"
#include "threads/juce_ReadWriteLock.cpp"
#include "threads/juce_Thread.cpp"
#include "threads/juce_ThreadPool.cpp"
@@ -218,6 +217,7 @@ namespace juce
#endif
#include "threads/juce_ChildProcess.cpp"
#include "threads/juce_HighResolutionTimer.cpp"
}

+ 1
- 1
libs/juce/source/modules/juce_core/native/juce_BasicNativeHeaders.h View File

@@ -87,7 +87,7 @@
#define STRICT 1
#define WIN32_LEAN_AND_MEAN 1
#if JUCE_MINGW
#define _WIN32_WINNT 0x0502
#define _WIN32_WINNT 0x0501
#else
#define _WIN32_WINNT 0x0600
#endif


+ 17
- 18
libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -1053,7 +1053,7 @@ public:
close (pipeHandle);
}
bool isRunning() const
bool isRunning() const noexcept
{
if (childPID != 0)
{
@@ -1065,7 +1065,7 @@ public:
return false;
}
int read (void* const dest, const int numBytes)
int read (void* const dest, const int numBytes) noexcept
{
jassert (dest != nullptr);
@@ -1082,11 +1082,25 @@ public:
return 0;
}
bool killProcess() const
bool killProcess() const noexcept
{
return ::kill (childPID, SIGKILL) == 0;
}
uint32 getExitCode() const noexcept
{
if (childPID != 0)
{
int childState = 0;
const int pid = waitpid (childPID, &childState, WNOHANG);
if (pid >= 0 && WIFEXITED (childState))
return WEXITSTATUS (childState);
}
return 0;
}
int childPID;
private:
@@ -1114,21 +1128,6 @@ bool ChildProcess::start (const StringArray& args, int streamFlags)
return activeProcess != nullptr;
}
bool ChildProcess::isRunning() const
{
return activeProcess != nullptr && activeProcess->isRunning();
}
int ChildProcess::readProcessOutput (void* dest, int numBytes)
{
return activeProcess != nullptr ? activeProcess->read (dest, numBytes) : 0;
}
bool ChildProcess::kill()
{
return activeProcess == nullptr || activeProcess->killProcess();
}
//==============================================================================
struct HighResolutionTimer::Pimpl
{


+ 10
- 18
libs/juce/source/modules/juce_core/native/juce_win32_Threads.cpp View File

@@ -482,12 +482,12 @@ public:
CloseHandle (writePipe);
}
bool isRunning() const
bool isRunning() const noexcept
{
return WaitForSingleObject (processInfo.hProcess, 0) != WAIT_OBJECT_0;
}
int read (void* dest, int numNeeded) const
int read (void* dest, int numNeeded) const noexcept
{
int total = 0;
@@ -522,11 +522,18 @@ public:
return total;
}
bool killProcess() const
bool killProcess() const noexcept
{
return TerminateProcess (processInfo.hProcess, 0) != FALSE;
}
uint32 getExitCode() const noexcept
{
DWORD exitCode = 0;
GetExitCodeProcess (processInfo.hProcess, &exitCode);
return (uint32) exitCode;
}
bool ok;
private:
@@ -551,21 +558,6 @@ bool ChildProcess::start (const StringArray& args, int streamFlags)
return start (args.joinIntoString (" "), streamFlags);
}
bool ChildProcess::isRunning() const
{
return activeProcess != nullptr && activeProcess->isRunning();
}
int ChildProcess::readProcessOutput (void* dest, int numBytes)
{
return activeProcess != nullptr ? activeProcess->read (dest, numBytes) : 0;
}
bool ChildProcess::kill()
{
return activeProcess == nullptr || activeProcess->killProcess();
}
//==============================================================================
struct HighResolutionTimer::Pimpl
{


+ 4
- 0
libs/juce/source/modules/juce_core/streams/juce_OutputStream.cpp View File

@@ -174,12 +174,16 @@ bool OutputStream::writeDoubleBigEndian (double value)
bool OutputStream::writeString (const String& text)
{
#if (JUCE_STRING_UTF_TYPE == 8)
return write (text.toRawUTF8(), text.getNumBytesAsUTF8() + 1);
#else
// (This avoids using toUTF8() to prevent the memory bloat that it would leave behind
// if lots of large, persistent strings were to be written to streams).
const size_t numBytes = text.getNumBytesAsUTF8() + 1;
HeapBlock<char> temp (numBytes);
text.copyToUTF8 (temp, numBytes);
return write (temp, numBytes);
#endif
}
bool OutputStream::writeText (const String& text, const bool asUTF16,


+ 1
- 1
libs/juce/source/modules/juce_core/text/juce_String.h View File

@@ -84,7 +84,7 @@ public:
because there's no other way to represent unicode strings in a way that isn't dependent
on the compiler, source code editor and platform.
This will use up the the first maxChars characters of the string (or less if the string
This will use up to the first maxChars characters of the string (or less if the string
is actually shorter).
*/
String (const char* text, size_t maxChars);


+ 20
- 0
libs/juce/source/modules/juce_core/threads/juce_ChildProcess.cpp View File

@@ -29,6 +29,26 @@
ChildProcess::ChildProcess() {}
ChildProcess::~ChildProcess() {}
bool ChildProcess::isRunning() const
{
return activeProcess != nullptr && activeProcess->isRunning();
}
int ChildProcess::readProcessOutput (void* dest, int numBytes)
{
return activeProcess != nullptr ? activeProcess->read (dest, numBytes) : 0;
}
bool ChildProcess::kill()
{
return activeProcess == nullptr || activeProcess->killProcess();
}
uint32 ChildProcess::getExitCode() const
{
return activeProcess != nullptr ? activeProcess->getExitCode() : 0;
}
bool ChildProcess::waitForProcessToFinish (const int timeoutMs) const
{
const uint32 timeoutTime = Time::getMillisecondCounter() + (uint32) timeoutMs;


+ 3
- 0
libs/juce/source/modules/juce_core/threads/juce_ChildProcess.h View File

@@ -97,6 +97,9 @@ public:
/** Blocks until the process is no longer running. */
bool waitForProcessToFinish (int timeoutMs) const;
/** If the process has finished, this returns its exit code. */
uint32 getExitCode() const;
/** Attempts to kill the child process.
Returns true if it succeeded. Trying to read from the process after calling this may
result in undefined behaviour.


+ 61
- 57
libs/juce/source/modules/juce_core/threads/juce_ThreadPool.cpp View File

@@ -26,12 +26,31 @@
==============================================================================
*/
class ThreadPool::ThreadPoolThread : public Thread
{
public:
ThreadPoolThread (ThreadPool& p)
: Thread ("Pool"), currentJob (nullptr), pool (p)
{
}
void run() override
{
while (! threadShouldExit())
if (! pool.runNextJob (*this))
wait (500);
}
ThreadPoolJob* volatile currentJob;
ThreadPool& pool;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolThread)
};
//==============================================================================
ThreadPoolJob::ThreadPoolJob (const String& name)
: jobName (name),
pool (nullptr),
shouldStop (false),
isActive (false),
shouldBeDeleted (false)
: jobName (name), pool (nullptr),
shouldStop (false), isActive (false), shouldBeDeleted (false)
{
}
@@ -57,30 +76,13 @@ void ThreadPoolJob::signalJobShouldExit()
shouldStop = true;
}
//==============================================================================
class ThreadPool::ThreadPoolThread : public Thread
ThreadPoolJob* ThreadPoolJob::getCurrentThreadPoolJob()
{
public:
ThreadPoolThread (ThreadPool& pool_)
: Thread ("Pool"),
pool (pool_)
{
}
void run() override
{
while (! threadShouldExit())
{
if (! pool.runNextJob())
wait (500);
}
}
if (ThreadPool::ThreadPoolThread* t = dynamic_cast<ThreadPool::ThreadPoolThread*> (Thread::getCurrentThread()))
return t->currentJob;
private:
ThreadPool& pool;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolThread)
};
return nullptr;
}
//==============================================================================
ThreadPool::ThreadPool (const int numThreads)
@@ -164,8 +166,7 @@ bool ThreadPool::isJobRunning (const ThreadPoolJob* const job) const
return jobs.contains (const_cast <ThreadPoolJob*> (job)) && job->isActive;
}
bool ThreadPool::waitForJobToFinish (const ThreadPoolJob* const job,
const int timeOutMs) const
bool ThreadPool::waitForJobToFinish (const ThreadPoolJob* const job, const int timeOutMs) const
{
if (job != nullptr)
{
@@ -215,7 +216,7 @@ bool ThreadPool::removeJob (ThreadPoolJob* const job,
}
bool ThreadPool::removeAllJobs (const bool interruptRunningJobs, const int timeOutMs,
ThreadPool::JobSelector* selectedJobsToRemove)
ThreadPool::JobSelector* const selectedJobsToRemove)
{
Array <ThreadPoolJob*> jobsToWaitFor;
@@ -328,46 +329,49 @@ ThreadPoolJob* ThreadPool::pickNextJobToRun()
return nullptr;
}
bool ThreadPool::runNextJob()
bool ThreadPool::runNextJob (ThreadPoolThread& thread)
{
ThreadPoolJob* const job = pickNextJobToRun();
if (job == nullptr)
return false;
ThreadPoolJob::JobStatus result = ThreadPoolJob::jobHasFinished;
JUCE_TRY
if (ThreadPoolJob* const job = pickNextJobToRun())
{
result = job->runJob();
}
JUCE_CATCH_ALL_ASSERT
ThreadPoolJob::JobStatus result = ThreadPoolJob::jobHasFinished;
thread.currentJob = job;
OwnedArray<ThreadPoolJob> deletionList;
JUCE_TRY
{
result = job->runJob();
}
JUCE_CATCH_ALL_ASSERT
{
const ScopedLock sl (lock);
thread.currentJob = nullptr;
OwnedArray<ThreadPoolJob> deletionList;
if (jobs.contains (job))
{
job->isActive = false;
const ScopedLock sl (lock);
if (result != ThreadPoolJob::jobNeedsRunningAgain || job->shouldStop)
if (jobs.contains (job))
{
jobs.removeFirstMatchingValue (job);
addToDeleteList (deletionList, job);
job->isActive = false;
jobFinishedSignal.signal();
}
else
{
// move the job to the end of the queue if it wants another go
jobs.move (jobs.indexOf (job), -1);
if (result != ThreadPoolJob::jobNeedsRunningAgain || job->shouldStop)
{
jobs.removeFirstMatchingValue (job);
addToDeleteList (deletionList, job);
jobFinishedSignal.signal();
}
else
{
// move the job to the end of the queue if it wants another go
jobs.move (jobs.indexOf (job), -1);
}
}
}
return true;
}
return true;
return false;
}
void ThreadPool::addToDeleteList (OwnedArray<ThreadPoolJob>& deletionList, ThreadPoolJob* const job) const


+ 8
- 1
libs/juce/source/modules/juce_core/threads/juce_ThreadPool.h View File

@@ -119,6 +119,12 @@ public:
*/
void signalJobShouldExit();
//==============================================================================
/** If the calling thread is being invoked inside a runJob() method, this will
return the ThreadPoolJob that it belongs to.
*/
static ThreadPoolJob* getCurrentThreadPoolJob();
//==============================================================================
private:
friend class ThreadPool;
@@ -290,6 +296,7 @@ private:
Array <ThreadPoolJob*> jobs;
class ThreadPoolThread;
friend class ThreadPoolJob;
friend class ThreadPoolThread;
friend struct ContainerDeletePolicy<ThreadPoolThread>;
OwnedArray<ThreadPoolThread> threads;
@@ -297,7 +304,7 @@ private:
CriticalSection lock;
WaitableEvent jobFinishedSignal;
bool runNextJob();
bool runNextJob (ThreadPoolThread&);
ThreadPoolJob* pickNextJobToRun();
void addToDeleteList (OwnedArray<ThreadPoolJob>&, ThreadPoolJob*) const;
void createThreads (int numThreads);


+ 22
- 4
libs/juce/source/modules/juce_core/xml/juce_XmlDocument.cpp View File

<
@@ -371,8 +371,8 @@ void XmlDocument::readQuotedString (String& result)
}
else if (character == 0)
{
outOfData = true;
setLastError ("unmatched quotes", false);
outOfData = true;
break;
}
@@ -432,7 +432,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements)
++input;
if (alsoParseSubElements)
readChildElements (node);
readChildElements (*node);
break;
}
@@ -487,9 +487,9 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements)
return node;
}
void XmlDocument::readChildElements (XmlElement* parent)
void XmlDocument::readChildElements (XmlElement& parent)
{