Signed-off-by: falkTX <falktx@falktx.com>tags/2020-12-27
| @@ -0,0 +1,205 @@ | |||||
| diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp | |||||
| index c992d50..8cc0b36 100644 | |||||
| --- a/modules/juce_core/juce_core.cpp | |||||
| +++ b/modules/juce_core/juce_core.cpp | |||||
| @@ -69,18 +69,16 @@ | |||||
| #endif | |||||
| #else | |||||
| - #if JUCE_LINUX || JUCE_ANDROID | |||||
| + #if JUCE_LINUX || JUCE_ANDROID || JUCE_HAIKU | |||||
| #include <sys/types.h> | |||||
| #include <sys/socket.h> | |||||
| - #include <sys/errno.h> | |||||
| + #if ! JUCE_HAIKU | |||||
| + #include <sys/errno.h> | |||||
| + #endif | |||||
| #include <unistd.h> | |||||
| #include <netinet/in.h> | |||||
| #endif | |||||
| - #if JUCE_LINUX | |||||
| - #include <langinfo.h> | |||||
| - #endif | |||||
| - | |||||
| #include <pwd.h> | |||||
| #include <fcntl.h> | |||||
| #include <netdb.h> | |||||
| @@ -90,8 +88,9 @@ | |||||
| #include <net/if.h> | |||||
| #include <sys/ioctl.h> | |||||
| - #if ! JUCE_ANDROID | |||||
| + #if JUCE_LINUX | |||||
| #include <execinfo.h> | |||||
| + #include <langinfo.h> | |||||
| #endif | |||||
| #endif | |||||
| @@ -214,6 +213,10 @@ namespace juce | |||||
| #include "native/juce_android_SystemStats.cpp" | |||||
| #include "native/juce_android_Threads.cpp" | |||||
| +//============================================================================== | |||||
| +#elif JUCE_HAIKU | |||||
| +// TODO | |||||
| + | |||||
| #endif | |||||
| #include "threads/juce_ChildProcess.cpp" | |||||
| diff --git a/modules/juce_core/native/juce_BasicNativeHeaders.h b/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| index 55c0c8c..3bdb384 100644 | |||||
| --- a/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| +++ b/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| @@ -212,6 +212,33 @@ | |||||
| #include <dirent.h> | |||||
| #include <fnmatch.h> | |||||
| #include <sys/wait.h> | |||||
| + | |||||
| +//============================================================================== | |||||
| +#elif JUCE_HAIKU | |||||
| + #include <sched.h> | |||||
| + #include <pthread.h> | |||||
| + #include <sys/time.h> | |||||
| + #include <errno.h> | |||||
| + #include <sys/stat.h> | |||||
| + #include <sys/statvfs.h> | |||||
| + #include <sys/wait.h> | |||||
| + #include <sys/mman.h> | |||||
| + #include <fnmatch.h> | |||||
| + #include <utime.h> | |||||
| + #include <pwd.h> | |||||
| + #include <fcntl.h> | |||||
| + #include <dlfcn.h> | |||||
| + #include <netdb.h> | |||||
| + #include <arpa/inet.h> | |||||
| + #include <netinet/in.h> | |||||
| + #include <sys/types.h> | |||||
| + #include <sys/ioctl.h> | |||||
| + #include <sys/socket.h> | |||||
| + #include <sys/sockio.h> | |||||
| + #include <net/if.h> | |||||
| + #include <sys/file.h> | |||||
| + #include <signal.h> | |||||
| + #include <stddef.h> | |||||
| #endif | |||||
| // Need to clear various moronic redefinitions made by system headers.. | |||||
| diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| index 9823d25..a391a00 100644 | |||||
| --- a/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| +++ b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| @@ -142,7 +142,7 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs) | |||||
| void JUCE_CALLTYPE Process::terminate() | |||||
| { | |||||
| - #if JUCE_ANDROID | |||||
| + #if JUCE_ANDROID || JUCE_HAIKU | |||||
| _exit (EXIT_FAILURE); | |||||
| #else | |||||
| std::_Exit (EXIT_FAILURE); | |||||
| @@ -203,6 +203,10 @@ namespace | |||||
| #define JUCE_STAT stat | |||||
| #endif | |||||
| + #if JUCE_HAIKU | |||||
| + #define statfs statvfs | |||||
| + #endif | |||||
| + | |||||
| bool juce_stat (const String& fileName, juce_statStruct& info) | |||||
| { | |||||
| return fileName.isNotEmpty() | |||||
| @@ -542,7 +546,11 @@ void MemoryMappedFile::openInternal (const File& file, AccessMode mode) | |||||
| if (m != MAP_FAILED) | |||||
| { | |||||
| address = m; | |||||
| - madvise (m, (size_t) range.getLength(), MADV_SEQUENTIAL); | |||||
| + #if JUCE_HAIKU | |||||
| + posix_madvise (m, (size_t) range.getLength(), POSIX_MADV_SEQUENTIAL); | |||||
| + #else | |||||
| + madvise (m, (size_t) range.getLength(), MADV_SEQUENTIAL); | |||||
| + #endif | |||||
| } | |||||
| else | |||||
| { | |||||
| @@ -663,6 +671,10 @@ int File::getVolumeSerialNumber() const | |||||
| return result; | |||||
| } | |||||
| +#if JUCE_HAIKU | |||||
| + #undef statvfs | |||||
| +#endif | |||||
| + | |||||
| //============================================================================== | |||||
| void juce_runSystemCommand (const String&); | |||||
| void juce_runSystemCommand (const String& command) | |||||
| diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp | |||||
| index 49db1f9..8b3afbd 100644 | |||||
| --- a/modules/juce_core/network/juce_URL.cpp | |||||
| +++ b/modules/juce_core/network/juce_URL.cpp | |||||
| @@ -342,6 +342,7 @@ InputStream* URL::createInputStream (const bool usePostCommand, | |||||
| if (! headers.endsWithChar ('\n')) | |||||
| headers << "\r\n"; | |||||
| + #if ! JUCE_HAIKU | |||||
| ScopedPointer<WebInputStream> wi (new WebInputStream (toString (! usePostCommand), | |||||
| usePostCommand, headersAndPostData, | |||||
| progressCallback, progressCallbackContext, | |||||
| @@ -351,6 +352,9 @@ InputStream* URL::createInputStream (const bool usePostCommand, | |||||
| *statusCode = wi->statusCode; | |||||
| return wi->isError() ? nullptr : wi.release(); | |||||
| + #else | |||||
| + return nullptr; // TODO | |||||
| + #endif | |||||
| } | |||||
| //============================================================================== | |||||
| diff --git a/modules/juce_core/system/juce_SystemStats.cpp b/modules/juce_core/system/juce_SystemStats.cpp | |||||
| index 365e94d..6b56569 100644 | |||||
| --- a/modules/juce_core/system/juce_SystemStats.cpp | |||||
| +++ b/modules/juce_core/system/juce_SystemStats.cpp | |||||
| @@ -97,7 +97,7 @@ String SystemStats::getStackBacktrace() | |||||
| { | |||||
| String result; | |||||
| - #if JUCE_ANDROID || JUCE_MINGW | |||||
| + #if JUCE_ANDROID || JUCE_MINGW || JUCE_HAIKU | |||||
| jassertfalse; // sorry, not implemented yet! | |||||
| #elif JUCE_WINDOWS | |||||
| diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h | |||||
| index 86adc38..0d12d7d 100644 | |||||
| --- a/modules/juce_core/system/juce_TargetPlatform.h | |||||
| +++ b/modules/juce_core/system/juce_TargetPlatform.h | |||||
| @@ -51,6 +51,8 @@ | |||||
| #define JUCE_ANDROID 1 | |||||
| #elif defined (LINUX) || defined (__linux__) | |||||
| #define JUCE_LINUX 1 | |||||
| +#elif defined (__HAIKU__) | |||||
| + #define JUCE_HAIKU 1 | |||||
| #elif defined (__APPLE_CPP__) || defined(__APPLE_CC__) | |||||
| #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers) | |||||
| #define Component CarbonDummyCompName | |||||
| @@ -140,7 +142,7 @@ | |||||
| #endif | |||||
| //============================================================================== | |||||
| -#if JUCE_LINUX || JUCE_ANDROID | |||||
| +#if JUCE_LINUX || JUCE_ANDROID || JUCE_HAIKU | |||||
| #ifdef _DEBUG | |||||
| #define JUCE_DEBUG 1 | |||||
| diff --git a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp | |||||
| index ece2121..7b1fa73 100644 | |||||
| --- a/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp | |||||
| +++ b/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp | |||||
| @@ -82,7 +82,7 @@ File PropertiesFile::Options::getDefaultFile() const | |||||
| if (folderName.isNotEmpty()) | |||||
| dir = dir.getChildFile (folderName); | |||||
| - #elif JUCE_LINUX || JUCE_ANDROID | |||||
| + #elif JUCE_LINUX || JUCE_ANDROID || JUCE_HAIKU | |||||
| const File dir (File (commonToAllUsers ? "/var" : "~") | |||||
| .getChildFile (folderName.isNotEmpty() ? folderName | |||||
| : ("." + applicationName))); | |||||
| @@ -0,0 +1,14 @@ | |||||
| diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp | |||||
| index 823a1b209..eff47377b 100644 | |||||
| --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp | |||||
| +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp | |||||
| @@ -184,8 +184,8 @@ void AudioDeviceManager::createAudioDeviceTypes (OwnedArray<AudioIODeviceType>& | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_CoreAudio()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_iOSAudio()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Bela()); | |||||
| - addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ALSA()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_JACK()); | |||||
| + addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_ALSA()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Oboe()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_OpenSLES()); | |||||
| addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Android()); | |||||
| @@ -0,0 +1,16 @@ | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| index 5e538d5e1..626c5d182 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| @@ -1109,6 +1109,11 @@ public: | |||||
| /** This method is called when the layout of the audio processor changes. */ | |||||
| virtual void processorLayoutsChanged(); | |||||
| + //============================================================================== | |||||
| + /** LV2 specific calls, saving/restore as string. */ | |||||
| + virtual String getStateInformationString () { return String(); } | |||||
| + virtual void setStateInformationString (const String&) {} | |||||
| + | |||||
| //============================================================================== | |||||
| /** Adds a listener that will be called when an aspect of this processor changes. */ | |||||
| virtual void addListener (AudioProcessorListener* newListener); | |||||
| @@ -0,0 +1,12 @@ | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| index 626c5d182..8d3cd062e 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| @@ -1198,6 +1198,7 @@ public: | |||||
| wrapperType_AudioUnitv3, | |||||
| wrapperType_RTAS, | |||||
| wrapperType_AAX, | |||||
| + wrapperType_LV2, | |||||
| wrapperType_Standalone, | |||||
| wrapperType_Unity | |||||
| }; | |||||
| @@ -0,0 +1,73 @@ | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp | |||||
| index b9df89ed9..1f40e3eaa 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp | |||||
| @@ -33,8 +33,6 @@ AudioProcessorEditor::AudioProcessorEditor (AudioProcessor* p) noexcept : proce | |||||
| AudioProcessorEditor::~AudioProcessorEditor() | |||||
| { | |||||
| - splashScreen.deleteAndZero(); | |||||
| - | |||||
| // if this fails, then the wrapper hasn't called editorBeingDeleted() on the | |||||
| // filter for some reason.. | |||||
| jassert (processor.getActiveEditor() != this); | |||||
| @@ -49,23 +47,6 @@ void AudioProcessorEditor::hostMIDIControllerIsAvailable (bool) { | |||||
| void AudioProcessorEditor::initialise() | |||||
| { | |||||
| - /* | |||||
| - ========================================================================== | |||||
| - In accordance with the terms of the JUCE 5 End-Use License Agreement, the | |||||
| - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered | |||||
| - ineffective unless you have a JUCE Indie or Pro license, or are using | |||||
| - JUCE under the GPL v3 license. | |||||
| - | |||||
| - End User License Agreement: www.juce.com/juce-5-licence | |||||
| - ========================================================================== | |||||
| - */ | |||||
| - | |||||
| - // BEGIN SECTION A | |||||
| - | |||||
| - splashScreen = new JUCESplashScreen (*this); | |||||
| - | |||||
| - // END SECTION A | |||||
| - | |||||
| resizable = false; | |||||
| attachConstrainer (&defaultConstrainer); | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h | |||||
| index 847707ea8..c33cbe73d 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h | |||||
| @@ -199,7 +199,6 @@ private: | |||||
| bool resizable; | |||||
| ComponentBoundsConstrainer defaultConstrainer; | |||||
| ComponentBoundsConstrainer* constrainer = {}; | |||||
| - Component::SafePointer<Component> splashScreen; | |||||
| AffineTransform hostScaleTransform; | |||||
| JUCE_DECLARE_NON_COPYABLE (AudioProcessorEditor) | |||||
| diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| index 7c6273a54..ca0c5e227 100644 | |||||
| --- a/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| +++ b/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| @@ -211,7 +211,6 @@ namespace juce | |||||
| #include "application/juce_Application.cpp" | |||||
| #include "misc/juce_BubbleComponent.cpp" | |||||
| #include "misc/juce_DropShadower.cpp" | |||||
| -#include "misc/juce_JUCESplashScreen.cpp" | |||||
| #include "layout/juce_FlexBox.cpp" | |||||
| #include "layout/juce_GridItem.cpp" | |||||
| diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h | |||||
| index 8085c6eae..038f679fd 100644 | |||||
| --- a/modules/juce_gui_basics/juce_gui_basics.h | |||||
| +++ b/modules/juce_gui_basics/juce_gui_basics.h | |||||
| @@ -243,7 +243,6 @@ namespace juce | |||||
| #include "menus/juce_BurgerMenuComponent.h" | |||||
| #include "buttons/juce_ToolbarButton.h" | |||||
| #include "misc/juce_DropShadower.h" | |||||
| -#include "misc/juce_JUCESplashScreen.h" | |||||
| #include "widgets/juce_TreeView.h" | |||||
| #include "windows/juce_TopLevelWindow.h" | |||||
| #include "windows/juce_AlertWindow.h" | |||||
| @@ -0,0 +1,54 @@ | |||||
| diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp | |||||
| index 712e93f43..d4d8b7c14 100644 | |||||
| --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp | |||||
| +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp | |||||
| @@ -34,8 +34,6 @@ ResizableWindow::ResizableWindow (const String& name, Colour bkgnd, bool shouldA | |||||
| ResizableWindow::~ResizableWindow() | |||||
| { | |||||
| - splashScreen.deleteAndZero(); | |||||
| - | |||||
| // Don't delete or remove the resizer components yourself! They're managed by the | |||||
| // ResizableWindow, and you should leave them alone! You may have deleted them | |||||
| // accidentally by careless use of deleteAllChildren()..? | |||||
| @@ -53,27 +51,6 @@ ResizableWindow::~ResizableWindow() | |||||
| void ResizableWindow::initialise (const bool shouldAddToDesktop) | |||||
| { | |||||
| - /* | |||||
| - ========================================================================== | |||||
| - | |||||
| - In accordance with the terms of the JUCE 5 End-Use License Agreement, the | |||||
| - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered | |||||
| - ineffective unless you have a JUCE Indie or Pro license, or are using | |||||
| - JUCE under the GPL v3 license. | |||||
| - | |||||
| - End User License Agreement: www.juce.com/juce-5-licence | |||||
| - | |||||
| - ========================================================================== | |||||
| - */ | |||||
| - | |||||
| - // BEGIN SECTION A | |||||
| - | |||||
| - #if ! JucePlugin_Build_Standalone | |||||
| - splashScreen = new JUCESplashScreen (*this); | |||||
| - #endif | |||||
| - | |||||
| - // END SECTION A | |||||
| - | |||||
| defaultConstrainer.setMinimumOnscreenAmounts (0x10000, 16, 24, 16); | |||||
| lastNonFullScreenPos.setBounds (50, 50, 256, 256); | |||||
| diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h | |||||
| index 27c709cc6..01aeee19f 100644 | |||||
| --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h | |||||
| +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h | |||||
| @@ -376,7 +376,7 @@ protected: | |||||
| private: | |||||
| //============================================================================== | |||||
| - Component::SafePointer<Component> contentComponent, splashScreen; | |||||
| + Component::SafePointer<Component> contentComponent; | |||||
| bool ownsContentComponent = false, resizeToFitContent = false, fullscreen = false, canDrag = true, dragStarted = false; | |||||
| ComponentDragger dragger; | |||||
| Rectangle<int> lastNonFullScreenPos; | |||||
| @@ -0,0 +1,145 @@ | |||||
| diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| index c468c944c..133d1ad45 100644 | |||||
| --- a/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| +++ b/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| @@ -40,7 +40,7 @@ | |||||
| #endif | |||||
| #endif | |||||
| -#if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && JUCE_LINUX | |||||
| +#if (JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3) && JUCE_LINUX && ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| #include <X11/Xlib.h> | |||||
| #include <X11/Xutil.h> | |||||
| #include <sys/utsname.h> | |||||
| @@ -130,9 +130,11 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wcast-align" | |||||
| #include "format_types/juce_LegacyAudioParameter.cpp" | |||||
| #include "processors/juce_AudioProcessor.cpp" | |||||
| #include "processors/juce_AudioPluginInstance.cpp" | |||||
| -#include "processors/juce_AudioProcessorEditor.cpp" | |||||
| #include "processors/juce_AudioProcessorGraph.cpp" | |||||
| -#include "processors/juce_GenericAudioProcessorEditor.cpp" | |||||
| +#if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| + #include "processors/juce_AudioProcessorEditor.cpp" | |||||
| + #include "processors/juce_GenericAudioProcessorEditor.cpp" | |||||
| +#endif | |||||
| #include "processors/juce_PluginDescription.cpp" | |||||
| #include "format_types/juce_LADSPAPluginFormat.cpp" | |||||
| #include "format_types/juce_VSTPluginFormat.cpp" | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp | |||||
| index d8efe0707..7c83196e9 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp | |||||
| @@ -44,12 +44,14 @@ AudioProcessor::AudioProcessor (const BusesProperties& ioConfig) | |||||
| AudioProcessor::~AudioProcessor() | |||||
| { | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| { | |||||
| const ScopedLock sl (activeEditorLock); | |||||
| // ooh, nasty - the editor should have been deleted before its AudioProcessor. | |||||
| jassert (activeEditor == nullptr); | |||||
| } | |||||
| + #endif | |||||
| #if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING | |||||
| // This will fail if you've called beginParameterChangeGesture() for one | |||||
| @@ -797,6 +799,7 @@ void AudioProcessor::audioIOChanged (bool busNumberChanged, bool channelNumChang | |||||
| processorLayoutsChanged(); | |||||
| } | |||||
| +#if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| //============================================================================== | |||||
| void AudioProcessor::editorBeingDeleted (AudioProcessorEditor* const editor) noexcept | |||||
| { | |||||
| @@ -833,6 +836,7 @@ AudioProcessorEditor* AudioProcessor::createEditorIfNeeded() | |||||
| return ed; | |||||
| } | |||||
| +#endif | |||||
| //============================================================================== | |||||
| void AudioProcessor::getCurrentProgramStateInformation (juce::MemoryBlock& destData) | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| index 8d3cd062e..34a192dc5 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h | |||||
| @@ -919,6 +919,7 @@ public: | |||||
| */ | |||||
| virtual void setNonRealtime (bool isNonRealtime) noexcept; | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| //============================================================================== | |||||
| /** Creates the processor's GUI. | |||||
| @@ -968,6 +969,7 @@ public: | |||||
| This may call createEditor() internally to create the component. | |||||
| */ | |||||
| AudioProcessorEditor* createEditorIfNeeded(); | |||||
| + #endif | |||||
| //============================================================================== | |||||
| /** Returns the default number of steps for a parameter. | |||||
| @@ -1184,9 +1186,11 @@ public: | |||||
| virtual CurveData getResponseCurve (CurveData::Type /*curveType*/) const { return {}; } | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| //============================================================================== | |||||
| /** Not for public use - this is called before deleting an editor component. */ | |||||
| void editorBeingDeleted (AudioProcessorEditor*) noexcept; | |||||
| + #endif | |||||
| /** Flags to indicate the type of plugin context in which a processor is being used. */ | |||||
| enum WrapperType | |||||
| @@ -1461,7 +1465,9 @@ private: | |||||
| //============================================================================== | |||||
| Array<AudioProcessorListener*> listeners; | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| Component::SafePointer<AudioProcessorEditor> activeEditor; | |||||
| + #endif | |||||
| double currentSampleRate = 0; | |||||
| int blockSize = 0, latencySamples = 0; | |||||
| bool suspended = false; | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp | |||||
| index 7d2ac0047..dcdaea84d 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp | |||||
| @@ -1490,8 +1490,10 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::producesMidi() const | |||||
| bool AudioProcessorGraph::AudioGraphIOProcessor::isInput() const noexcept { return type == audioInputNode || type == midiInputNode; } | |||||
| bool AudioProcessorGraph::AudioGraphIOProcessor::isOutput() const noexcept { return type == audioOutputNode || type == midiOutputNode; } | |||||
| +#if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| bool AudioProcessorGraph::AudioGraphIOProcessor::hasEditor() const { return false; } | |||||
| AudioProcessorEditor* AudioProcessorGraph::AudioGraphIOProcessor::createEditor() { return nullptr; } | |||||
| +#endif | |||||
| int AudioProcessorGraph::AudioGraphIOProcessor::getNumPrograms() { return 0; } | |||||
| int AudioProcessorGraph::AudioGraphIOProcessor::getCurrentProgram() { return 0; } | |||||
| diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h | |||||
| index 93b2d75a4..23d1670d4 100644 | |||||
| --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h | |||||
| +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h | |||||
| @@ -348,8 +348,10 @@ public: | |||||
| bool acceptsMidi() const override; | |||||
| bool producesMidi() const override; | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| bool hasEditor() const override; | |||||
| AudioProcessorEditor* createEditor() override; | |||||
| + #endif | |||||
| int getNumPrograms() override; | |||||
| int getCurrentProgram() override; | |||||
| @@ -385,8 +387,10 @@ public: | |||||
| bool acceptsMidi() const override; | |||||
| bool producesMidi() const override; | |||||
| + #if ! JUCE_AUDIOPROCESSOR_NO_GUI | |||||
| bool hasEditor() const override { return false; } | |||||
| AudioProcessorEditor* createEditor() override { return nullptr; } | |||||
| + #endif | |||||
| int getNumPrograms() override { return 0; } | |||||
| int getCurrentProgram() override { return 0; } | |||||
| void setCurrentProgram (int) override { } | |||||
| @@ -0,0 +1,61 @@ | |||||
| diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| index ea007b1..f6faa5b 100644 | |||||
| --- a/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| +++ b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| @@ -1234,6 +1234,11 @@ public: | |||||
| return 0; | |||||
| } | |||||
| + int getPID() const noexcept | |||||
| + { | |||||
| + return childPID; | |||||
| + } | |||||
| + | |||||
| int childPID = 0; | |||||
| int pipeHandle = 0; | |||||
| int exitCode = -1; | |||||
| diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp | |||||
| index 68d891f..d38b733 100644 | |||||
| --- a/modules/juce_core/native/juce_win32_Threads.cpp | |||||
| +++ b/modules/juce_core/native/juce_win32_Threads.cpp | |||||
| @@ -488,6 +488,11 @@ public: | |||||
| return (uint32) exitCode; | |||||
| } | |||||
| + int getPID() const noexcept | |||||
| + { | |||||
| + return 0; | |||||
| + } | |||||
| + | |||||
| bool ok; | |||||
| private: | |||||
| diff --git a/modules/juce_core/threads/juce_ChildProcess.cpp b/modules/juce_core/threads/juce_ChildProcess.cpp | |||||
| index 5648c5d..262882b 100644 | |||||
| --- a/modules/juce_core/threads/juce_ChildProcess.cpp | |||||
| +++ b/modules/juce_core/threads/juce_ChildProcess.cpp | |||||
| @@ -75,6 +75,11 @@ String ChildProcess::readAllProcessOutput() | |||||
| return result.toString(); | |||||
| } | |||||
| +uint32 ChildProcess::getPID() const noexcept | |||||
| +{ | |||||
| + return activeProcess != nullptr ? activeProcess->getPID() : 0; | |||||
| +} | |||||
| + | |||||
| //============================================================================== | |||||
| #if JUCE_UNIT_TESTS | |||||
| diff --git a/modules/juce_core/threads/juce_ChildProcess.h b/modules/juce_core/threads/juce_ChildProcess.h | |||||
| index b2bd0e1..cbc380d 100644 | |||||
| --- a/modules/juce_core/threads/juce_ChildProcess.h | |||||
| +++ b/modules/juce_core/threads/juce_ChildProcess.h | |||||
| @@ -99,6 +99,8 @@ public: | |||||
| */ | |||||
| bool kill(); | |||||
| + uint32 getPID() const noexcept; | |||||
| + | |||||
| private: | |||||
| //============================================================================== | |||||
| class ActiveProcess; | |||||
| @@ -0,0 +1,70 @@ | |||||
| diff --git a/modules/juce_gui_basics/windows/juce_DialogWindow.cpp b/modules/juce_gui_basics/windows/juce_DialogWindow.cpp | |||||
| index 2b2345cdb..30c611fa7 100644 | |||||
| --- a/modules/juce_gui_basics/windows/juce_DialogWindow.cpp | |||||
| +++ b/modules/juce_gui_basics/windows/juce_DialogWindow.cpp | |||||
| @@ -124,7 +124,8 @@ void DialogWindow::showDialog (const String& dialogTitle, | |||||
| Colour backgroundColour, | |||||
| const bool escapeKeyTriggersCloseButton, | |||||
| const bool resizable, | |||||
| - const bool useBottomRightCornerResizer) | |||||
| + const bool useBottomRightCornerResizer, | |||||
| + const bool useNativeTitleBar) | |||||
| { | |||||
| LaunchOptions o; | |||||
| o.dialogTitle = dialogTitle; | |||||
| @@ -132,9 +133,9 @@ void DialogWindow::showDialog (const String& dialogTitle, | |||||
| o.componentToCentreAround = componentToCentreAround; | |||||
| o.dialogBackgroundColour = backgroundColour; | |||||
| o.escapeKeyTriggersCloseButton = escapeKeyTriggersCloseButton; | |||||
| - o.useNativeTitleBar = false; | |||||
| o.resizable = resizable; | |||||
| o.useBottomRightCornerResizer = useBottomRightCornerResizer; | |||||
| + o.useNativeTitleBar = useNativeTitleBar; | |||||
| o.launchAsync(); | |||||
| } | |||||
| @@ -146,7 +147,8 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
| Colour backgroundColour, | |||||
| const bool escapeKeyTriggersCloseButton, | |||||
| const bool resizable, | |||||
| - const bool useBottomRightCornerResizer) | |||||
| + const bool useBottomRightCornerResizer, | |||||
| + const bool useNativeTitleBar) | |||||
| { | |||||
| LaunchOptions o; | |||||
| o.dialogTitle = dialogTitle; | |||||
| @@ -154,9 +156,9 @@ int DialogWindow::showModalDialog (const String& dialogTitle, | |||||
| o.componentToCentreAround = componentToCentreAround; | |||||
| o.dialogBackgroundColour = backgroundColour; | |||||
| o.escapeKeyTriggersCloseButton = escapeKeyTriggersCloseButton; | |||||
| - o.useNativeTitleBar = false; | |||||
| o.resizable = resizable; | |||||
| o.useBottomRightCornerResizer = useBottomRightCornerResizer; | |||||
| + o.useNativeTitleBar = useNativeTitleBar; | |||||
| return o.runModal(); | |||||
| } | |||||
| diff --git a/modules/juce_gui_basics/windows/juce_DialogWindow.h b/modules/juce_gui_basics/windows/juce_DialogWindow.h | |||||
| index 231168d0c..8c9f32957 100644 | |||||
| --- a/modules/juce_gui_basics/windows/juce_DialogWindow.h | |||||
| +++ b/modules/juce_gui_basics/windows/juce_DialogWindow.h | |||||
| @@ -186,7 +186,8 @@ public: | |||||
| Colour backgroundColour, | |||||
| bool escapeKeyTriggersCloseButton, | |||||
| bool shouldBeResizable = false, | |||||
| - bool useBottomRightCornerResizer = false); | |||||
| + bool useBottomRightCornerResizer = false, | |||||
| + bool useNativeTitleBar = false); | |||||
| #if JUCE_MODAL_LOOPS_PERMITTED || DOXYGEN | |||||
| /** Easy way of quickly showing a dialog box containing a given component. | |||||
| @@ -232,7 +233,8 @@ public: | |||||
| Colour backgroundColour, | |||||
| bool escapeKeyTriggersCloseButton, | |||||
| bool shouldBeResizable = false, | |||||
| - bool useBottomRightCornerResizer = false); | |||||
| + bool useBottomRightCornerResizer = false, | |||||
| + bool useNativeTitleBar = false); | |||||
| #endif | |||||
| @@ -0,0 +1,16 @@ | |||||
| diff --git a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp | |||||
| index 6d23372d9..32e159cf6 100644 | |||||
| --- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp | |||||
| +++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp | |||||
| @@ -2542,8 +2542,9 @@ void XWindowSystem::setWindowType (::Window windowH, int styleFlags) const | |||||
| Atom netHints [2]; | |||||
| - if ((styleFlags & ComponentPeer::windowIsTemporary) != 0 | |||||
| - || ((styleFlags & ComponentPeer::windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows())) | |||||
| + if (styleFlags & ComponentPeer::windowIsTemporary) | |||||
| + netHints [0] = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_TOOLTIP"); | |||||
| + else if ((styleFlags & ComponentPeer::windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows()) | |||||
| netHints [0] = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_COMBO"); | |||||
| else | |||||
| netHints [0] = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_NORMAL"); | |||||
| @@ -0,0 +1,16 @@ | |||||
| diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| index fc04da66a..b83efeac8 100644 | |||||
| --- a/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| +++ b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| @@ -977,7 +977,11 @@ bool Thread::setThreadPriority (void* handle, int priority) | |||||
| if (pthread_getschedparam ((pthread_t) handle, &policy, ¶m) != 0) | |||||
| return false; | |||||
| + #if JUCE_LINUX | |||||
| + policy = priority < 9 ? SCHED_OTHER : SCHED_RR; | |||||
| + #else | |||||
| policy = priority == 0 ? SCHED_OTHER : SCHED_RR; | |||||
| + #endif | |||||
| const int minPriority = sched_get_priority_min (policy); | |||||
| const int maxPriority = sched_get_priority_max (policy); | |||||
| @@ -0,0 +1,13 @@ | |||||
| diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.h b/modules/juce_audio_basics/midi/juce_MidiMessage.h | |||||
| index 5628c3ae9..207bb9a0b 100644 | |||||
| --- a/modules/juce_audio_basics/midi/juce_MidiMessage.h | |||||
| +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.h | |||||
| @@ -945,7 +945,7 @@ private: | |||||
| #endif | |||||
| inline bool isHeapAllocated() const noexcept { return size > (int) sizeof (packedData); } | |||||
| - inline uint8* getData() const noexcept { return isHeapAllocated() ? packedData.allocatedData : (uint8*) packedData.asBytes; } | |||||
| + inline uint8* getData() const noexcept { return isHeapAllocated() ? packedData.allocatedData : const_cast<uint8*>(packedData.asBytes); } | |||||
| uint8* allocateSpace (int); | |||||
| }; | |||||
| @@ -0,0 +1,80 @@ | |||||
| diff --git a/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c b/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c | |||||
| index 4eac42e95..74d120e7d 100644 | |||||
| --- a/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c | |||||
| +++ b/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c | |||||
| @@ -240,42 +240,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) | |||||
| disable_sse(info); | |||||
| # endif | |||||
| #elif defined(__linux__) | |||||
| - int sse = 0; | |||||
| - struct sigaction sigill_save; | |||||
| - struct sigaction sigill_sse; | |||||
| - sigill_sse.sa_sigaction = sigill_handler_sse_os; | |||||
| - #ifdef __ANDROID__ | |||||
| - sigemptyset (&sigill_sse.sa_mask); | |||||
| - #else | |||||
| - __sigemptyset(&sigill_sse.sa_mask); | |||||
| - #endif | |||||
| - sigill_sse.sa_flags = SA_SIGINFO | SA_RESETHAND; /* SA_RESETHAND just in case our SIGILL return jump breaks, so we don't get stuck in a loop */ | |||||
| - if(0 == sigaction(SIGILL, &sigill_sse, &sigill_save)) | |||||
| - { | |||||
| - /* http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html */ | |||||
| - /* see sigill_handler_sse_os() for an explanation of the following: */ | |||||
| - asm volatile ( | |||||
| - "xorps %%xmm0,%%xmm0\n\t" /* will cause SIGILL if unsupported by OS */ | |||||
| - "incl %0\n\t" /* SIGILL handler will jump over this */ | |||||
| - /* landing zone */ | |||||
| - "nop\n\t" /* SIGILL jump lands here if "inc" is 9 bytes */ | |||||
| - "nop\n\t" | |||||
| - "nop\n\t" | |||||
| - "nop\n\t" | |||||
| - "nop\n\t" | |||||
| - "nop\n\t" | |||||
| - "nop\n\t" /* SIGILL jump lands here if "inc" is 3 bytes (expected) */ | |||||
| - "nop\n\t" | |||||
| - "nop" /* SIGILL jump lands here if "inc" is 1 byte */ | |||||
| - : "=r"(sse) | |||||
| - : "0"(sse) | |||||
| - ); | |||||
| - | |||||
| - sigaction(SIGILL, &sigill_save, NULL); | |||||
| - } | |||||
| - | |||||
| - if(!sse) | |||||
| - disable_sse(info); | |||||
| + int sse = 1; | |||||
| #elif defined(_MSC_VER) | |||||
| __try { | |||||
| __asm { | |||||
| @@ -287,30 +252,7 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) | |||||
| disable_sse(info); | |||||
| } | |||||
| #elif defined(__GNUC__) /* MinGW goes here */ | |||||
| - int sse = 0; | |||||
| - /* Based on the idea described in Agner Fog's manual "Optimizing subroutines in assembly language" */ | |||||
| - /* In theory, not guaranteed to detect lack of OS SSE support on some future Intel CPUs, but in practice works (see the aforementioned manual) */ | |||||
| - if (ia32_fxsr) { | |||||
| - struct { | |||||
| - FLAC__uint32 buff[128]; | |||||
| - } __attribute__((aligned(16))) fxsr; | |||||
| - FLAC__uint32 old_val, new_val; | |||||
| - | |||||
| - asm volatile ("fxsave %0" : "=m" (fxsr) : "m" (fxsr)); | |||||
| - old_val = fxsr.buff[50]; | |||||
| - fxsr.buff[50] ^= 0x0013c0de; /* change value in the buffer */ | |||||
| - asm volatile ("fxrstor %0" : "=m" (fxsr) : "m" (fxsr)); /* try to change SSE register */ | |||||
| - fxsr.buff[50] = old_val; /* restore old value in the buffer */ | |||||
| - asm volatile ("fxsave %0 " : "=m" (fxsr) : "m" (fxsr)); /* old value will be overwritten if SSE register was changed */ | |||||
| - new_val = fxsr.buff[50]; /* == old_val if FXRSTOR didn't change SSE register and (old_val ^ 0x0013c0de) otherwise */ | |||||
| - fxsr.buff[50] = old_val; /* again restore old value in the buffer */ | |||||
| - asm volatile ("fxrstor %0" : "=m" (fxsr) : "m" (fxsr)); /* restore old values of registers */ | |||||
| - | |||||
| - if ((old_val^new_val) == 0x0013c0de) | |||||
| - sse = 1; | |||||
| - } | |||||
| - if(!sse) | |||||
| - disable_sse(info); | |||||
| + int sse = 1; | |||||
| #else | |||||
| /* no way to test, disable to be safe */ | |||||
| disable_sse(info); | |||||
| @@ -0,0 +1,20 @@ | |||||
| diff --git a/modules/juce_events/messages/juce_MessageManager.h b/modules/juce_events/messages/juce_MessageManager.h | |||||
| index 22b2d1895..e94d0ce5a 100644 | |||||
| --- a/modules/juce_events/messages/juce_MessageManager.h | |||||
| +++ b/modules/juce_events/messages/juce_MessageManager.h | |||||
| @@ -316,6 +316,7 @@ public: | |||||
| // Internal methods - do not use! | |||||
| void deliverBroadcastMessage (const String&); | |||||
| ~MessageManager() noexcept; | |||||
| + static bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages); | |||||
| #endif | |||||
| private: | |||||
| @@ -338,7 +339,6 @@ private: | |||||
| static void* exitModalLoopCallback (void*); | |||||
| static void doPlatformSpecificInitialisation(); | |||||
| static void doPlatformSpecificShutdown(); | |||||
| - static bool dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages); | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MessageManager) | |||||
| }; | |||||
| @@ -0,0 +1,13 @@ | |||||
| diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp | |||||
| index d65642de6..050941c6c 100644 | |||||
| --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp | |||||
| +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp | |||||
| @@ -18,7 +18,7 @@ | |||||
| #if JUCE_PLUGINHOST_LADSPA && JUCE_LINUX | |||||
| -#include <ladspa.h> | |||||
| +#include "ladspa.h" | |||||
| namespace juce | |||||
| { | |||||
| @@ -0,0 +1,13 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h | |||||
| index 701c4df..0e8a324 100644 | |||||
| --- a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h | |||||
| +++ b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h | |||||
| @@ -24,6 +24,8 @@ | |||||
| ============================================================================== | |||||
| */ | |||||
| +#pragma once | |||||
| + | |||||
| #include "../juce_audio_plugin_client.h" | |||||
| namespace juce | |||||
| @@ -0,0 +1,44 @@ | |||||
| diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp | |||||
| index c919767..e6d88aa 100644 | |||||
| --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp | |||||
| +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp | |||||
| @@ -1413,7 +1413,11 @@ private: | |||||
| void setCallbackFunctions() noexcept | |||||
| { | |||||
| - ASIOCallbackFunctions<0>::setCallbacksForDevice (callbacks, this); | |||||
| + /**/ if (currentASIODev[0] == this) ASIOCallbackFunctions<0>::setCallbacks (callbacks); | |||||
| + else if (currentASIODev[1] == this) ASIOCallbackFunctions<1>::setCallbacks (callbacks); | |||||
| + else if (currentASIODev[2] == this) ASIOCallbackFunctions<2>::setCallbacks (callbacks); | |||||
| + else if (currentASIODev[3] == this) ASIOCallbackFunctions<3>::setCallbacks (callbacks); | |||||
| + else jassertfalse; | |||||
| } | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ASIOAudioIODevice) | |||||
| diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| index 1eec325..de33170 100644 | |||||
| --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| @@ -86,6 +86,9 @@ | |||||
| #include <public.sdk/source/common/memorystream.h> | |||||
| #include <public.sdk/source/vst/vsteditcontroller.h> | |||||
| #else | |||||
| + #if JUCE_MINGW | |||||
| + #define _set_abort_behavior(...) | |||||
| + #endif | |||||
| #include <base/source/baseiids.cpp> | |||||
| #include <base/source/fbuffer.cpp> | |||||
| #include <base/source/fdebug.cpp> | |||||
| diff --git a/modules/juce_core/native/juce_BasicNativeHeaders.h b/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| index 088832b..9ce110c 100644 | |||||
| --- a/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| +++ b/modules/juce_core/native/juce_BasicNativeHeaders.h | |||||
| @@ -117,7 +117,7 @@ | |||||
| #define STRICT 1 | |||||
| #define WIN32_LEAN_AND_MEAN 1 | |||||
| #if JUCE_MINGW | |||||
| - #define _WIN32_WINNT 0x0501 | |||||
| + #define _WIN32_WINNT 0x0502 | |||||
| #else | |||||
| #define _WIN32_WINNT 0x0602 | |||||
| #endif | |||||
| @@ -0,0 +1,201 @@ | |||||
| diff --git a/modules/juce_audio_basics/juce_audio_basics.cpp b/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| index c5a6bfa..fae5bff 100644 | |||||
| --- a/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| +++ b/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| @@ -31,7 +31,7 @@ | |||||
| #include "juce_audio_basics.h" | |||||
| -#if JUCE_MINGW && ! defined (__SSE2__) | |||||
| +#if JUCE_MINGW | |||||
| #define JUCE_USE_SSE_INTRINSICS 0 | |||||
| #endif | |||||
| diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| index de33170..ef37a65 100644 | |||||
| --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h | |||||
| @@ -90,12 +90,13 @@ | |||||
| #define _set_abort_behavior(...) | |||||
| #endif | |||||
| #include <base/source/baseiids.cpp> | |||||
| + #include <base/source/fatomic.cpp> | |||||
| #include <base/source/fbuffer.cpp> | |||||
| #include <base/source/fdebug.cpp> | |||||
| #include <base/source/fobject.cpp> | |||||
| #include <base/source/fstreamer.cpp> | |||||
| #include <base/source/fstring.cpp> | |||||
| - #include <base/source/flock.cpp> | |||||
| + #include <base/source/fthread.cpp> | |||||
| #include <base/source/updatehandler.cpp> | |||||
| #include <pluginterfaces/base/conststringtable.cpp> | |||||
| #include <pluginterfaces/base/funknown.cpp> | |||||
| diff --git a/modules/juce_events/native/juce_win32_Messaging.cpp b/modules/juce_events/native/juce_win32_Messaging.cpp | |||||
| index f55e540..12858ba 100644 | |||||
| --- a/modules/juce_events/native/juce_win32_Messaging.cpp | |||||
| +++ b/modules/juce_events/native/juce_win32_Messaging.cpp | |||||
| @@ -104,7 +104,7 @@ namespace WindowsMessageHelpers | |||||
| } | |||||
| } | |||||
| -#if JUCE_MODULE_AVAILABLE_juce_gui_extra | |||||
| +#if JUCE_MODULE_AVAILABLE_juce_gui_extra && ! JUCE_MINGW | |||||
| LRESULT juce_offerEventToActiveXControl (::MSG&); | |||||
| #endif | |||||
| @@ -119,7 +119,7 @@ bool MessageManager::dispatchNextMessageOnSystemQueue (const bool returnIfNoPend | |||||
| if (GetMessage (&m, (HWND) 0, 0, 0) >= 0) | |||||
| { | |||||
| - #if JUCE_MODULE_AVAILABLE_juce_gui_extra | |||||
| + #if JUCE_MODULE_AVAILABLE_juce_gui_extra && ! JUCE_MINGW | |||||
| if (juce_offerEventToActiveXControl (m) != S_FALSE) | |||||
| return true; | |||||
| #endif | |||||
| diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| index b710d39..a98f00e 100644 | |||||
| --- a/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| +++ b/modules/juce_gui_basics/juce_gui_basics.cpp | |||||
| @@ -83,6 +83,7 @@ | |||||
| #if JUCE_MINGW | |||||
| #include <imm.h> | |||||
| + #define JUCE_DISABLE_WIN32_DPI_AWARENESS 1 | |||||
| #endif | |||||
| //============================================================================== | |||||
| diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| index 569c400..a390474 100644 | |||||
| --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| @@ -206,6 +206,10 @@ extern void* getUser32Function (const char*); | |||||
| }; | |||||
| #endif | |||||
| +#if JUCE_MINGW | |||||
| +static bool canUseMultiTouch() { return false; } | |||||
| +static void checkForPointerAPI() { } | |||||
| +#else | |||||
| typedef BOOL (WINAPI* RegisterTouchWindowFunc) (HWND, ULONG); | |||||
| typedef BOOL (WINAPI* GetTouchInputInfoFunc) (HTOUCHINPUT, UINT, TOUCHINPUT*, int); | |||||
| typedef BOOL (WINAPI* CloseTouchInputHandleFunc) (HTOUCHINPUT); | |||||
| @@ -259,6 +263,7 @@ static void checkForPointerAPI() | |||||
| && getPointerTouchInfo != nullptr | |||||
| && getPointerPenInfo != nullptr); | |||||
| } | |||||
| +#endif | |||||
| static Rectangle<int> rectangleFromRECT (const RECT& r) noexcept | |||||
| { | |||||
| @@ -1578,7 +1583,9 @@ private: | |||||
| case WM_MOUSEACTIVATE: | |||||
| case WM_NCMOUSEHOVER: | |||||
| case WM_MOUSEHOVER: | |||||
| +#if ! JUCE_MINGW | |||||
| case WM_TOUCH: | |||||
| +#endif | |||||
| case WM_POINTERUPDATE: | |||||
| case WM_NCPOINTERUPDATE: | |||||
| case WM_POINTERWHEEL: | |||||
| @@ -1694,8 +1701,10 @@ private: | |||||
| RegisterDragDrop (hwnd, dropTarget); | |||||
| +#if ! JUCE_MINGW | |||||
| if (canUseMultiTouch()) | |||||
| registerTouchWindow (hwnd, 0); | |||||
| +#endif | |||||
| setDPIAwareness(); | |||||
| setMessageFilter(); | |||||
| @@ -2025,8 +2034,10 @@ private: | |||||
| bool isTouchEvent() noexcept | |||||
| { | |||||
| +#if ! JUCE_MINGW | |||||
| if (registerTouchWindow == nullptr) | |||||
| return false; | |||||
| +#endif | |||||
| // Relevant info about touch/pen detection flags: | |||||
| // https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx | |||||
| @@ -2194,6 +2205,7 @@ private: | |||||
| static MouseInputSource::InputSourceType getPointerType (WPARAM wParam) | |||||
| { | |||||
| +#if ! JUCE_MINGW | |||||
| if (getPointerTypeFunction != nullptr) | |||||
| { | |||||
| POINTER_INPUT_TYPE pointerType; | |||||
| @@ -2207,6 +2219,7 @@ private: | |||||
| return MouseInputSource::InputSourceType::pen; | |||||
| } | |||||
| } | |||||
| +#endif | |||||
| return MouseInputSource::InputSourceType::mouse; | |||||
| } | |||||
| @@ -2228,6 +2241,7 @@ private: | |||||
| peer->handleMouseWheel (getPointerType (wParam), localPos, getMouseEventTime(), wheel); | |||||
| } | |||||
| +#if ! JUCE_MINGW | |||||
| bool doGestureEvent (LPARAM lParam) | |||||
| { | |||||
| GESTUREINFO gi; | |||||
| @@ -2403,6 +2417,7 @@ private: | |||||
| return touchInput; | |||||
| } | |||||
| +#endif | |||||
| bool handlePenInput (POINTER_PEN_INFO penInfo, Point<float> pos, const float pressure, bool isDown, bool isUp) | |||||
| { | |||||
| @@ -2945,6 +2960,7 @@ private: | |||||
| return 1; | |||||
| +#if ! JUCE_MINGW | |||||
| //============================================================================== | |||||
| case WM_POINTERUPDATE: | |||||
| if (handlePointerInput (wParam, lParam, false, false)) | |||||
| @@ -2960,6 +2976,7 @@ private: | |||||
| if (handlePointerInput (wParam, lParam, false, true)) | |||||
| return 0; | |||||
| break; | |||||
| +#endif | |||||
| //============================================================================== | |||||
| case WM_MOUSEMOVE: doMouseMove (getPointFromLParam (lParam), false); return 0; | |||||
| @@ -2990,6 +3007,7 @@ private: | |||||
| return 0; | |||||
| +#if ! JUCE_MINGW | |||||
| case WM_TOUCH: | |||||
| if (getTouchInputInfo != nullptr) | |||||
| return doTouchEvent ((int) wParam, (HTOUCHINPUT) lParam); | |||||
| @@ -3001,6 +3019,7 @@ private: | |||||
| return 0; | |||||
| break; | |||||
| +#endif | |||||
| //============================================================================== | |||||
| case WM_SIZING: return handleSizeConstraining (*(RECT*) lParam, wParam); | |||||
| @@ -3898,6 +3917,7 @@ static BOOL CALLBACK enumMonitorsProc (HMONITOR hm, HDC, LPRECT r, LPARAM userIn | |||||
| const bool isMain = (info.dwFlags & 1 /* MONITORINFOF_PRIMARY */) != 0; | |||||
| double dpi = 0; | |||||
| + #if ! JUCE_DISABLE_WIN32_DPI_AWARENESS | |||||
| if (getDPIForMonitor != nullptr) | |||||
| { | |||||
| UINT dpiX = 0, dpiY = 0; | |||||
| @@ -3905,6 +3925,7 @@ static BOOL CALLBACK enumMonitorsProc (HMONITOR hm, HDC, LPRECT r, LPARAM userIn | |||||
| if (SUCCEEDED (getDPIForMonitor (hm, MDT_Default, &dpiX, &dpiY))) | |||||
| dpi = (dpiX + dpiY) / 2.0; | |||||
| } | |||||
| + #endif | |||||
| ((Array<MonitorInfo>*) userInfo)->add (MonitorInfo (rectangleFromRECT (*r), isMain, dpi)); | |||||
| @@ -0,0 +1,79 @@ | |||||
| diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp | |||||
| index 7d10dfa..a2d6a97 100644 | |||||
| --- a/modules/juce_core/juce_core.cpp | |||||
| +++ b/modules/juce_core/juce_core.cpp | |||||
| @@ -60,6 +60,7 @@ | |||||
| #if JUCE_MINGW | |||||
| #include <ws2spi.h> | |||||
| + _locale_t _create_locale(int, const char*) { _locale_t loc; juce::zeromem(&loc, sizeof(loc)); return loc; } | |||||
| #endif | |||||
| #else | |||||
| diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp | |||||
| index 5185d12..17c2e34 100644 | |||||
| --- a/modules/juce_core/native/juce_win32_Files.cpp | |||||
| +++ b/modules/juce_core/native/juce_win32_Files.cpp | |||||
| @@ -682,7 +682,7 @@ File File::getLinkedTarget() const | |||||
| CloseHandle (h); | |||||
| const StringRef prefix ("\\\\?\\"); | |||||
| - const String path (buffer); | |||||
| + const String path (buffer.getData()); | |||||
| // It turns out that GetFinalPathNameByHandleW prepends \\?\ to the path. | |||||
| // This is not a bug, it's feature. See MSDN for more information. | |||||
| diff --git a/modules/juce_core/text/juce_CharacterFunctions.h b/modules/juce_core/text/juce_CharacterFunctions.h | |||||
| index e4b2337..00d02d0 100644 | |||||
| --- a/modules/juce_core/text/juce_CharacterFunctions.h | |||||
| +++ b/modules/juce_core/text/juce_CharacterFunctions.h | |||||
| @@ -218,7 +218,7 @@ public: | |||||
| *currentCharacter++ = '0'; | |||||
| } | |||||
| - #if JUCE_MSVC | |||||
| + #if JUCE_WINDOWS | |||||
| static _locale_t locale = _create_locale (LC_ALL, "C"); | |||||
| return _strtod_l (&buffer[0], nullptr, locale); | |||||
| #else | |||||
| diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp | |||||
| index 728a4c6..353263a 100644 | |||||
| --- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp | |||||
| +++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp | |||||
| @@ -202,7 +202,7 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_ | |||||
| if (info.returnedString.isNotEmpty()) | |||||
| { | |||||
| - results.add (File (String (files)).getSiblingFile (info.returnedString)); | |||||
| + results.add (File (String (files.getData())).getSiblingFile (info.returnedString)); | |||||
| return; | |||||
| } | |||||
| } | |||||
| @@ -287,12 +287,12 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_ | |||||
| while (*filename != 0) | |||||
| { | |||||
| - results.add (File (String (files)).getChildFile (String (filename))); | |||||
| + results.add (File (String (files.getData())).getChildFile (String (filename))); | |||||
| filename += wcslen (filename) + 1; | |||||
| } | |||||
| } | |||||
| else if (files[0] != 0) | |||||
| { | |||||
| - results.add (File (String (files))); | |||||
| + results.add (File (String (files.getData()))); | |||||
| } | |||||
| } | |||||
| diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| index 22e783b..607d11b 100644 | |||||
| --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp | |||||
| @@ -3440,7 +3440,7 @@ private: | |||||
| HeapBlock<TCHAR> buffer; | |||||
| buffer.calloc (stringSizeBytes / sizeof (TCHAR) + 1); | |||||
| ImmGetCompositionString (hImc, type, buffer, (DWORD) stringSizeBytes); | |||||
| - return String (buffer); | |||||
| + return String (buffer.getData()); | |||||
| } | |||||
| return {}; | |||||
| @@ -0,0 +1,14 @@ | |||||
| diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp | |||||
| index 88d8f49..7a5d661 100644 | |||||
| --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp | |||||
| +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp | |||||
| @@ -1356,7 +1356,8 @@ private: | |||||
| auto result = finder.findDescriptionsAndPerform (f); | |||||
| - if (result.getErrorMessage() == MatchingDescriptionFinder::getSuccessString()) | |||||
| + if (result.getErrorMessage() == MatchingDescriptionFinder::getSuccessString() || | |||||
| + result.getErrorMessage().isEmpty()) | |||||
| { | |||||
| name = description.name; | |||||
| return true; | |||||
| @@ -0,0 +1,14 @@ | |||||
| diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp | |||||
| index bf7b4af22..bdb285290 100644 | |||||
| --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp | |||||
| +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp | |||||
| @@ -56,9 +56,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4355) | |||||
| #ifndef WM_APPCOMMAND | |||||
| #define WM_APPCOMMAND 0x0319 | |||||
| #endif | |||||
| - | |||||
| - extern "C" void _fpreset(); | |||||
| - extern "C" void _clearfp(); | |||||
| #elif ! JUCE_WINDOWS | |||||
| static void _fpreset() {} | |||||
| static void _clearfp() {} | |||||
| @@ -0,0 +1,37 @@ | |||||
| diff --git a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp | |||||
| index 62a1e8454..778168fc7 100644 | |||||
| --- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp | |||||
| +++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp | |||||
| @@ -19,6 +19,7 @@ | |||||
| namespace juce | |||||
| { | |||||
| +#if JUCE_MODAL_LOOPS_PERMITTED | |||||
| static bool exeIsAvailable (const char* const executable) | |||||
| { | |||||
| ChildProcess child; | |||||
| @@ -233,10 +234,11 @@ private: | |||||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Native) | |||||
| }; | |||||
| +#endif | |||||
| bool FileChooser::isPlatformDialogAvailable() | |||||
| { | |||||
| - #if JUCE_DISABLE_NATIVE_FILECHOOSERS | |||||
| + #if JUCE_DISABLE_NATIVE_FILECHOOSERS || ! JUCE_MODAL_LOOPS_PERMITTED | |||||
| return false; | |||||
| #else | |||||
| static bool canUseNativeBox = exeIsAvailable ("zenity") || exeIsAvailable ("kdialog"); | |||||
| @@ -246,7 +248,11 @@ bool FileChooser::isPlatformDialogAvailable() | |||||
| FileChooser::Pimpl* FileChooser::showPlatformDialog (FileChooser& owner, int flags, FilePreviewComponent*) | |||||
| { | |||||
| +#if JUCE_MODAL_LOOPS_PERMITTED | |||||
| return new Native (owner, flags); | |||||
| +#else | |||||
| + return nullptr; | |||||
| +#endif | |||||
| } | |||||
| } // namespace juce | |||||
| @@ -0,0 +1,46 @@ | |||||
| diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| index 1fc1f00b7..2b0e16844 100644 | |||||
| --- a/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| +++ b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| @@ -590,12 +590,39 @@ File juce_getExecutableFile() | |||||
| auto localSymbol = (void*) juce_getExecutableFile; | |||||
| dladdr (localSymbol, &exeInfo); | |||||
| - return CharPointer_UTF8 (exeInfo.dli_fname); | |||||
| + | |||||
| + const CharPointer_UTF8 filename (exeInfo.dli_fname); | |||||
| + | |||||
| + // if the filename is absolute simply return it | |||||
| + if (File::isAbsolutePath (filename)) | |||||
| + return filename; | |||||
| + | |||||
| + // if the filename is relative construct from CWD | |||||
| + if (filename[0] == '.') | |||||
| + return File::getCurrentWorkingDirectory().getChildFile (filename).getFullPathName(); | |||||
| + | |||||
| + // filename is abstract, look up in PATH | |||||
| + if (const char* const envpath = ::getenv ("PATH")) | |||||
| + { | |||||
| + StringArray paths (StringArray::fromTokens (envpath, ":", "")); | |||||
| + | |||||
| + for (int i=paths.size(); --i>=0;) | |||||
| + { | |||||
| + const File filepath (File (paths[i]).getChildFile (filename)); | |||||
| + | |||||
| + if (filepath.existsAsFile()) | |||||
| + return filepath.getFullPathName(); | |||||
| + } | |||||
| + } | |||||
| + | |||||
| + // if we reach this, we failed to find ourselves... | |||||
| + jassertfalse; | |||||
| + return filename; | |||||
| } | |||||
| }; | |||||
| static String filename = DLAddrReader::getFilename(); | |||||
| - return File::getCurrentWorkingDirectory().getChildFile (filename); | |||||
| + return filename; | |||||
| } | |||||
| //============================================================================== | |||||
| @@ -0,0 +1,114 @@ | |||||
| diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| index 20dee10..ca6dd27 100644 | |||||
| --- a/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| +++ b/modules/juce_audio_processors/juce_audio_processors.cpp | |||||
| @@ -86,24 +86,9 @@ static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& lis | |||||
| struct AutoResizingNSViewComponent : public ViewComponentBaseClass, | |||||
| private AsyncUpdater | |||||
| { | |||||
| - AutoResizingNSViewComponent() : recursive (false) {} | |||||
| - | |||||
| - void childBoundsChanged (Component*) override | |||||
| - { | |||||
| - if (recursive) | |||||
| - { | |||||
| - triggerAsyncUpdate(); | |||||
| - } | |||||
| - else | |||||
| - { | |||||
| - recursive = true; | |||||
| - resizeToFitView(); | |||||
| - recursive = true; | |||||
| - } | |||||
| - } | |||||
| - | |||||
| - void handleAsyncUpdate() override { resizeToFitView(); } | |||||
| - | |||||
| + AutoResizingNSViewComponent(); | |||||
| + void childBoundsChanged (Component*) override; | |||||
| + void handleAsyncUpdate() override; | |||||
| bool recursive; | |||||
| }; | |||||
| @@ -111,33 +96,61 @@ struct AutoResizingNSViewComponent : public ViewComponentBaseClass, | |||||
| struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewComponent, | |||||
| private Timer | |||||
| { | |||||
| - AutoResizingNSViewComponentWithParent() | |||||
| - { | |||||
| - JUCE_IOS_MAC_VIEW* v = [[JUCE_IOS_MAC_VIEW alloc] init]; | |||||
| - setView (v); | |||||
| - [v release]; | |||||
| + AutoResizingNSViewComponentWithParent(); | |||||
| + JUCE_IOS_MAC_VIEW* getChildView() const; | |||||
| + void timerCallback() override; | |||||
| +}; | |||||
| - startTimer (30); | |||||
| - } | |||||
| +//============================================================================== | |||||
| +AutoResizingNSViewComponent::AutoResizingNSViewComponent() | |||||
| + : recursive (false) {} | |||||
| - JUCE_IOS_MAC_VIEW* getChildView() const | |||||
| +void AutoResizingNSViewComponent::childBoundsChanged (Component*) override | |||||
| +{ | |||||
| + if (recursive) | |||||
| { | |||||
| - if (JUCE_IOS_MAC_VIEW* parent = (JUCE_IOS_MAC_VIEW*) getView()) | |||||
| - if ([[parent subviews] count] > 0) | |||||
| - return [[parent subviews] objectAtIndex: 0]; | |||||
| - | |||||
| - return nil; | |||||
| + triggerAsyncUpdate(); | |||||
| } | |||||
| + else | |||||
| + { | |||||
| + recursive = true; | |||||
| + resizeToFitView(); | |||||
| + recursive = true; | |||||
| + } | |||||
| +} | |||||
| - void timerCallback() override | |||||
| +void AutoResizingNSViewComponent::handleAsyncUpdate() override | |||||
| +{ | |||||
| + resizeToFitView(); | |||||
| +} | |||||
| + | |||||
| +//============================================================================== | |||||
| +AutoResizingNSViewComponentWithParent::AutoResizingNSViewComponentWithParent() | |||||
| +{ | |||||
| + JUCE_IOS_MAC_VIEW* v = [[JUCE_IOS_MAC_VIEW alloc] init]; | |||||
| + setView (v); | |||||
| + [v release]; | |||||
| + | |||||
| + startTimer (30); | |||||
| +} | |||||
| + | |||||
| +JUCE_IOS_MAC_VIEW* AutoResizingNSViewComponentWithParent::getChildView() const | |||||
| +{ | |||||
| + if (JUCE_IOS_MAC_VIEW* parent = (JUCE_IOS_MAC_VIEW*) getView()) | |||||
| + if ([[parent subviews] count] > 0) | |||||
| + return [[parent subviews] objectAtIndex: 0]; | |||||
| + | |||||
| + return nil; | |||||
| +} | |||||
| + | |||||
| +void AutoResizingNSViewComponentWithParent::timerCallback() override | |||||
| +{ | |||||
| + if (JUCE_IOS_MAC_VIEW* child = getChildView()) | |||||
| { | |||||
| - if (JUCE_IOS_MAC_VIEW* child = getChildView()) | |||||
| - { | |||||
| - stopTimer(); | |||||
| - setView (child); | |||||
| - } | |||||
| + stopTimer(); | |||||
| + setView (child); | |||||
| } | |||||
| -}; | |||||
| +} | |||||
| #endif | |||||
| #if JUCE_CLANG | |||||
| @@ -0,0 +1,244 @@ | |||||
| /* | |||||
| ============================================================================== | |||||
| 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. | |||||
| ============================================================================== | |||||
| */ | |||||
| #if JUCE_INTEL | |||||
| #define JUCE_SNAP_TO_ZERO(n) if (! (n < -1.0e-8 || n > 1.0e-8)) n = 0; | |||||
| #else | |||||
| #define JUCE_SNAP_TO_ZERO(n) | |||||
| #endif | |||||
| namespace juce | |||||
| { | |||||
| //============================================================================== | |||||
| IIRFilterOld::IIRFilterOld() | |||||
| : active (false), v1 (0), v2 (0) | |||||
| { | |||||
| zeromem (coefficients, sizeof (coefficients)); | |||||
| } | |||||
| IIRFilterOld::IIRFilterOld (const IIRFilterOld& other) | |||||
| : active (other.active), v1 (0), v2 (0) | |||||
| { | |||||
| const SpinLock::ScopedLockType sl (other.processLock); | |||||
| memcpy (coefficients, other.coefficients, sizeof (coefficients)); | |||||
| } | |||||
| IIRFilterOld::~IIRFilterOld() | |||||
| { | |||||
| } | |||||
| //============================================================================== | |||||
| void IIRFilterOld::reset() noexcept | |||||
| { | |||||
| const SpinLock::ScopedLockType sl (processLock); | |||||
| v1 = v2 = 0; | |||||
| } | |||||
| float IIRFilterOld::processSingleSampleRaw (const float in) noexcept | |||||
| { | |||||
| float out = coefficients[0] * in + v1; | |||||
| JUCE_SNAP_TO_ZERO (out); | |||||
| v1 = coefficients[1] * in - coefficients[3] * out + v2; | |||||
| v2 = coefficients[2] * in - coefficients[4] * out; | |||||
| return out; | |||||
| } | |||||
| void IIRFilterOld::processSamples (float* const samples, | |||||
| const int numSamples) noexcept | |||||
| { | |||||
| const SpinLock::ScopedLockType sl (processLock); | |||||
| if (active) | |||||
| { | |||||
| const float c0 = coefficients[0]; | |||||
| const float c1 = coefficients[1]; | |||||
| const float c2 = coefficients[2]; | |||||
| const float c3 = coefficients[3]; | |||||
| const float c4 = coefficients[4]; | |||||
| float lv1 = v1, lv2 = v2; | |||||
| for (int i = 0; i < numSamples; ++i) | |||||
| { | |||||
| const float in = samples[i]; | |||||
| const float out = c0 * in + lv1; | |||||
| samples[i] = out; | |||||
| lv1 = c1 * in - c3 * out + lv2; | |||||
| lv2 = c2 * in - c4 * out; | |||||
| } | |||||
| JUCE_SNAP_TO_ZERO (lv1); v1 = lv1; | |||||
| JUCE_SNAP_TO_ZERO (lv2); v2 = lv2; | |||||
| } | |||||
| } | |||||
| //============================================================================== | |||||
| void IIRFilterOld::makeLowPass (const double sampleRate, | |||||
| const double frequency) noexcept | |||||
| { | |||||
| jassert (sampleRate > 0); | |||||
| const double n = 1.0 / tan (double_Pi * frequency / sampleRate); | |||||
| const double nSquared = n * n; | |||||
| const double c1 = 1.0 / (1.0 + std::sqrt (2.0) * n + nSquared); | |||||
| setCoefficients (c1, | |||||
| c1 * 2.0f, | |||||
| c1, | |||||
| 1.0, | |||||
| c1 * 2.0 * (1.0 - nSquared), | |||||
| c1 * (1.0 - std::sqrt (2.0) * n + nSquared)); | |||||
| } | |||||
| void IIRFilterOld::makeHighPass (const double sampleRate, | |||||
| const double frequency) noexcept | |||||
| { | |||||
| const double n = tan (double_Pi * frequency / sampleRate); | |||||
| const double nSquared = n * n; | |||||
| const double c1 = 1.0 / (1.0 + std::sqrt (2.0) * n + nSquared); | |||||
| setCoefficients (c1, | |||||
| c1 * -2.0f, | |||||
| c1, | |||||
| 1.0, | |||||
| c1 * 2.0 * (nSquared - 1.0), | |||||
| c1 * (1.0 - std::sqrt (2.0) * n + nSquared)); | |||||
| } | |||||
| void IIRFilterOld::makeLowShelf (const double sampleRate, | |||||
| const double cutOffFrequency, | |||||
| const double Q, | |||||
| const float gainFactor) noexcept | |||||
| { | |||||
| jassert (sampleRate > 0); | |||||
| jassert (Q > 0); | |||||
| const double A = jmax (0.0f, gainFactor); | |||||
| const double aminus1 = A - 1.0; | |||||
| const double aplus1 = A + 1.0; | |||||
| const double omega = (double_Pi * 2.0 * jmax (cutOffFrequency, 2.0)) / sampleRate; | |||||
| const double coso = std::cos (omega); | |||||
| const double beta = std::sin (omega) * std::sqrt (A) / Q; | |||||
| const double aminus1TimesCoso = aminus1 * coso; | |||||
| setCoefficients (A * (aplus1 - aminus1TimesCoso + beta), | |||||
| A * 2.0 * (aminus1 - aplus1 * coso), | |||||
| A * (aplus1 - aminus1TimesCoso - beta), | |||||
| aplus1 + aminus1TimesCoso + beta, | |||||
| -2.0 * (aminus1 + aplus1 * coso), | |||||
| aplus1 + aminus1TimesCoso - beta); | |||||
| } | |||||
| void IIRFilterOld::makeHighShelf (const double sampleRate, | |||||
| const double cutOffFrequency, | |||||
| const double Q, | |||||
| const float gainFactor) noexcept | |||||
| { | |||||
| jassert (sampleRate > 0); | |||||
| jassert (Q > 0); | |||||
| const double A = jmax (0.0f, gainFactor); | |||||
| const double aminus1 = A - 1.0; | |||||
| const double aplus1 = A + 1.0; | |||||
| const double omega = (double_Pi * 2.0 * jmax (cutOffFrequency, 2.0)) / sampleRate; | |||||
| const double coso = std::cos (omega); | |||||
| const double beta = std::sin (omega) * std::sqrt (A) / Q; | |||||
| const double aminus1TimesCoso = aminus1 * coso; | |||||
| setCoefficients (A * (aplus1 + aminus1TimesCoso + beta), | |||||
| A * -2.0 * (aminus1 + aplus1 * coso), | |||||
| A * (aplus1 + aminus1TimesCoso - beta), | |||||
| aplus1 - aminus1TimesCoso + beta, | |||||
| 2.0 * (aminus1 - aplus1 * coso), | |||||
| aplus1 - aminus1TimesCoso - beta); | |||||
| } | |||||
| void IIRFilterOld::makeBandPass (const double sampleRate, | |||||
| const double centreFrequency, | |||||
| const double Q, | |||||
| const float gainFactor) noexcept | |||||
| { | |||||
| jassert (sampleRate > 0); | |||||
| jassert (Q > 0); | |||||
| const double A = jmax (0.0f, gainFactor); | |||||
| const double omega = (double_Pi * 2.0 * jmax (centreFrequency, 2.0)) / sampleRate; | |||||
| const double alpha = 0.5 * std::sin (omega) / Q; | |||||
| const double c2 = -2.0 * std::cos (omega); | |||||
| const double alphaTimesA = alpha * A; | |||||
| const double alphaOverA = alpha / A; | |||||
| setCoefficients (1.0 + alphaTimesA, | |||||
| c2, | |||||
| 1.0 - alphaTimesA, | |||||
| 1.0 + alphaOverA, | |||||
| c2, | |||||
| 1.0 - alphaOverA); | |||||
| } | |||||
| void IIRFilterOld::makeInactive() noexcept | |||||
| { | |||||
| const SpinLock::ScopedLockType sl (processLock); | |||||
| active = false; | |||||
| } | |||||
| //============================================================================== | |||||
| void IIRFilterOld::copyCoefficientsFrom (const IIRFilterOld& other) noexcept | |||||
| { | |||||
| const SpinLock::ScopedLockType sl (processLock); | |||||
| memcpy (coefficients, other.coefficients, sizeof (coefficients)); | |||||
| active = other.active; | |||||
| } | |||||
| //============================================================================== | |||||
| void IIRFilterOld::setCoefficients (double c1, double c2, double c3, | |||||
| double c4, double c5, double c6) noexcept | |||||
| { | |||||
| const double a = 1.0 / c4; | |||||
| c1 *= a; | |||||
| c2 *= a; | |||||
| c3 *= a; | |||||
| c5 *= a; | |||||
| c6 *= a; | |||||
| const SpinLock::ScopedLockType sl (processLock); | |||||
| coefficients[0] = (float) c1; | |||||
| coefficients[1] = (float) c2; | |||||
| coefficients[2] = (float) c3; | |||||
| coefficients[3] = (float) c5; | |||||
| coefficients[4] = (float) c6; | |||||
| active = true; | |||||
| } | |||||
| #undef JUCE_SNAP_TO_ZERO | |||||
| } // namespace juce | |||||
| @@ -0,0 +1,151 @@ | |||||
| /* | |||||
| ============================================================================== | |||||
| 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. | |||||
| ============================================================================== | |||||
| */ | |||||
| #ifndef __JUCE_IIRFILTER_OLD_JUCEHEADER__ | |||||
| #define __JUCE_IIRFILTER_OLD_JUCEHEADER__ | |||||
| namespace juce | |||||
| { | |||||
| //============================================================================== | |||||
| /** | |||||
| An IIR filter that can perform low, high, or band-pass filtering on an | |||||
| audio signal. | |||||
| @see IIRFilterAudioSource | |||||
| */ | |||||
| class JUCE_API IIRFilterOld | |||||
| { | |||||
| public: | |||||
| //============================================================================== | |||||
| /** Creates a filter. | |||||
| Initially the filter is inactive, so will have no effect on samples that | |||||
| you process with it. Use the appropriate method to turn it into the type | |||||
| of filter needed. | |||||
| */ | |||||
| IIRFilterOld(); | |||||
| /** Creates a copy of another filter. */ | |||||
| IIRFilterOld (const IIRFilterOld& other); | |||||
| /** Destructor. */ | |||||
| ~IIRFilterOld(); | |||||
| //============================================================================== | |||||
| /** Resets the filter's processing pipeline, ready to start a new stream of data. | |||||
| Note that this clears the processing state, but the type of filter and | |||||
| its coefficients aren't changed. To put a filter into an inactive state, use | |||||
| the makeInactive() method. | |||||
| */ | |||||
| void reset() noexcept; | |||||
| /** Performs the filter operation on the given set of samples. | |||||
| */ | |||||
| void processSamples (float* samples, | |||||
| int numSamples) noexcept; | |||||
| /** Processes a single sample, without any locking or checking. | |||||
| Use this if you need fast processing of a single value, but be aware that | |||||
| this isn't thread-safe in the way that processSamples() is. | |||||
| */ | |||||
| float processSingleSampleRaw (float sample) noexcept; | |||||
| //============================================================================== | |||||
| /** Sets the filter up to act as a low-pass filter. | |||||
| */ | |||||
| void makeLowPass (double sampleRate, | |||||
| double frequency) noexcept; | |||||
| /** Sets the filter up to act as a high-pass filter. | |||||
| */ | |||||
| void makeHighPass (double sampleRate, | |||||
| double frequency) noexcept; | |||||
| //============================================================================== | |||||
| /** Sets the filter up to act as a low-pass shelf filter with variable Q and gain. | |||||
| The gain is a scale factor that the low frequencies are multiplied by, so values | |||||
| greater than 1.0 will boost the low frequencies, values less than 1.0 will | |||||
| attenuate them. | |||||
| */ | |||||
| void makeLowShelf (double sampleRate, | |||||
| double cutOffFrequency, | |||||
| double Q, | |||||
| float gainFactor) noexcept; | |||||
| /** Sets the filter up to act as a high-pass shelf filter with variable Q and gain. | |||||
| The gain is a scale factor that the high frequencies are multiplied by, so values | |||||
| greater than 1.0 will boost the high frequencies, values less than 1.0 will | |||||
| attenuate them. | |||||
| */ | |||||
| void makeHighShelf (double sampleRate, | |||||
| double cutOffFrequency, | |||||
| double Q, | |||||
| float gainFactor) noexcept; | |||||
| /** Sets the filter up to act as a band pass filter centred around a | |||||
| frequency, with a variable Q and gain. | |||||
| The gain is a scale factor that the centre frequencies are multiplied by, so | |||||
| values greater than 1.0 will boost the centre frequencies, values less than | |||||
| 1.0 will attenuate them. | |||||
| */ | |||||
| void makeBandPass (double sampleRate, | |||||
| double centreFrequency, | |||||
| double Q, | |||||
| float gainFactor) noexcept; | |||||
| /** Clears the filter's coefficients so that it becomes inactive. | |||||
| */ | |||||
| void makeInactive() noexcept; | |||||
| //============================================================================== | |||||
| /** Makes this filter duplicate the set-up of another one. | |||||
| */ | |||||
| void copyCoefficientsFrom (const IIRFilterOld& other) noexcept; | |||||
| protected: | |||||
| //============================================================================== | |||||
| SpinLock processLock; | |||||
| void setCoefficients (double c1, double c2, double c3, | |||||
| double c4, double c5, double c6) noexcept; | |||||
| bool active; | |||||
| float coefficients[5]; | |||||
| float v1, v2; | |||||
| // (use the copyCoefficientsFrom() method instead of this operator) | |||||
| IIRFilterOld& operator= (const IIRFilterOld&); | |||||
| JUCE_LEAK_DETECTOR (IIRFilterOld) | |||||
| }; | |||||
| } // namespace juce | |||||
| #endif // __JUCE_IIRFILTER_OLD_JUCEHEADER__ | |||||
| @@ -0,0 +1,24 @@ | |||||
| diff --git a/modules/juce_audio_basics/juce_audio_basics.cpp b/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| index 258de8f..c5a6bfa 100644 | |||||
| --- a/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| +++ b/modules/juce_audio_basics/juce_audio_basics.cpp | |||||
| @@ -83,6 +83,7 @@ namespace juce | |||||
| #include "buffers/juce_FloatVectorOperations.cpp" | |||||
| #include "buffers/juce_AudioChannelSet.cpp" | |||||
| #include "effects/juce_IIRFilter.cpp" | |||||
| +#include "effects/juce_IIRFilterOld.cpp" | |||||
| #include "effects/juce_LagrangeInterpolator.cpp" | |||||
| #include "effects/juce_CatmullRomInterpolator.cpp" | |||||
| #include "midi/juce_MidiBuffer.cpp" | |||||
| diff --git a/modules/juce_audio_basics/juce_audio_basics.h b/modules/juce_audio_basics/juce_audio_basics.h | |||||
| index feb2a6e..ce6c8f4 100644 | |||||
| --- a/modules/juce_audio_basics/juce_audio_basics.h | |||||
| +++ b/modules/juce_audio_basics/juce_audio_basics.h | |||||
| @@ -63,6 +63,7 @@ namespace juce | |||||
| #include "buffers/juce_AudioChannelSet.h" | |||||
| #include "effects/juce_Decibels.h" | |||||
| #include "effects/juce_IIRFilter.h" | |||||
| +#include "effects/juce_IIRFilterOld.h" | |||||
| #include "effects/juce_LagrangeInterpolator.h" | |||||
| #include "effects/juce_CatmullRomInterpolator.h" | |||||
| #include "effects/juce_LinearSmoothedValue.h" | |||||
| @@ -0,0 +1,15 @@ | |||||
| diff --git a/modules/juce_core/threads/juce_WaitableEvent.h b/modules/juce_core/threads/juce_WaitableEvent.h | |||||
| index 3e31a9772..766d45f75 100644 | |||||
| --- a/modules/juce_core/threads/juce_WaitableEvent.h | |||||
| +++ b/modules/juce_core/threads/juce_WaitableEvent.h | |||||
| @@ -20,6 +20,10 @@ | |||||
| ============================================================================== | |||||
| */ | |||||
| +#if JUCE_MINGW | |||||
| +#include "mingw-std-threads/mingw.condition_variable.h" | |||||
| +#endif | |||||
| + | |||||
| namespace juce | |||||
| { | |||||
| @@ -0,0 +1,119 @@ | |||||
| diff --git a/modules/juce_core/native/juce_linux_Files.cpp b/modules/juce_core/native/juce_linux_Files.cpp | |||||
| index e794447c3..4f8918375 100644 | |||||
| --- a/modules/juce_core/native/juce_linux_Files.cpp | |||||
| +++ b/modules/juce_core/native/juce_linux_Files.cpp | |||||
| @@ -211,15 +211,21 @@ bool Process::openDocument (const String& fileName, const String& parameters) | |||||
| const char* const argv[4] = { "/bin/sh", "-c", cmdString.toUTF8(), nullptr }; | |||||
| - auto cpid = fork(); | |||||
| +#if JUCE_USE_VFORK | |||||
| + const auto cpid = vfork(); | |||||
| +#else | |||||
| + const auto cpid = fork(); | |||||
| +#endif | |||||
| if (cpid == 0) | |||||
| { | |||||
| +#if ! JUCE_USE_VFORK | |||||
| setsid(); | |||||
| +#endif | |||||
| // Child process | |||||
| - execve (argv[0], (char**) argv, environ); | |||||
| - exit (0); | |||||
| + if (execvp (argv[0], (char**) argv) < 0) | |||||
| + _exit (0); | |||||
| } | |||||
| return cpid >= 0; | |||||
| diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm | |||||
| index 73ed29f4e..d6c4fcf3e 100644 | |||||
| --- a/modules/juce_core/native/juce_mac_Files.mm | |||||
| +++ b/modules/juce_core/native/juce_mac_Files.mm | |||||
| @@ -92,23 +92,22 @@ namespace MacFileHelpers | |||||
| #else | |||||
| static bool launchExecutable (const String& pathAndArguments) | |||||
| { | |||||
| + const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), nullptr }; | |||||
| + | |||||
| +#if JUCE_USE_VFORK | |||||
| + const auto cpid = vfork(); | |||||
| +#else | |||||
| auto cpid = fork(); | |||||
| +#endif | |||||
| if (cpid == 0) | |||||
| { | |||||
| - const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), nullptr }; | |||||
| - | |||||
| // Child process | |||||
| - if (execve (argv[0], (char**) argv, nullptr) < 0) | |||||
| - exit (0); | |||||
| - } | |||||
| - else | |||||
| - { | |||||
| - if (cpid < 0) | |||||
| - return false; | |||||
| + if (execvp (argv[0], (char**) argv) < 0) | |||||
| + _exit (0); | |||||
| } | |||||
| - return true; | |||||
| + return cpid >= 0; | |||||
| } | |||||
| #endif | |||||
| } | |||||
| diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| index 2b0e16844..fc04da66a 100644 | |||||
| --- a/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| +++ b/modules/juce_core/native/juce_posix_SharedCode.h | |||||
| @@ -1090,7 +1090,18 @@ public: | |||||
| if (pipe (pipeHandles) == 0) | |||||
| { | |||||
| - auto result = fork(); | |||||
| + Array<char*> argv; | |||||
| + for (auto& arg : arguments) | |||||
| + if (arg.isNotEmpty()) | |||||
| + argv.add (const_cast<char*> (arg.toRawUTF8())); | |||||
| + | |||||
| + argv.add (nullptr); | |||||
| + | |||||
| +#if JUCE_USE_VFORK | |||||
| + const pid_t result = vfork(); | |||||
| +#else | |||||
| + const pid_t result = fork(); | |||||
| +#endif | |||||
| if (result < 0) | |||||
| { | |||||
| @@ -1099,6 +1110,7 @@ public: | |||||
| } | |||||
| else if (result == 0) | |||||
| { | |||||
| +#if ! JUCE_USE_VFORK | |||||
| // we're the child process.. | |||||
| close (pipeHandles[0]); // close the read handle | |||||
| @@ -1113,17 +1125,10 @@ public: | |||||
| dup2 (open ("/dev/null", O_WRONLY), STDERR_FILENO); | |||||
| close (pipeHandles[1]); | |||||
| +#endif | |||||
| - Array<char*> argv; | |||||
| - | |||||
| - for (auto& arg : arguments) | |||||
| - if (arg.isNotEmpty()) | |||||
| - argv.add (const_cast<char*> (arg.toRawUTF8())); | |||||
| - | |||||
| - argv.add (nullptr); | |||||
| - | |||||
| - execvp (exe.toRawUTF8(), argv.getRawDataPointer()); | |||||
| - _exit (-1); | |||||
| + if (execvp (exe.toRawUTF8(), argv.getRawDataPointer()) < 0) | |||||
| + _exit (-1); | |||||
| } | |||||
| else | |||||
| { | |||||
| @@ -0,0 +1,13 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| index e3d277de2..e9a5c6cb1 100644 | |||||
| --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| @@ -206,6 +206,8 @@ struct SharedMessageThread : public Thread | |||||
| MessageManager::getInstance()->setCurrentThreadAsMessageThread(); | |||||
| initialised = true; | |||||
| + XWindowSystem::getInstance(); | |||||
| + | |||||
| while ((! threadShouldExit()) && MessageManager::getInstance()->runDispatchLoopUntil (250)) | |||||
| {} | |||||
| } | |||||
| @@ -0,0 +1,76 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| index e9a5c6cb1..712543ac7 100644 | |||||
| --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| @@ -902,7 +902,7 @@ public: | |||||
| if (auto* ed = processor->createEditorIfNeeded()) | |||||
| { | |||||
| setHasEditorFlag (true); | |||||
| - editorComp.reset (new EditorCompWrapper (*this, *ed)); | |||||
| + editorComp.reset (new EditorCompWrapper (*this, *ed, lastScaleFactorReceived)); | |||||
| } | |||||
| else | |||||
| { | |||||
| @@ -1026,11 +1026,14 @@ public: | |||||
| , public Timer | |||||
| #endif | |||||
| { | |||||
| - EditorCompWrapper (JuceVSTWrapper& w, AudioProcessorEditor& editor) | |||||
| - : wrapper (w) | |||||
| + EditorCompWrapper (JuceVSTWrapper& w, AudioProcessorEditor& editor, float scaleFactor) | |||||
| + : wrapper (w), | |||||
| + editorScaleFactor (scaleFactor) | |||||
| { | |||||
| editor.setOpaque (true); | |||||
| editor.setVisible (true); | |||||
| + editor.setScaleFactor (scaleFactor); | |||||
| + | |||||
| setOpaque (true); | |||||
| setTopLeftPosition (editor.getPosition()); | |||||
| @@ -1064,6 +1067,24 @@ public: | |||||
| { | |||||
| auto b = getSizeToContainChild(); | |||||
| bounds = convertToHostBounds ({ 0, 0, (int16) b.getHeight(), (int16) b.getWidth() }); | |||||
| + | |||||
| + #if JUCE_LINUX | |||||
| + if (auto* ed = getEditorComp()) | |||||
| + { | |||||
| + if (auto* peer = ed->getPeer()) | |||||
| + { | |||||
| + auto scale = (float) peer->getPlatformScaleFactor(); | |||||
| + | |||||
| + if (approximatelyEqual (scale, 1.0f)) | |||||
| + return; | |||||
| + | |||||
| + bounds.upper *= scale; | |||||
| + bounds.leftmost *= scale; | |||||
| + bounds.lower *= scale; | |||||
| + bounds.rightmost *= scale; | |||||
| + } | |||||
| + } | |||||
| + #endif | |||||
| } | |||||
| void attachToHost (VstOpCodeArguments args) | |||||
| @@ -1169,9 +1190,9 @@ public: | |||||
| setTopLeftPosition (0, getHeight() - pos.getHeight()); | |||||
| #endif | |||||
| + #if ! JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail. | |||||
| resizeHostWindow (pos.getWidth(), pos.getHeight()); | |||||
| - #if ! JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail. | |||||
| if (! resizeEditor) // this is needed to prevent an infinite resizing loop due to coordinate rounding | |||||
| shouldResizeEditor = false; | |||||
| @@ -1186,6 +1207,9 @@ public: | |||||
| if (auto* peer = ed->getPeer()) | |||||
| scale *= (float) peer->getPlatformScaleFactor(); | |||||
| + resizeHostWindow (roundToInt (pos.getWidth() * scale), | |||||
| + roundToInt (pos.getHeight() * scale)); | |||||
| + | |||||
| X11Symbols::getInstance()->xResizeWindow (display, (Window) getWindowHandle(), | |||||
| static_cast<unsigned int> (roundToInt (pos.getWidth() * scale)), | |||||
| static_cast<unsigned int> (roundToInt (pos.getHeight() * scale))); | |||||
| @@ -0,0 +1,47 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| index 159ab0c7c..e3d277de2 100644 | |||||
| --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| @@ -1058,7 +1058,7 @@ public: | |||||
| void paint (Graphics&) override {} | |||||
| - void getEditorBounds (Vst2::ERect& bounds) | |||||
| + void getEditorBounds (Vst2::VstEditorBounds& bounds) | |||||
| { | |||||
| auto b = getSizeToContainChild(); | |||||
| bounds = convertToHostBounds ({ 0, 0, (int16) b.getHeight(), (int16) b.getWidth() }); | |||||
| @@ -1199,8 +1199,8 @@ public: | |||||
| void resizeHostWindow (int newWidth, int newHeight) | |||||
| { | |||||
| auto rect = convertToHostBounds ({ 0, 0, (int16) newHeight, (int16) newWidth }); | |||||
| - newWidth = rect.right - rect.left; | |||||
| - newHeight = rect.bottom - rect.top; | |||||
| + newWidth = rect.rightmost - rect.leftmost; | |||||
| + newHeight = rect.lower - rect.upper; | |||||
| bool sizeWasSuccessful = false; | |||||
| @@ -1329,17 +1329,17 @@ public: | |||||
| #endif | |||||
| //============================================================================== | |||||
| - static Vst2::ERect convertToHostBounds (const Vst2::ERect& rect) | |||||
| + static Vst2::VstEditorBounds convertToHostBounds (const Vst2::VstEditorBounds& rect) | |||||
| { | |||||
| auto desktopScale = Desktop::getInstance().getGlobalScaleFactor(); | |||||
| if (approximatelyEqual (desktopScale, 1.0f)) | |||||
| return rect; | |||||
| - return { (int16) roundToInt (rect.top * desktopScale), | |||||
| - (int16) roundToInt (rect.left * desktopScale), | |||||
| - (int16) roundToInt (rect.bottom * desktopScale), | |||||
| - (int16) roundToInt (rect.right * desktopScale)}; | |||||
| + return { (int16) roundToInt (rect.upper * desktopScale), | |||||
| + (int16) roundToInt (rect.leftmost * desktopScale), | |||||
| + (int16) roundToInt (rect.lower * desktopScale), | |||||
| + (int16) roundToInt (rect.rightmost * desktopScale)}; | |||||
| } | |||||
| //============================================================================== | |||||
| @@ -0,0 +1,53 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | |||||
| index 4a62a262b..e00d02fbe 100644 | |||||
| --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | |||||
| +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | |||||
| @@ -1177,8 +1177,26 @@ private: | |||||
| if (size != nullptr && component != nullptr) | |||||
| { | |||||
| auto editorBounds = component->getSizeToContainChild(); | |||||
| + auto width = editorBounds.getWidth(); | |||||
| + auto height = editorBounds.getHeight(); | |||||
| - *size = convertToHostBounds ({ 0, 0, editorBounds.getWidth(), editorBounds.getHeight() }); | |||||
| + #if JUCE_LINUX | |||||
| + if (component != nullptr) | |||||
| + { | |||||
| + if (auto* peer = component->getPeer()) | |||||
| + { | |||||
| + auto scale = (float) peer->getPlatformScaleFactor(); | |||||
| + | |||||
| + if (! approximatelyEqual (scale, 1.0f)) | |||||
| + { | |||||
| + width *= scale; | |||||
| + height *= scale; | |||||
| + } | |||||
| + } | |||||
| + } | |||||
| + #endif | |||||
| + | |||||
| + *size = convertToHostBounds ({ 0, 0, width, height }); | |||||
| return kResultTrue; | |||||
| } | |||||
| @@ -1464,7 +1482,19 @@ private: | |||||
| if (owner.plugFrame != nullptr) | |||||
| { | |||||
| - auto newSize = convertToHostBounds ({ 0, 0, b.getWidth(), b.getHeight() }); | |||||
| + #if JUCE_LINUX | |||||
| + if (auto* peer = getPeer()) | |||||
| + { | |||||
| + auto scale = (float) peer->getPlatformScaleFactor(); | |||||
| + | |||||
| + if (! approximatelyEqual (scale, 1.0f)) | |||||
| + { | |||||
| + w *= scale; | |||||
| + h *= scale; | |||||
| + } | |||||
| + } | |||||
| + #endif | |||||
| + auto newSize = convertToHostBounds ({ 0, 0, w, h }); | |||||
| { | |||||
| const ScopedValueSetter<bool> resizingParentSetter (resizingParent, true); | |||||
| @@ -0,0 +1,34 @@ | |||||
| diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| index d0c1884db..c87b97d49 100644 | |||||
| --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp | |||||
| @@ -210,9 +210,9 @@ struct SharedMessageThread : public Thread | |||||
| void run() override | |||||
| { | |||||
| initialiseJuce_GUI(); | |||||
| - initialised = true; | |||||
| MessageManager::getInstance()->setCurrentThreadAsMessageThread(); | |||||
| + initialised = true; | |||||
| while ((! threadShouldExit()) && MessageManager::getInstance()->runDispatchLoopUntil (250)) | |||||
| {} | |||||
| @@ -300,9 +300,6 @@ public: | |||||
| // You must at least have some channels | |||||
| jassert (processor->isMidiEffect() || (maxNumInChannels > 0 || maxNumOutChannels > 0)); | |||||
| - if (processor->isMidiEffect()) | |||||
| - maxNumInChannels = maxNumOutChannels = 2; | |||||
| - | |||||
| #ifdef JucePlugin_PreferredChannelConfigurations | |||||
| processor->setPlayConfigDetails (maxNumInChannels, maxNumOutChannels, 44100.0, 1024); | |||||
| #endif | |||||
| @@ -1827,7 +1824,7 @@ private: | |||||
| pointer_sized_int handleGetPlugInName (VstOpCodeArguments args) | |||||
| { | |||||
| - String (JucePlugin_Name).copyToUTF8 ((char*) args.ptr, 64 + 1); | |||||
| + String (processor->getName()).copyToUTF8 ((char*) args.ptr, 64 + 1); | |||||
| return 1; | |||||
| } | |||||