Browse Source

Update to latest JUCE

Signed-off-by: falkTX <falktx@falktx.com>
tags/2021-03-15
falkTX 3 years ago
parent
commit
9dc5ca5cb5
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
100 changed files with 8081 additions and 2479 deletions
  1. +2
    -2
      libs/juce-current/patches/01_audiodevicemanager-prefer-jack-over-alsa.patch
  2. +2
    -2
      libs/juce-current/patches/03_fix-midi-message-constness.patch
  3. +245
    -704
      libs/juce-current/patches/04_vst2-interface.patch
  4. +538
    -0
      libs/juce-current/patches/04_vst2-interface_file.patch
  5. +0
    -78
      libs/juce-current/patches/04_vst2-interface_pt2.patch
  6. +3
    -3
      libs/juce-current/patches/05_mingw-fixes.patch
  7. +25
    -25
      libs/juce-current/patches/06_old-compiler-compatibility.patch
  8. +2
    -2
      libs/juce-current/patches/09_proper-getExecutableFile.patch
  9. +5
    -5
      libs/juce-current/patches/10_fix-fork-exec-usage.patch
  10. +3
    -3
      libs/juce-current/patches/11_childprocess-getPID.patch
  11. +3
    -3
      libs/juce-current/patches/12_linux-filechooser-needs-modal-loops.patch
  12. +18
    -11
      libs/juce-current/patches/14_fix-x11-temporary-windows.patch
  13. +2
    -2
      libs/juce-current/patches/15_fix-linux-thread-prio.patch
  14. +2
    -2
      libs/juce-current/patches/17_allow-vst2-without-audio.patch
  15. +5
    -3
      libs/juce-current/patches/19_fix-vst2-linux-gui-init.patch
  16. +9
    -9
      libs/juce-current/patches/21_audioprocessor-no-gui.patch
  17. +10
    -7
      libs/juce-current/patches/22_mingw-filechooser-no-vista.patch
  18. +2
    -2
      libs/juce-current/patches/23_fix-juce-includes.patch
  19. +2
    -2
      libs/juce-current/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp
  20. +1
    -1
      libs/juce-current/source/modules/juce_audio_basics/juce_audio_basics.h
  21. +72
    -4
      libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp
  22. +432
    -80
      libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp
  23. +200
    -16
      libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  24. +38
    -4
      libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiMessage.h
  25. +30
    -8
      libs/juce-current/source/modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp
  26. +2
    -0
      libs/juce-current/source/modules/juce_audio_basics/mpe/juce_MPEInstrument.h
  27. +1
    -1
      libs/juce-current/source/modules/juce_audio_basics/utilities/juce_ADSR.h
  28. +1
    -1
      libs/juce-current/source/modules/juce_audio_basics/utilities/juce_Interpolators.cpp
  29. +1
    -1
      libs/juce-current/source/modules/juce_audio_basics/utilities/juce_LagrangeInterpolator.cpp
  30. +13
    -6
      libs/juce-current/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  31. +1
    -1
      libs/juce-current/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h
  32. +2
    -3
      libs/juce-current/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h
  33. +31
    -2
      libs/juce-current/source/modules/juce_audio_devices/juce_audio_devices.cpp
  34. +1
    -1
      libs/juce-current/source/modules/juce_audio_devices/juce_audio_devices.h
  35. +134
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPBytestreamInputHandler.h
  36. +326
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPConversion.h
  37. +165
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPConverters.h
  38. +190
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPDispatcher.h
  39. +534
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPFactory.h
  40. +126
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPIterator.h
  41. +213
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPMidi1ToBytestreamTranslator.h
  42. +195
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPMidi1ToMidi2DefaultTranslator.cpp
  43. +187
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPMidi1ToMidi2DefaultTranslator.h
  44. +44
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPProtocols.h
  45. +40
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPReceiver.h
  46. +53
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPSysEx7.cpp
  47. +73
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPSysEx7.h
  48. +1020
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPTests.cpp
  49. +145
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPU32InputHandler.h
  50. +59
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPUtils.cpp
  51. +113
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPUtils.h
  52. +35
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPView.cpp
  53. +88
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPView.h
  54. +187
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPacket.h
  55. +92
    -0
      libs/juce-current/source/modules/juce_audio_devices/midi_io/ump/juce_UMPackets.h
  56. +22
    -7
      libs/juce-current/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  57. +0
    -732
      libs/juce-current/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp
  58. +1325
    -0
      libs/juce-current/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.mm
  59. +26
    -26
      libs/juce-current/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp
  60. +7
    -14
      libs/juce-current/source/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp
  61. +54
    -39
      libs/juce-current/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  62. +2
    -2
      libs/juce-current/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
  63. +17
    -10
      libs/juce-current/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp
  64. +6
    -6
      libs/juce-current/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
  65. +4
    -2
      libs/juce-current/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  66. +2
    -2
      libs/juce-current/source/modules/juce_audio_formats/juce_audio_formats.h
  67. +27
    -9
      libs/juce-current/source/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  68. +26
    -13
      libs/juce-current/source/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  69. +75
    -63
      libs/juce-current/source/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm
  70. +2
    -2
      libs/juce-current/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp
  71. +2
    -0
      libs/juce-current/source/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper_Exporter.cpp
  72. +1
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp
  73. +1
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/Unity/juce_UnityPluginInterface.h
  74. +2
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp
  75. +144
    -136
      libs/juce-current/source/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  76. +216
    -145
      libs/juce-current/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  77. +1
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/juce_audio_plugin_client.h
  78. +5
    -1
      libs/juce-current/source/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm
  79. +2
    -0
      libs/juce-current/source/modules/juce_audio_plugin_client/juce_audio_plugin_client_Standalone.cpp
  80. +26
    -19
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_AU_Shared.h
  81. +9
    -4
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  82. +1
    -1
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  83. +15
    -18
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_VST3Common.h
  84. +107
    -175
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  85. +18
    -20
      libs/juce-current/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  86. +92
    -3
      libs/juce-current/source/modules/juce_audio_processors/juce_audio_processors.cpp
  87. +1
    -1
      libs/juce-current/source/modules/juce_audio_processors/juce_audio_processors.h
  88. +25
    -3
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
  89. +3
    -2
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h
  90. +27
    -4
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp
  91. +21
    -0
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h
  92. +23
    -1
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h
  93. +1
    -1
      libs/juce-current/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp
  94. +1
    -1
      libs/juce-current/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp
  95. +1
    -1
      libs/juce-current/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp
  96. +3
    -3
      libs/juce-current/source/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp
  97. +1
    -1
      libs/juce-current/source/modules/juce_audio_utils/juce_audio_utils.h
  98. +2
    -2
      libs/juce-current/source/modules/juce_audio_utils/native/juce_mac_AudioCDReader.mm
  99. +4
    -4
      libs/juce-current/source/modules/juce_core/containers/juce_AbstractFifo.h
  100. +8
    -8
      libs/juce-current/source/modules/juce_core/containers/juce_Array.h

+ 2
- 2
libs/juce-current/patches/01_audiodevicemanager-prefer-jack-over-alsa.patch View File

@@ -1,8 +1,8 @@
diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
index dc2ad8e3b..1f03bc047 100644
index a19c7b05e..deabba6db 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>&
@@ -185,8 +185,8 @@ void AudioDeviceManager::createAudioDeviceTypes (OwnedArray<AudioIODeviceType>&
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_CoreAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_iOSAudio());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_Bela());


+ 2
- 2
libs/juce-current/patches/03_fix-midi-message-constness.patch View File

@@ -1,8 +1,8 @@
diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.h b/modules/juce_audio_basics/midi/juce_MidiMessage.h
index 2d9e5adf0..30a609cec 100644
index 22ac79483..5c761f659 100644
--- a/modules/juce_audio_basics/midi/juce_MidiMessage.h
+++ b/modules/juce_audio_basics/midi/juce_MidiMessage.h
@@ -945,7 +945,7 @@ private:
@@ -979,7 +979,7 @@ private:
#endif
inline bool isHeapAllocated() const noexcept { return size > (int) sizeof (packedData); }


+ 245
- 704
libs/juce-current/patches/04_vst2-interface.patch
File diff suppressed because it is too large
View File


+ 538
- 0
libs/juce-current/patches/04_vst2-interface_file.patch View File

@@ -0,0 +1,538 @@
diff --git a/modules/juce_audio_processors/format_types/juce_VSTInterface.h b/modules/juce_audio_processors/format_types/juce_VSTInterface.h
new file mode 100644
index 000000000..58179be1a
--- /dev/null
+++ b/modules/juce_audio_processors/format_types/juce_VSTInterface.h
@@ -0,0 +1,532 @@
+/*
+ ==============================================================================
+
+ This file is part of the JUCE library.
+ Copyright (c) 2017 - ROLI Ltd.
+
+ JUCE is an open source library subject to commercial or open-source
+ licensing.
+
+ By using JUCE, you agree to the terms of both the JUCE 5 End-User License
+ Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
+ 27th April 2017).
+
+ End User License Agreement: www.juce.com/juce-5-licence
+ Privacy Policy: www.juce.com/juce-5-privacy-policy
+
+ Or: You may also use this code under the terms of the GPL v3 (see
+ www.gnu.org/licenses).
+
+ JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
+ EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
+ DISCLAIMED.
+
+ ==============================================================================
+*/
+
+#ifndef JUCE_VSTINTERFACE_H_INCLUDED
+#define JUCE_VSTINTERFACE_H_INCLUDED
+
+using namespace juce;
+
+#if JUCE_MSVC
+ #define VSTINTERFACECALL __cdecl
+ #pragma pack(push)
+ #pragma pack(8)
+#elif JUCE_MAC || JUCE_IOS
+ #define VSTINTERFACECALL
+ #if JUCE_64BIT
+ #pragma options align=power
+ #else
+ #pragma options align=mac68k
+ #endif
+#else
+ #define VSTINTERFACECALL
+ #pragma pack(push, 8)
+#endif
+
+const int32 juceVstInterfaceVersion = 2400;
+const int32 juceVstInterfaceIdentifier = 0x56737450; // The "magic" identifier in the SDK is 'VstP'.
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstEffectInterface
+{
+ int32 interfaceIdentifier;
+ pointer_sized_int (VSTINTERFACECALL* dispatchFunction) (VstEffectInterface*, int32 op, int32 index, pointer_sized_int value, void* ptr, float opt);
+ void (VSTINTERFACECALL* processAudioFunction) (VstEffectInterface*, float** inputs, float** outputs, int32 numSamples);
+ void (VSTINTERFACECALL* setParameterValueFunction) (VstEffectInterface*, int32 parameterIndex, float value);
+ float (VSTINTERFACECALL* getParameterValueFunction) (VstEffectInterface*, int32 parameterIndex);
+ int32 numPrograms;
+ int32 numParameters;
+ int32 numInputChannels;
+ int32 numOutputChannels;
+ int32 flags;
+ pointer_sized_int hostSpace1;
+ pointer_sized_int hostSpace2;
+ int32 latency;
+ int32 deprecated1;
+ int32 deprecated2;
+ float deprecated3;
+ void* effectPointer;
+ void* userPointer;
+ int32 plugInIdentifier;
+ int32 plugInVersion;
+ void (VSTINTERFACECALL* processAudioInplaceFunction) (VstEffectInterface*, float** inputs, float** outputs, int32 numSamples);
+ void (VSTINTERFACECALL* processDoubleAudioInplaceFunction) (VstEffectInterface*, double** inputs, double** outputs, int32 numSamples);
+ char emptySpace[56];
+};
+
+typedef pointer_sized_int (VSTINTERFACECALL* VstHostCallback) (VstEffectInterface*, int32 op, int32 index, pointer_sized_int value, void* ptr, float opt);
+
+enum VstEffectInterfaceFlags
+{
+ vstEffectFlagHasEditor = 1,
+ vstEffectFlagInplaceAudio = 16,
+ vstEffectFlagDataInChunks = 32,
+ vstEffectFlagIsSynth = 256,
+ vstEffectFlagInplaceDoubleAudio = 4096
+};
+
+//==============================================================================
+enum VstHostToPlugInOpcodes
+{
+ plugInOpcodeOpen,
+ plugInOpcodeClose,
+ plugInOpcodeSetCurrentProgram,
+ plugInOpcodeGetCurrentProgram,
+ plugInOpcodeSetCurrentProgramName,
+ plugInOpcodeGetCurrentProgramName,
+ plugInOpcodeGetParameterLabel,
+ plugInOpcodeGetParameterText,
+ plugInOpcodeGetParameterName,
+ plugInOpcodeSetSampleRate = plugInOpcodeGetParameterName + 2,
+ plugInOpcodeSetBlockSize,
+ plugInOpcodeResumeSuspend,
+ plugInOpcodeGetEditorBounds,
+ plugInOpcodeOpenEditor,
+ plugInOpcodeCloseEditor,
+ plugInOpcodeDrawEditor,
+ plugInOpcodeGetMouse,
+ plugInOpcodeEditorIdle = plugInOpcodeGetMouse + 2,
+ plugInOpcodeeffEditorTop,
+ plugInOpcodeSleepEditor,
+ plugInOpcodeIdentify,
+ plugInOpcodeGetData,
+ plugInOpcodeSetData,
+ plugInOpcodePreAudioProcessingEvents,
+ plugInOpcodeIsParameterAutomatable,
+ plugInOpcodeParameterValueForText,
+ plugInOpcodeGetProgramName = plugInOpcodeParameterValueForText + 2,
+ plugInOpcodeConnectInput = plugInOpcodeGetProgramName + 2,
+ plugInOpcodeConnectOutput,
+ plugInOpcodeGetInputPinProperties,
+ plugInOpcodeGetOutputPinProperties,
+ plugInOpcodeGetPlugInCategory,
+ plugInOpcodeSetSpeakerConfiguration = plugInOpcodeGetPlugInCategory + 7,
+ plugInOpcodeSetBypass = plugInOpcodeSetSpeakerConfiguration + 2,
+ plugInOpcodeGetPlugInName,
+ plugInOpcodeGetManufacturerName = plugInOpcodeGetPlugInName + 2,
+ plugInOpcodeGetManufacturerProductName,
+ plugInOpcodeGetManufacturerVersion,
+ plugInOpcodeManufacturerSpecific,
+ plugInOpcodeCanPlugInDo,
+ plugInOpcodeGetTailSize,
+ plugInOpcodeIdle,
+ plugInOpcodeKeyboardFocusRequired = plugInOpcodeIdle + 4,
+ plugInOpcodeGetVstInterfaceVersion,
+ plugInOpcodeGetCurrentMidiProgram = plugInOpcodeGetVstInterfaceVersion + 5,
+ plugInOpcodeGetSpeakerArrangement = plugInOpcodeGetCurrentMidiProgram + 6,
+ plugInOpcodeNextPlugInUniqueID,
+ plugInOpcodeStartProcess,
+ plugInOpcodeStopProcess,
+ plugInOpcodeSetNumberOfSamplesToProcess,
+ plugInOpcodeSetSampleFloatType = plugInOpcodeSetNumberOfSamplesToProcess + 4,
+ pluginOpcodeGetNumMidiInputChannels,
+ pluginOpcodeGetNumMidiOutputChannels,
+ plugInOpcodeMaximum = pluginOpcodeGetNumMidiOutputChannels
+};
+
+
+enum VstPlugInToHostOpcodes
+{
+ hostOpcodeParameterChanged,
+ hostOpcodeVstVersion,
+ hostOpcodeCurrentId,
+ hostOpcodeIdle,
+ hostOpcodePinConnected,
+ hostOpcodePlugInWantsMidi = hostOpcodePinConnected + 2,
+ hostOpcodeGetTimingInfo,
+ hostOpcodePreAudioProcessingEvents,
+ hostOpcodeSetTime,
+ hostOpcodeTempoAt,
+ hostOpcodeGetNumberOfAutomatableParameters,
+ hostOpcodeGetParameterInterval,
+ hostOpcodeIOModified,
+ hostOpcodeNeedsIdle,
+ hostOpcodeWindowSize,
+ hostOpcodeGetSampleRate,
+ hostOpcodeGetBlockSize,
+ hostOpcodeGetInputLatency,
+ hostOpcodeGetOutputLatency,
+ hostOpcodeGetPreviousPlugIn,
+ hostOpcodeGetNextPlugIn,
+ hostOpcodeWillReplace,
+ hostOpcodeGetCurrentAudioProcessingLevel,
+ hostOpcodeGetAutomationState,
+ hostOpcodeOfflineStart,
+ hostOpcodeOfflineReadSource,
+ hostOpcodeOfflineWrite,
+ hostOpcodeOfflineGetCurrentPass,
+ hostOpcodeOfflineGetCurrentMetaPass,
+ hostOpcodeSetOutputSampleRate,
+ hostOpcodeGetOutputSpeakerConfiguration,
+ hostOpcodeGetManufacturerName,
+ hostOpcodeGetProductName,
+ hostOpcodeGetManufacturerVersion,
+ hostOpcodeManufacturerSpecific,
+ hostOpcodeSetIcon,
+ hostOpcodeCanHostDo,
+ hostOpcodeGetLanguage,
+ hostOpcodeOpenEditorWindow,
+ hostOpcodeCloseEditorWindow,
+ hostOpcodeGetDirectory,
+ hostOpcodeUpdateView,
+ hostOpcodeParameterChangeGestureBegin,
+ hostOpcodeParameterChangeGestureEnd,
+};
+
+//==============================================================================
+enum VstProcessingSampleType
+{
+ vstProcessingSampleTypeFloat,
+ vstProcessingSampleTypeDouble
+};
+
+//==============================================================================
+// These names must be identical to the Steinberg SDK so JUCE users can set
+// exactly what they want.
+enum VstPlugInCategory
+{
+ kPlugCategUnknown,
+ kPlugCategEffect,
+ kPlugCategSynth,
+ kPlugCategAnalysis,
+ kPlugCategMastering,
+ kPlugCategSpacializer,
+ kPlugCategRoomFx,
+ kPlugSurroundFx,
+ kPlugCategRestoration,
+ kPlugCategOfflineProcess,
+ kPlugCategShell,
+ kPlugCategGenerator
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstEditorBounds
+{
+ int16 upper;
+ int16 leftmost;
+ int16 lower;
+ int16 rightmost;
+};
+
+//==============================================================================
+enum VstMaxStringLengths
+{
+ vstMaxNameLength = 64,
+ vstMaxParameterOrPinLabelLength = 64,
+ vstMaxParameterOrPinShortLabelLength = 8,
+ vstMaxCategoryLength = 24,
+ vstMaxManufacturerStringLength = 64,
+ vstMaxPlugInNameStringLength = 64
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstPinInfo
+{
+ char text[vstMaxParameterOrPinLabelLength];
+ int32 flags;
+ int32 configurationType;
+ char shortText[vstMaxParameterOrPinShortLabelLength];
+ char unused[48];
+};
+
+enum VstPinInfoFlags
+{
+ vstPinInfoFlagIsActive = 1,
+ vstPinInfoFlagIsStereo = 2,
+ vstPinInfoFlagValid = 4
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstEvent
+{
+ int32 type;
+ int32 size;
+ int32 sampleOffset;
+ int32 flags;
+ char content[16];
+};
+
+enum VstEventTypes
+{
+ vstMidiEventType = 1,
+ vstSysExEventType = 6
+};
+
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstEventBlock
+{
+ int32 numberOfEvents;
+ pointer_sized_int future;
+ VstEvent* events[2];
+};
+
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstMidiEvent
+{
+ int32 type;
+ int32 size;
+ int32 sampleOffset;
+ int32 flags;
+ int32 noteSampleLength;
+ int32 noteSampleOffset;
+ char midiData[4];
+ char tuning;
+ char noteVelocityOff;
+ char future1;
+ char future2;
+};
+
+enum VstMidiEventFlags
+{
+ vstMidiEventIsRealtime = 1
+};
+
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstSysExEvent
+{
+ int32 type;
+ int32 size;
+ int32 offsetSamples;
+ int32 flags;
+ int32 sysExDumpSize;
+ pointer_sized_int future1;
+ char* sysExDump;
+ pointer_sized_int future2;
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstTimingInformation
+{
+ double samplePosition;
+ double sampleRate;
+ double systemTimeNanoseconds;
+ double musicalPosition;
+ double tempoBPM;
+ double lastBarPosition;
+ double loopStartPosition;
+ double loopEndPosition;
+ int32 timeSignatureNumerator;
+ int32 timeSignatureDenominator;
+ int32 smpteOffset;
+ int32 smpteRate;
+ int32 samplesToNearestClock;
+ int32 flags;
+};
+
+enum VstTimingInformationFlags
+{
+ vstTimingInfoFlagTransportChanged = 1,
+ vstTimingInfoFlagCurrentlyPlaying = 2,
+ vstTimingInfoFlagLoopActive = 4,
+ vstTimingInfoFlagCurrentlyRecording = 8,
+ vstTimingInfoFlagAutomationWriteModeActive = 64,
+ vstTimingInfoFlagAutomationReadModeActive = 128,
+ vstTimingInfoFlagNanosecondsValid = 256,
+ vstTimingInfoFlagMusicalPositionValid = 512,
+ vstTimingInfoFlagTempoValid = 1024,
+ vstTimingInfoFlagLastBarPositionValid = 2048,
+ vstTimingInfoFlagLoopPositionValid = 4096,
+ vstTimingInfoFlagTimeSignatureValid = 8192,
+ vstTimingInfoFlagSmpteValid = 16384,
+ vstTimingInfoFlagNearestClockValid = 32768
+};
+
+//==============================================================================
+enum VstSmpteRates
+{
+ vstSmpteRateFps24,
+ vstSmpteRateFps25,
+ vstSmpteRateFps2997,
+ vstSmpteRateFps30,
+ vstSmpteRateFps2997drop,
+ vstSmpteRateFps30drop,
+
+ vstSmpteRate16mmFilm,
+ vstSmpteRate35mmFilm,
+
+ vstSmpteRateFps239 = vstSmpteRate35mmFilm + 3,
+ vstSmpteRateFps249 ,
+ vstSmpteRateFps599,
+ vstSmpteRateFps60
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstIndividualSpeakerInfo
+{
+ float azimuthalAngle;
+ float elevationAngle;
+ float radius;
+ float reserved;
+ char label[vstMaxNameLength];
+ int32 type;
+ char unused[28];
+};
+
+enum VstIndividualSpeakerType
+{
+ vstIndividualSpeakerTypeUndefined = 0x7fffffff,
+ vstIndividualSpeakerTypeMono = 0,
+ vstIndividualSpeakerTypeLeft,
+ vstIndividualSpeakerTypeRight,
+ vstIndividualSpeakerTypeCentre,
+ vstIndividualSpeakerTypeLFE,
+ vstIndividualSpeakerTypeLeftSurround,
+ vstIndividualSpeakerTypeRightSurround,
+ vstIndividualSpeakerTypeLeftCentre,
+ vstIndividualSpeakerTypeRightCentre,
+ vstIndividualSpeakerTypeSurround,
+ vstIndividualSpeakerTypeCentreSurround = vstIndividualSpeakerTypeSurround,
+ vstIndividualSpeakerTypeLeftRearSurround,
+ vstIndividualSpeakerTypeRightRearSurround,
+ vstIndividualSpeakerTypeTopMiddle,
+ vstIndividualSpeakerTypeTopFrontLeft,
+ vstIndividualSpeakerTypeTopFrontCentre,
+ vstIndividualSpeakerTypeTopFrontRight,
+ vstIndividualSpeakerTypeTopRearLeft,
+ vstIndividualSpeakerTypeTopRearCentre,
+ vstIndividualSpeakerTypeTopRearRight,
+ vstIndividualSpeakerTypeLFE2
+};
+
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct VstSpeakerConfiguration
+{
+ int32 type;
+ int32 numberOfChannels;
+ VstIndividualSpeakerInfo speakers[8];
+};
+
+enum VstSpeakerConfigurationType
+{
+ vstSpeakerConfigTypeUser = -2,
+ vstSpeakerConfigTypeEmpty = -1,
+ vstSpeakerConfigTypeMono = 0,
+ vstSpeakerConfigTypeLR,
+ vstSpeakerConfigTypeLsRs,
+ vstSpeakerConfigTypeLcRc,
+ vstSpeakerConfigTypeSlSr,
+ vstSpeakerConfigTypeCLfe,
+ vstSpeakerConfigTypeLRC,
+ vstSpeakerConfigTypeLRS,
+ vstSpeakerConfigTypeLRCLfe,
+ vstSpeakerConfigTypeLRLfeS,
+ vstSpeakerConfigTypeLRCS,
+ vstSpeakerConfigTypeLRLsRs,
+ vstSpeakerConfigTypeLRCLfeS,
+ vstSpeakerConfigTypeLRLfeLsRs,
+ vstSpeakerConfigTypeLRCLsRs,
+ vstSpeakerConfigTypeLRCLfeLsRs,
+ vstSpeakerConfigTypeLRCLsRsCs,
+ vstSpeakerConfigTypeLRLsRsSlSr,
+ vstSpeakerConfigTypeLRCLfeLsRsCs,
+ vstSpeakerConfigTypeLRLfeLsRsSlSr,
+ vstSpeakerConfigTypeLRCLsRsLcRc,
+ vstSpeakerConfigTypeLRCLsRsSlSr,
+ vstSpeakerConfigTypeLRCLfeLsRsLcRc,
+ vstSpeakerConfigTypeLRCLfeLsRsSlSr,
+ vstSpeakerConfigTypeLRCLsRsLcRcCs,
+ vstSpeakerConfigTypeLRCLsRsCsSlSr,
+ vstSpeakerConfigTypeLRCLfeLsRsLcRcCs,
+ vstSpeakerConfigTypeLRCLfeLsRsCsSlSr,
+ vstSpeakerConfigTypeLRCLfeLsRsTflTfcTfrTrlTrrLfe2
+};
+
+#if JUCE_BIG_ENDIAN
+ #define JUCE_MULTICHAR_CONSTANT(a, b, c, d) (a | (((uint32) b) << 8) | (((uint32) c) << 16) | (((uint32) d) << 24))
+#else
+ #define JUCE_MULTICHAR_CONSTANT(a, b, c, d) (d | (((uint32) c) << 8) | (((uint32) b) << 16) | (((uint32) a) << 24))
+#endif
+
+enum PresonusExtensionConstants
+{
+ presonusVendorID = JUCE_MULTICHAR_CONSTANT ('P', 'r', 'e', 'S'),
+ presonusSetContentScaleFactor = JUCE_MULTICHAR_CONSTANT ('A', 'e', 'C', 's')
+};
+
+//==============================================================================
+/** Structure used for VSTs
+
+ @tags{Audio}
+*/
+struct vst2FxBank
+{
+ int32 magic1;
+ int32 size;
+ int32 magic2;
+ int32 version1;
+ int32 fxID;
+ int32 version2;
+ int32 elements;
+ int32 current;
+ char shouldBeZero[124];
+ int32 chunkSize;
+ char chunk[1];
+};
+
+#if JUCE_MSVC
+ #pragma pack(pop)
+#elif JUCE_MAC || JUCE_IOS
+ #pragma options align=reset
+#else
+ #pragma pack(pop)
+#endif
+
+#endif // JUCE_VSTINTERFACE_H_INCLUDED

+ 0
- 78
libs/juce-current/patches/04_vst2-interface_pt2.patch View File

@@ -1,78 +0,0 @@
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 3e63d3372..c09d99fc3 100644
--- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
+++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
@@ -61,10 +61,7 @@
#define __cdecl
#endif
- namespace Vst2
- {
- #include "pluginterfaces/vst2.x/vstfxstore.h"
- }
+ #include <juce_audio_processors/format_types/juce_VSTInterface.h>
#endif
@@ -1967,16 +1964,16 @@ public:
bool loadVST2CcnKBlock (const char* data, int size)
{
- auto* bank = reinterpret_cast<const Vst2::fxBank*> (data);
+ auto* bank = reinterpret_cast<const vst2FxBank*> (data);
- jassert (ByteOrder::bigEndianInt ("CcnK") == htonl ((uint32) bank->chunkMagic));
- jassert (ByteOrder::bigEndianInt ("FBCh") == htonl ((uint32) bank->fxMagic));
- jassert (htonl ((uint32) bank->version) == 1 || htonl ((uint32) bank->version) == 2);
+ jassert (ByteOrder::bigEndianInt ("CcnK") == htonl ((uint32) bank->magic1));
+ jassert (ByteOrder::bigEndianInt ("FBCh") == htonl ((uint32) bank->magic2));
+ jassert (htonl ((uint32) bank->version1) == 1 || htonl ((uint32) bank->version1) == 2);
jassert (JucePlugin_VSTUniqueID == htonl ((uint32) bank->fxID));
- setStateInformation (bank->content.data.chunk,
- jmin ((int) (size - (bank->content.data.chunk - data)),
- (int) htonl ((uint32) bank->content.data.size)));
+ setStateInformation (bank->chunk,
+ jmin ((int) (size - (bank->chunk - data)),
+ (int) htonl ((uint32) bank->chunkSize)));
return true;
}
@@ -2172,16 +2169,16 @@ public:
return status;
const int bankBlockSize = 160;
- Vst2::fxBank bank;
+ vst2FxBank bank;
zerostruct (bank);
- bank.chunkMagic = (int32) htonl (ByteOrder::bigEndianInt ("CcnK"));
- bank.byteSize = (int32) htonl (bankBlockSize - 8 + (unsigned int) mem.getSize());
- bank.fxMagic = (int32) htonl (ByteOrder::bigEndianInt ("FBCh"));
- bank.version = (int32) htonl (2);
- bank.fxID = (int32) htonl (JucePlugin_VSTUniqueID);
- bank.fxVersion = (int32) htonl (JucePlugin_VersionCode);
- bank.content.data.size = (int32) htonl ((unsigned int) mem.getSize());
+ bank.magic1 = (int32) htonl (ByteOrder::bigEndianInt ("CcnK"));
+ bank.size = (int32) htonl (bankBlockSize - 8 + (unsigned int) mem.getSize());
+ bank.magic2 = (int32) htonl (ByteOrder::bigEndianInt ("FBCh"));
+ bank.version1 = (int32) htonl (2);
+ bank.fxID = (int32) htonl (JucePlugin_VSTUniqueID);
+ bank.version2 = (int32) htonl (JucePlugin_VersionCode);
+ bank.chunkSize = (int32) htonl ((unsigned int) mem.getSize());
status = state->write (&bank, bankBlockSize);
diff --git a/modules/juce_audio_processors/format_types/juce_VSTInterface.h b/modules/juce_audio_processors/format_types/juce_VSTInterface.h
index 1b3eb7d08..58179be1a 100644
--- a/modules/juce_audio_processors/format_types/juce_VSTInterface.h
+++ b/modules/juce_audio_processors/format_types/juce_VSTInterface.h
@@ -506,7 +506,7 @@ enum PresonusExtensionConstants
@tags{Audio}
*/
-struct fxBank
+struct vst2FxBank
{
int32 magic1;
int32 size;

+ 3
- 3
libs/juce-current/patches/05_mingw-fixes.patch View File

@@ -1,5 +1,5 @@
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 23484732b..d2106179c 100644
index 8683dc728..94f6bf569 100644
--- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
+++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
@@ -61,7 +61,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996 4100)
@@ -28,10 +28,10 @@ index 6bea84307..baaa59f06 100644
#if JucePlugin_Build_LV2 && ! defined (JucePlugin_LV2URI)
#error "You need to define the JucePlugin_LV2URI value!"
diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
index adf058959..c39d6f796 100644
index 620ba9874..d9359b736 100644
--- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
+++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
@@ -61,9 +61,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4355)
@@ -62,9 +62,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4355)
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif


+ 25
- 25
libs/juce-current/patches/06_old-compiler-compatibility.patch View File

@@ -1,5 +1,5 @@
diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
index 656ab3321..c40e854aa 100644
index acd165ff0..bdc0bf58f 100644
--- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
+++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
@@ -20,6 +20,11 @@
@@ -30,10 +30,10 @@ index ac5ce32da..f0cd938ae 100644
{ kAudioChannelLayoutTag_TMH_10_2_std, { left, right, centre, topFrontCentre, leftSurroundSide, rightSurroundSide, leftSurround, rightSurround, topFrontLeft, topFrontRight, wideLeft, wideRight, topRearCentre, centreSurround, LFE, LFE2 } },
{ kAudioChannelLayoutTag_AC3_1_0_1, { centre, LFE } },
diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
index 892312098..411bf2097 100644
index 9aa4a338e..7cad3e7c1 100644
--- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
+++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
@@ -58,6 +58,10 @@
@@ -59,6 +59,10 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
namespace juce
{
@@ -44,7 +44,7 @@ index 892312098..411bf2097 100644
// Change this to disable logging of various activities
#ifndef AU_LOGGING
#define AU_LOGGING 1
@@ -274,7 +278,7 @@ namespace AudioUnitFormatHelpers
@@ -276,7 +280,7 @@ namespace AudioUnitFormatHelpers
NSBundle* bundle = [[NSBundle alloc] initWithPath: (NSString*) fileOrIdentifier.toCFString()];
NSArray* audioComponents = [bundle objectForInfoDictionaryKey: @"AudioComponents"];
@@ -54,7 +54,7 @@ index 892312098..411bf2097 100644
desc.componentManufacturer = stringToOSType (nsStringToJuce ((NSString*) [dict valueForKey: @"manufacturer"]));
desc.componentType = stringToOSType (nsStringToJuce ((NSString*) [dict valueForKey: @"type"]));
diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h
index 02c3de12e..ae60fde15 100644
index 39eac8211..f556f12b3 100644
--- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h
+++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h
@@ -1184,7 +1184,7 @@ public:
@@ -67,7 +67,7 @@ index 02c3de12e..ae60fde15 100644
//==============================================================================
/** Not for public use - this is called before deleting an editor component. */
diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h
index 407d263d0..f2dc28e36 100644
index a9a7c8eb7..aa068eaa0 100644
--- a/modules/juce_core/native/juce_osx_ObjCHelpers.h
+++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h
@@ -71,7 +71,7 @@ inline NSArray* varArrayToNSArray (const var& varToParse);
@@ -99,7 +99,7 @@ index 407d263d0..f2dc28e36 100644
return var (dynamicObject.get());
}
diff --git a/modules/juce_core/system/juce_CompilerSupport.h b/modules/juce_core/system/juce_CompilerSupport.h
index e4d87ab97..ddeef94a5 100644
index 4d96d7cb0..d76d92d49 100644
--- a/modules/juce_core/system/juce_CompilerSupport.h
+++ b/modules/juce_core/system/juce_CompilerSupport.h
@@ -92,7 +92,7 @@
@@ -112,7 +112,7 @@ index e4d87ab97..ddeef94a5 100644
#endif
diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h
index 52db7c6d6..96ce314d8 100644
index 43000cab6..0a1798ba2 100644
--- a/modules/juce_core/system/juce_PlatformDefs.h
+++ b/modules/juce_core/system/juce_PlatformDefs.h
@@ -99,11 +99,7 @@ namespace juce
@@ -129,10 +129,10 @@ index 52db7c6d6..96ce314d8 100644
#if __GNUC__ >= 7
#define JUCE_FALLTHROUGH [[gnu::fallthrough]];
diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h
index cf610da9a..9173cc34d 100644
index 5b4d293bb..6b41688b2 100644
--- a/modules/juce_core/system/juce_TargetPlatform.h
+++ b/modules/juce_core/system/juce_TargetPlatform.h
@@ -144,8 +144,8 @@
@@ -145,8 +145,8 @@
#endif
#if JUCE_MAC
@@ -144,7 +144,7 @@ index cf610da9a..9173cc34d 100644
#error "Building for OSX 10.6 is no longer supported!"
#endif
diff --git a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
index 37bf13094..60467ef61 100644
index de6ffecfc..2a85d25f5 100644
--- a/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
+++ b/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
@@ -26,6 +26,10 @@
@@ -159,10 +159,10 @@ index 37bf13094..60467ef61 100644
// This class has been renamed from CoreGraphicsImage to avoid a symbol
// collision in Pro Tools 2019.12 and possibly 2020 depending on the Pro Tools
diff --git a/modules/juce_graphics/native/juce_mac_Fonts.mm b/modules/juce_graphics/native/juce_mac_Fonts.mm
index b6a918ce1..65b094343 100644
index ff0a23a9f..88142091d 100644
--- a/modules/juce_graphics/native/juce_mac_Fonts.mm
+++ b/modules/juce_graphics/native/juce_mac_Fonts.mm
@@ -362,20 +362,20 @@ namespace CoreTextTypeLayout
@@ -359,20 +359,20 @@ namespace CoreTextTypeLayout
auto verticalJustification = text.getJustification().getOnlyVerticalFlags();
@@ -188,10 +188,10 @@ index b6a918ce1..65b094343 100644
auto frame = createCTFrame (framesetter, CGRectMake ((CGFloat) ctFrameArea.getX(), flipHeight - (CGFloat) ctFrameArea.getBottom(),
diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
index 7adb2a869..48ae2951b 100644
index 26ca40630..bd5e69ab0 100644
--- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
+++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
@@ -1528,17 +1528,21 @@ private:
@@ -1583,17 +1583,21 @@ private:
case NSEventTypeSystemDefined:
case NSEventTypeApplicationDefined:
case NSEventTypePeriodic:
@@ -215,7 +215,7 @@ index 7adb2a869..48ae2951b 100644
#if JUCE_64BIT
case NSEventTypeDirectTouch:
diff --git a/modules/juce_gui_basics/native/juce_mac_Windowing.mm b/modules/juce_gui_basics/native/juce_mac_Windowing.mm
index 5ffbe393c..ddb5aedc5 100644
index 918f0b4a6..63e15d07b 100644
--- a/modules/juce_gui_basics/native/juce_mac_Windowing.mm
+++ b/modules/juce_gui_basics/native/juce_mac_Windowing.mm
@@ -309,7 +309,7 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi
@@ -228,10 +228,10 @@ index 5ffbe393c..ddb5aedc5 100644
auto eventPos = [event locationInWindow];
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 cf8df3b72..6f8417340 100644
index b8e6e0c7e..6ad01c68a 100644
--- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
+++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
@@ -3054,7 +3054,7 @@ void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer<::Window>* peer,
@@ -3329,7 +3329,7 @@ void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer* peer, const XBut
peer->toFront (true);
peer->handleMouseEvent (MouseInputSource::InputSourceType::mouse, getLogicalMousePos (buttonPressEvent, peer->getPlatformScaleFactor()),
ModifierKeys::currentModifiers, MouseInputSource::invalidPressure,
@@ -239,12 +239,12 @@ index cf8df3b72..6f8417340 100644
+ MouseInputSource::invalidOrientation, getEventTime (buttonPressEvent));
}
void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer<::Window>* peer, const XButtonPressedEvent& buttonPressEvent) const
void XWindowSystem::handleButtonPressEvent (LinuxComponentPeer* peer, const XButtonPressedEvent& buttonPressEvent) const
diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
index 3dacc095a..820987e94 100644
index 691e5679b..ed4f3c199 100644
--- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h
+++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h
@@ -314,7 +314,7 @@ public:
@@ -321,7 +321,7 @@ public:
//==============================================================================
void handleMouseEvent (MouseInputSource::InputSourceType type, Point<float> positionWithinPeer, ModifierKeys newMods, float pressure,
@@ -254,10 +254,10 @@ index 3dacc095a..820987e94 100644
void handleMouseWheel (MouseInputSource::InputSourceType type, Point<float> positionWithinPeer,
int64 time, const MouseWheelDetails&, int touchIndex = 0);
diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp
index d4ebed7fd..df48cceaf 100644
index 9cf367411..d42555e13 100644
--- a/modules/juce_gui_extra/juce_gui_extra.cpp
+++ b/modules/juce_gui_extra/juce_gui_extra.cpp
@@ -142,7 +142,9 @@
@@ -136,7 +136,9 @@
#include "misc/juce_PushNotifications.cpp"
#include "misc/juce_RecentlyOpenedFilesList.cpp"
#include "misc/juce_SplashScreen.cpp"
@@ -267,7 +267,7 @@ index d4ebed7fd..df48cceaf 100644
#include "misc/juce_LiveConstantEditor.cpp"
#include "misc/juce_AnimatedAppComponent.cpp"
@@ -154,7 +156,9 @@
@@ -146,7 +148,9 @@
#if JUCE_MAC
#include "native/juce_mac_NSViewComponent.mm"
#include "native/juce_mac_AppleRemote.mm"
@@ -279,7 +279,7 @@ index d4ebed7fd..df48cceaf 100644
#if JUCE_IOS
diff --git a/modules/juce_gui_extra/juce_gui_extra.h b/modules/juce_gui_extra/juce_gui_extra.h
index 822c1885e..77e78c87a 100644
index bcec491c9..062bde636 100644
--- a/modules/juce_gui_extra/juce_gui_extra.h
+++ b/modules/juce_gui_extra/juce_gui_extra.h
@@ -115,7 +115,9 @@


+ 2
- 2
libs/juce-current/patches/09_proper-getExecutableFile.patch View File

@@ -1,8 +1,8 @@
diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h
index 982db865b..cfdd2d1cd 100644
index 082a5697a..c79ca18ea 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()
@@ -600,12 +600,39 @@ File juce_getExecutableFile()
auto localSymbol = (void*) juce_getExecutableFile;
dladdr (localSymbol, &exeInfo);


+ 5
- 5
libs/juce-current/patches/10_fix-fork-exec-usage.patch View File

@@ -28,7 +28,7 @@ index d2a302e3e..3dc4602ce 100644
return cpid >= 0;
diff --git a/modules/juce_core/native/juce_mac_Files.mm b/modules/juce_core/native/juce_mac_Files.mm
index d26443079..616677e1f 100644
index 1a4d07516..f385a089f 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
@@ -65,10 +65,10 @@ index d26443079..616677e1f 100644
#endif
}
diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h
index cfdd2d1cd..332a64959 100644
index c79ca18ea..ad46cf390 100644
--- a/modules/juce_core/native/juce_posix_SharedCode.h
+++ b/modules/juce_core/native/juce_posix_SharedCode.h
@@ -1092,7 +1092,18 @@ public:
@@ -1104,7 +1104,18 @@ public:
if (pipe (pipeHandles) == 0)
{
@@ -88,7 +88,7 @@ index cfdd2d1cd..332a64959 100644
if (result < 0)
{
@@ -1101,6 +1112,7 @@ public:
@@ -1113,6 +1124,7 @@ public:
}
else if (result == 0)
{
@@ -96,7 +96,7 @@ index cfdd2d1cd..332a64959 100644
// we're the child process..
close (pipeHandles[0]); // close the read handle
@@ -1115,17 +1127,10 @@ public:
@@ -1127,17 +1139,10 @@ public:
dup2 (open ("/dev/null", O_WRONLY), STDERR_FILENO);
close (pipeHandles[1]);


+ 3
- 3
libs/juce-current/patches/11_childprocess-getPID.patch View File

@@ -1,8 +1,8 @@
diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h
index 332a64959..c6d95a93a 100644
index ad46cf390..13724ba7c 100644
--- a/modules/juce_core/native/juce_posix_SharedCode.h
+++ b/modules/juce_core/native/juce_posix_SharedCode.h
@@ -1227,6 +1227,11 @@ public:
@@ -1239,6 +1239,11 @@ public:
return 0;
}
@@ -15,7 +15,7 @@ index 332a64959..c6d95a93a 100644
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 dbe0c6b5d..098416bd9 100644
index 4a4148119..1c38ff2cf 100644
--- a/modules/juce_core/native/juce_win32_Threads.cpp
+++ b/modules/juce_core/native/juce_win32_Threads.cpp
@@ -477,6 +477,11 @@ public:


+ 3
- 3
libs/juce-current/patches/12_linux-filechooser-needs-modal-loops.patch View File

@@ -1,5 +1,5 @@
diff --git a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
index 97327c59e..0eca4dfb6 100644
index b799ee2e4..803740c63 100644
--- a/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
+++ b/modules/juce_gui_basics/native/juce_linux_FileChooser.cpp
@@ -26,6 +26,7 @@
@@ -10,7 +10,7 @@ index 97327c59e..0eca4dfb6 100644
static bool exeIsAvailable (String executable)
{
ChildProcess child;
@@ -241,10 +242,11 @@ private:
@@ -245,10 +246,11 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Native)
};
@@ -23,7 +23,7 @@ index 97327c59e..0eca4dfb6 100644
return false;
#else
static bool canUseNativeBox = exeIsAvailable ("zenity") || exeIsAvailable ("kdialog");
@@ -254,7 +256,11 @@ bool FileChooser::isPlatformDialogAvailable()
@@ -258,7 +260,11 @@ bool FileChooser::isPlatformDialogAvailable()
FileChooser::Pimpl* FileChooser::showPlatformDialog (FileChooser& owner, int flags, FilePreviewComponent*)
{


+ 18
- 11
libs/juce-current/patches/14_fix-x11-temporary-windows.patch View File

@@ -1,16 +1,23 @@
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 6f8417340..5e8603833 100644
index 6ad01c68a..490a3a792 100644
--- a/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
+++ b/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
@@ -2561,8 +2561,9 @@ void XWindowSystem::setWindowType (::Window windowH, int styleFlags) const
@@ -2804,10 +2804,14 @@ void XWindowSystem::setWindowType (::Window windowH, int styleFlags) const
Atom netHints [2];
if (atoms.windowType != None)
{
- auto hint = (styleFlags & ComponentPeer::windowIsTemporary) != 0
- || ((styleFlags & ComponentPeer::windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows())
- ? XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_COMBO")
- : XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_NORMAL");
+ Atom hint = None;
+
+ if (styleFlags & ComponentPeer::windowIsTemporary)
+ hint = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_TOOLTIP");
+ else if ((styleFlags & ComponentPeer::windowHasDropShadow) == 0 && Desktop::canUseSemiTransparentWindows())
+ hint = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_COMBO");
+ else
+ hint = XWindowSystemUtilities::Atoms::getIfExists (display, "_NET_WM_WINDOW_TYPE_NORMAL");
- 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");
if (hint != None)
xchangeProperty (windowH, atoms.windowType, XA_ATOM, 32, &hint, 1);

+ 2
- 2
libs/juce-current/patches/15_fix-linux-thread-prio.patch View File

@@ -1,8 +1,8 @@
diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h
index c6d95a93a..9c9053ac4 100644
index 13724ba7c..f8892081c 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)
@@ -989,7 +989,11 @@ bool Thread::setThreadPriority (void* handle, int priority)
if (pthread_getschedparam ((pthread_t) handle, &policy, &param) != 0)
return false;


+ 2
- 2
libs/juce-current/patches/17_allow-vst2-without-audio.patch View File

@@ -1,8 +1,8 @@
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 c5e96d204..7e2122580 100644
index 94f6bf569..ddbe6fd65 100644
--- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
+++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
@@ -301,9 +301,6 @@ public:
@@ -294,9 +294,6 @@ public:
// You must at least have some channels
jassert (processor->isMidiEffect() || (maxNumInChannels > 0 || maxNumOutChannels > 0));


+ 5
- 3
libs/juce-current/patches/19_fix-vst2-linux-gui-init.patch View File

@@ -1,15 +1,17 @@
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 cff9b7a88..3ae14372c 100644
index ebc9325ca..cabbbcf13 100644
--- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
+++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
@@ -209,9 +209,9 @@ struct SharedMessageThread : public Thread
@@ -203,11 +203,11 @@ struct SharedMessageThread : public Thread
void run() override
{
initialiseJuce_GUI();
- initialised = true;
MessageManager::getInstance()->setCurrentThreadAsMessageThread();
+ initialised = true;
XWindowSystem::getInstance();
+ initialised = true;
while ((! threadShouldExit()) && MessageManager::getInstance()->runDispatchLoopUntil (250))
{}

+ 9
- 9
libs/juce-current/patches/21_audioprocessor-no-gui.patch View File

@@ -1,5 +1,5 @@
diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp
index ac194a19d..f494ec3a2 100644
index 43ad88e1b..149154804 100644
--- a/modules/juce_audio_processors/juce_audio_processors.cpp
+++ b/modules/juce_audio_processors/juce_audio_processors.cpp
@@ -47,7 +47,7 @@
@@ -11,7 +11,7 @@ index ac194a19d..f494ec3a2 100644
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <sys/utsname.h>
@@ -141,9 +141,11 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wcast-align"
@@ -230,9 +230,11 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone
#include "format_types/juce_LegacyAudioParameter.cpp"
#include "processors/juce_AudioProcessor.cpp"
#include "processors/juce_AudioPluginInstance.cpp"
@@ -26,7 +26,7 @@ index ac194a19d..f494ec3a2 100644
#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 caa55b618..41c547b0c 100644
index 040accf2e..df0b6c67b 100644
--- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
+++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp
@@ -51,12 +51,14 @@ AudioProcessor::AudioProcessor (const BusesProperties& ioConfig)
@@ -44,7 +44,7 @@ index caa55b618..41c547b0c 100644
#if JUCE_DEBUG && ! JUCE_DISABLE_AUDIOPROCESSOR_BEGIN_END_GESTURE_CHECKING
// This will fail if you've called beginParameterChangeGesture() for one
@@ -804,6 +806,7 @@ void AudioProcessor::audioIOChanged (bool busNumberChanged, bool channelNumChang
@@ -826,6 +828,7 @@ void AudioProcessor::audioIOChanged (bool busNumberChanged, bool channelNumChang
processorLayoutsChanged();
}
@@ -52,7 +52,7 @@ index caa55b618..41c547b0c 100644
//==============================================================================
void AudioProcessor::editorBeingDeleted (AudioProcessorEditor* const editor) noexcept
{
@@ -840,6 +843,7 @@ AudioProcessorEditor* AudioProcessor::createEditorIfNeeded()
@@ -862,6 +865,7 @@ AudioProcessorEditor* AudioProcessor::createEditorIfNeeded()
return ed;
}
@@ -61,7 +61,7 @@ index caa55b618..41c547b0c 100644
//==============================================================================
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 dbad562ef..ab9e8a7d6 100644
index f72a4ed3f..849b77d3c 100644
--- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h
+++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h
@@ -926,6 +926,7 @@ public:
@@ -103,10 +103,10 @@ index dbad562ef..ab9e8a7d6 100644
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 fd8c35879..070f82554 100644
index 17c5af30c..3d4a0d428 100644
--- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp
+++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp
@@ -1496,8 +1496,10 @@ bool AudioProcessorGraph::AudioGraphIOProcessor::producesMidi() const
@@ -1519,8 +1519,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; }
@@ -118,7 +118,7 @@ index fd8c35879..070f82554 100644
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 a16e35df0..8d2221f1e 100644
index a60e67d84..17a121893 100644
--- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h
+++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h
@@ -355,8 +355,10 @@ public:


+ 10
- 7
libs/juce-current/patches/22_mingw-filechooser-no-vista.patch View File

@@ -1,16 +1,16 @@
diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
index 065d873e1..fb9cfc999 100644
index 0c1138a2b..a5b42b8ef 100644
--- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
+++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp
@@ -167,6 +167,7 @@ private:
Atomic<HWND> nativeDialogRef;
Atomic<int> shouldCancel;
@@ -172,6 +172,7 @@ private:
void operator() (LPWSTR ptr) const noexcept { CoTaskMemFree (ptr); }
};
+ #if JUCE_MSVC
bool showDialog (IFileDialog& dialog, bool async) const
{
FILEOPENDIALOGOPTIONS flags = {};
@@ -303,6 +304,7 @@ private:
@@ -327,6 +328,7 @@ private:
return result;
}
@@ -18,13 +18,16 @@ index 065d873e1..fb9cfc999 100644
Array<URL> openDialogPreVista (bool async)
{
@@ -412,8 +414,10 @@ private:
@@ -436,11 +438,13 @@ private:
const Remover remover (*this);
+ #if JUCE_MSVC
if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista)
if (SystemStats::getOperatingSystemType() >= SystemStats::WinVista
&& customComponent == nullptr)
{
return openDialogVistaAndUp (async);
}
+ #endif
return openDialogPreVista (async);


+ 2
- 2
libs/juce-current/patches/23_fix-juce-includes.patch View File

@@ -1,8 +1,8 @@
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 dbf441fb5..63d931efd 100644
index cabbbcf13..f722ab36c 100644
--- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
+++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
@@ -489,7 +489,7 @@ public:
@@ -488,7 +488,7 @@ public:
{
const int numChannels = jmax (numIn, numOut);


+ 2
- 2
libs/juce-current/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp View File

@@ -353,8 +353,8 @@ namespace FloatVectorHelpers
union signMask64 { double d; uint64 i; };
#if JUCE_USE_SSE_INTRINSICS || JUCE_USE_ARM_NEON
template<int typeSize> struct ModeType { using Mode = BasicOps32; };
template<> struct ModeType<8> { using Mode = BasicOps64; };
template <int typeSize> struct ModeType { using Mode = BasicOps32; };
template <> struct ModeType<8> { using Mode = BasicOps64; };
template <typename Mode>
struct MinMax


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

@@ -32,7 +32,7 @@
ID: juce_audio_basics
vendor: juce
version: 6.0.4
version: 6.0.7
name: JUCE audio and MIDI data classes
description: Classes for audio buffer manipulation, midi message handling, synthesis, etc.
website: http://www.juce.com/juce


+ 72
- 4
libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp View File

@@ -60,9 +60,8 @@ namespace MidiBufferHelpers
if (maxBytes == 1)
return 1;
int n;
auto bytesLeft = MidiMessage::readVariableLengthVal (data + 1, n);
return jmin (maxBytes, n + 2 + bytesLeft);
const auto var = MidiMessage::readVariableLengthValue (data + 1, maxBytes - 1);
return jmin (maxBytes, var.value + 2 + var.bytesUsed);
}
if (byte >= 0x80)
@@ -117,7 +116,7 @@ void MidiBuffer::clear (int startSample, int numSamples)
auto start = MidiBufferHelpers::findEventAfter (data.begin(), data.end(), startSample - 1);
auto end = MidiBufferHelpers::findEventAfter (start, data.end(), startSample + numSamples - 1);
data.removeRange ((int) (start - data.begin()), (int) (end - data.begin()));
data.removeRange ((int) (start - data.begin()), (int) (end - start));
}
void MidiBuffer::addEvent (const MidiMessage& m, int sampleNumber)
@@ -237,4 +236,73 @@ bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePositio
return true;
}
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
struct MidiBufferTest : public UnitTest
{
MidiBufferTest()
: UnitTest ("MidiBuffer", UnitTestCategories::midi)
{}
void runTest() override
{
beginTest ("Clear messages");
{
const auto message = MidiMessage::noteOn (1, 64, 0.5f);
const auto testBuffer = [&]
{
MidiBuffer buffer;
buffer.addEvent (message, 0);
buffer.addEvent (message, 10);
buffer.addEvent (message, 20);
buffer.addEvent (message, 30);
return buffer;
}();
{
auto buffer = testBuffer;
buffer.clear (10, 0);
expectEquals (buffer.getNumEvents(), 4);
}
{
auto buffer = testBuffer;
buffer.clear (10, 1);
expectEquals (buffer.getNumEvents(), 3);
}
{
auto buffer = testBuffer;
buffer.clear (10, 10);
expectEquals (buffer.getNumEvents(), 3);
}
{
auto buffer = testBuffer;
buffer.clear (10, 20);
expectEquals (buffer.getNumEvents(), 2);
}
{
auto buffer = testBuffer;
buffer.clear (10, 30);
expectEquals (buffer.getNumEvents(), 1);
}
{
auto buffer = testBuffer;
buffer.clear (10, 300);
expectEquals (buffer.getNumEvents(), 1);
}
}
}
};
static MidiBufferTest midiBufferTest;
#endif
} // namespace juce

+ 432
- 80
libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp View File

@@ -46,23 +46,77 @@ namespace MidiFileHelpers
}
}
static bool parseMidiHeader (const uint8* &data, short& timeFormat, short& fileType, short& numberOfTracks) noexcept
template <typename Value>
struct Optional
{
auto ch = ByteOrder::bigEndianInt (data);
data += 4;
Optional() = default;
if (ch != ByteOrder::bigEndianInt ("MThd"))
Optional (const Value& v)
: value (v), valid (true) {}
Value value = Value();
bool valid = false;
};
template <typename Integral>
struct ReadTrait;
template <>
struct ReadTrait<uint32> { static constexpr auto read = ByteOrder::bigEndianInt; };
template <>
struct ReadTrait<uint16> { static constexpr auto read = ByteOrder::bigEndianShort; };
template <typename Integral>
Optional<Integral> tryRead (const uint8*& data, size_t& remaining)
{
using Trait = ReadTrait<Integral>;
constexpr auto size = sizeof (Integral);
if (remaining < size)
return {};
const Optional<Integral> result { Trait::read (data) };
data += size;
remaining -= size;
return result;
}
struct HeaderDetails
{
size_t bytesRead = 0;
short timeFormat = 0;
short fileType = 0;
short numberOfTracks = 0;
};
static Optional<HeaderDetails> parseMidiHeader (const uint8* const initialData,
const size_t maxSize)
{
auto* data = initialData;
auto remaining = maxSize;
auto ch = tryRead<uint32> (data, remaining);
if (! ch.valid)
return {};
if (ch.value != ByteOrder::bigEndianInt ("MThd"))
{
bool ok = false;
auto ok = false;
if (ch == ByteOrder::bigEndianInt ("RIFF"))
if (ch.value == ByteOrder::bigEndianInt ("RIFF"))
{
for (int i = 0; i < 8; ++i)
{
ch = ByteOrder::bigEndianInt (data);
data += 4;
ch = tryRead<uint32> (data, remaining);
if (! ch.valid)
return {};
if (ch == ByteOrder::bigEndianInt ("MThd"))
if (ch.value == ByteOrder::bigEndianInt ("MThd"))
{
ok = true;
break;
@@ -71,21 +125,37 @@ namespace MidiFileHelpers
}
if (! ok)
return false;
return {};
}
auto bytesRemaining = ByteOrder::bigEndianInt (data);
data += 4;
fileType = (short) ByteOrder::bigEndianShort (data);
data += 2;
numberOfTracks = (short) ByteOrder::bigEndianShort (data);
data += 2;
timeFormat = (short) ByteOrder::bigEndianShort (data);
data += 2;
bytesRemaining -= 6;
data += bytesRemaining;
return true;
const auto bytesRemaining = tryRead<uint32> (data, remaining);
if (! bytesRemaining.valid || bytesRemaining.value > remaining)
return {};
const auto optFileType = tryRead<uint16> (data, remaining);
if (! optFileType.valid || 2 < optFileType.value)
return {};
const auto optNumTracks = tryRead<uint16> (data, remaining);
if (! optNumTracks.valid || (optFileType.value == 0 && optNumTracks.value != 1))
return {};
const auto optTimeFormat = tryRead<uint16> (data, remaining);
if (! optTimeFormat.valid)
return {};
HeaderDetails result;
result.fileType = (short) optFileType.value;
result.timeFormat = (short) optTimeFormat.value;
result.numberOfTracks = (short) optNumTracks.value;
result.bytesRead = maxSize - remaining;
return { result };
}
static double convertTicksToSeconds (double time,
@@ -149,6 +219,47 @@ namespace MidiFileHelpers
}
}
}
static MidiMessageSequence readTrack (const uint8* data, int size)
{
double time = 0;
uint8 lastStatusByte = 0;
MidiMessageSequence result;
while (size > 0)
{
const auto delay = MidiMessage::readVariableLengthValue (data, (int) size);
if (! delay.isValid())
break;
data += delay.bytesUsed;
size -= delay.bytesUsed;
time += delay.value;
if (size <= 0)
break;
int messSize = 0;
const MidiMessage mm (data, size, messSize, lastStatusByte, time);
if (messSize <= 0)
break;
size -= messSize;
data += messSize;
result.addEvent (mm);
auto firstByte = *(mm.getRawData());
if ((firstByte & 0xf0) != 0xf0)
lastStatusByte = firstByte;
}
return result;
}
}
//==============================================================================
@@ -253,78 +364,56 @@ bool MidiFile::readFrom (InputStream& sourceStream, bool createMatchingNoteOffs)
const int maxSensibleMidiFileSize = 200 * 1024 * 1024;
// (put a sanity-check on the file size, as midi files are generally small)
if (sourceStream.readIntoMemoryBlock (data, maxSensibleMidiFileSize))
{
auto size = data.getSize();
auto d = static_cast<const uint8*> (data.getData());
short fileType, expectedTracks;
if (size > 16 && MidiFileHelpers::parseMidiHeader (d, timeFormat, fileType, expectedTracks))
{
size -= (size_t) (d - static_cast<const uint8*> (data.getData()));
int track = 0;
for (;;)
{
auto chunkType = (int) ByteOrder::bigEndianInt (d);
d += 4;
auto chunkSize = (int) ByteOrder::bigEndianInt (d);
d += 4;
if (! sourceStream.readIntoMemoryBlock (data, maxSensibleMidiFileSize))
return false;
if (chunkSize <= 0 || (size_t) chunkSize > size)
break;
auto size = data.getSize();
auto d = static_cast<const uint8*> (data.getData());
if (chunkType == (int) ByteOrder::bigEndianInt ("MTrk"))
readNextTrack (d, chunkSize, createMatchingNoteOffs);
const auto optHeader = MidiFileHelpers::parseMidiHeader (d, size);
if (++track >= expectedTracks)
break;
if (! optHeader.valid)
return false;
size -= (size_t) chunkSize + 8;
d += chunkSize;
}
const auto header = optHeader.value;
timeFormat = header.timeFormat;
return true;
}
}
d += header.bytesRead;
size -= (size_t) header.bytesRead;
return false;
}
for (int track = 0; track < header.numberOfTracks; ++track)
{
const auto optChunkType = MidiFileHelpers::tryRead<uint32> (d, size);
void MidiFile::readNextTrack (const uint8* data, int size, bool createMatchingNoteOffs)
{
double time = 0;
uint8 lastStatusByte = 0;
if (! optChunkType.valid)
return false;
MidiMessageSequence result;
const auto optChunkSize = MidiFileHelpers::tryRead<uint32> (d, size);
while (size > 0)
{
int bytesUsed;
auto delay = MidiMessage::readVariableLengthVal (data, bytesUsed);
data += bytesUsed;
size -= bytesUsed;
time += delay;
if (! optChunkSize.valid)
return false;
int messSize = 0;
const MidiMessage mm (data, size, messSize, lastStatusByte, time);
const auto chunkSize = optChunkSize.value;
if (messSize <= 0)
break;
if (size < chunkSize)
return false;
size -= messSize;
data += messSize;
if (optChunkType.value == ByteOrder::bigEndianInt ("MTrk"))
readNextTrack (d, (int) chunkSize, createMatchingNoteOffs);
result.addEvent (mm);
size -= chunkSize;
d += chunkSize;
}
auto firstByte = *(mm.getRawData());
return size == 0;
}
if ((firstByte & 0xf0) != 0xf0)
lastStatusByte = firstByte;
}
void MidiFile::readNextTrack (const uint8* data, int size, bool createMatchingNoteOffs)
{
auto sequence = MidiFileHelpers::readTrack (data, size);
// sort so that we put all the note-offs before note-ons that have the same time
std::stable_sort (result.list.begin(), result.list.end(),
std::stable_sort (sequence.list.begin(), sequence.list.end(),
[] (const MidiMessageSequence::MidiEventHolder* a,
const MidiMessageSequence::MidiEventHolder* b)
{
@@ -337,10 +426,10 @@ void MidiFile::readNextTrack (const uint8* data, int size, bool createMatchingNo
return a->message.isNoteOff() && b->message.isNoteOn();
});
addTrack (result);
if (createMatchingNoteOffs)
tracks.getLast()->updateMatchedPairs();
sequence.updateMatchedPairs();
addTrack (sequence);
}
//==============================================================================
@@ -443,4 +532,267 @@ bool MidiFile::writeTrack (OutputStream& mainOut, const MidiMessageSequence& ms)
return true;
}
//==============================================================================
//==============================================================================
#if JUCE_UNIT_TESTS
struct MidiFileTest : public UnitTest
{
MidiFileTest()
: UnitTest ("MidiFile", UnitTestCategories::midi)
{}
void runTest() override
{
beginTest ("ReadTrack respects running status");
{
const auto sequence = parseSequence ([] (OutputStream& os)
{
MidiFileHelpers::writeVariableLengthInt (os, 100);
writeBytes (os, { 0x90, 0x40, 0x40 });
MidiFileHelpers::writeVariableLengthInt (os, 200);
writeBytes (os, { 0x40, 0x40 });
MidiFileHelpers::writeVariableLengthInt (os, 300);
writeBytes (os, { 0xff, 0x2f, 0x00 });
});
expectEquals (sequence.getNumEvents(), 3);
expect (sequence.getEventPointer (0)->message.isNoteOn());
expect (sequence.getEventPointer (1)->message.isNoteOn());
expect (sequence.getEventPointer (2)->message.isEndOfTrackMetaEvent());
}
beginTest ("ReadTrack returns available messages if input is truncated");
{
{
const auto sequence = parseSequence ([] (OutputStream& os)
{
// Incomplete delta time
writeBytes (os, { 0xff });
});
expectEquals (sequence.getNumEvents(), 0);
}
{
const auto sequence = parseSequence ([] (OutputStream& os)
{
// Complete delta with no following event
MidiFileHelpers::writeVariableLengthInt (os, 0xffff);
});
expectEquals (sequence.getNumEvents(), 0);
}
{
const auto sequence = parseSequence ([] (OutputStream& os)
{
// Complete delta with malformed following event
MidiFileHelpers::writeVariableLengthInt (os, 0xffff);
writeBytes (os, { 0x90, 0x40 });
});
expectEquals (sequence.getNumEvents(), 1);
expect (sequence.getEventPointer (0)->message.isNoteOff());
expectEquals (sequence.getEventPointer (0)->message.getNoteNumber(), 0x40);
expectEquals (sequence.getEventPointer (0)->message.getVelocity(), (uint8) 0x00);
}
}
beginTest ("Header parsing works");
{
{
// No data
const auto header = parseHeader ([] (OutputStream&) {});
expect (! header.valid);
}
{
// Invalid initial byte
const auto header = parseHeader ([] (OutputStream& os)
{
writeBytes (os, { 0xff });
});
expect (! header.valid);
}
{
// Type block, but no header data
const auto header = parseHeader ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd' });
});
expect (! header.valid);
}
{
// We (ll-formed header, but track type is 0 and channels != 1
const auto header = parseHeader ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 0, 0, 16, 0, 1 });
});
expect (! header.valid);
}
{
// Well-formed header, but track type is 5
const auto header = parseHeader ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 5, 0, 16, 0, 1 });
});
expect (! header.valid);
}
{
// Well-formed header
const auto header = parseHeader ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 16, 0, 1 });
});
expect (header.valid);
expectEquals (header.value.fileType, (short) 1);
expectEquals (header.value.numberOfTracks, (short) 16);
expectEquals (header.value.timeFormat, (short) 1);
expectEquals ((int) header.value.bytesRead, 14);
}
}
beginTest ("Read from stream");
{
{
// Empty input
const auto file = parseFile ([] (OutputStream&) {});
expect (! file.valid);
}
{
// Malformed header
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd' });
});
expect (! file.valid);
}
{
// Header, no channels
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 0, 0, 1 });
});
expect (file.valid);
expectEquals (file.value.getNumTracks(), 0);
}
{
// Header, one malformed channel
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 1 });
writeBytes (os, { 'M', 'T', 'r', '?' });
});
expect (! file.valid);
}
{
// Header, one channel with malformed message
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 1 });
writeBytes (os, { 'M', 'T', 'r', 'k', 0, 0, 0, 1, 0xff });
});
expect (file.valid);
expectEquals (file.value.getNumTracks(), 1);
expectEquals (file.value.getTrack (0)->getNumEvents(), 0);
}
{
// Header, one channel with incorrect length message
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 1 });
writeBytes (os, { 'M', 'T', 'r', 'k', 0x0f, 0, 0, 0, 0xff });
});
expect (! file.valid);
}
{
// Header, one channel, all well-formed
const auto file = parseFile ([] (OutputStream& os)
{
writeBytes (os, { 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 1 });
writeBytes (os, { 'M', 'T', 'r', 'k', 0, 0, 0, 4 });
MidiFileHelpers::writeVariableLengthInt (os, 0x0f);
writeBytes (os, { 0x80, 0x00, 0x00 });
});
expect (file.valid);
expectEquals (file.value.getNumTracks(), 1);
auto& track = *file.value.getTrack (0);
expectEquals (track.getNumEvents(), 1);
expect (track.getEventPointer (0)->message.isNoteOff());
expectEquals (track.getEventPointer (0)->message.getTimeStamp(), (double) 0x0f);
}
}
}
template <typename Fn>
static MidiMessageSequence parseSequence (Fn&& fn)
{
MemoryOutputStream os;
fn (os);
return MidiFileHelpers::readTrack (reinterpret_cast<const uint8*> (os.getData()),
(int) os.getDataSize());
}
template <typename Fn>
static MidiFileHelpers::Optional<MidiFileHelpers::HeaderDetails> parseHeader (Fn&& fn)
{
MemoryOutputStream os;
fn (os);
return MidiFileHelpers::parseMidiHeader (reinterpret_cast<const uint8*> (os.getData()),
os.getDataSize());
}
template <typename Fn>
static MidiFileHelpers::Optional<MidiFile> parseFile (Fn&& fn)
{
MemoryOutputStream os;
fn (os);
MemoryInputStream is (os.getData(), os.getDataSize(), false);
MidiFile mf;
if (mf.readFrom (is))
return mf;
return {};
}
static void writeBytes (OutputStream& os, const std::vector<uint8>& bytes)
{
for (const auto& byte : bytes)
os.writeByte ((char) byte);
}
};
static MidiFileTest midiFileTests;
#endif
} // namespace juce

+ 200
- 16
libs/juce-current/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp View File

@@ -57,6 +57,31 @@ uint16 MidiMessage::pitchbendToPitchwheelPos (const float pitchbend,
}
//==============================================================================
MidiMessage::VariableLengthValue MidiMessage::readVariableLengthValue (const uint8* data, int maxBytesToUse) noexcept
{
uint32 v = 0;
// The largest allowable variable-length value is 0x0f'ff'ff'ff which is
// represented by the 4-byte stream 0xff 0xff 0xff 0x7f.
// Longer bytestreams risk overflowing a 32-bit signed int.
const auto limit = jmin (maxBytesToUse, 4);
for (int numBytesUsed = 0; numBytesUsed < limit; ++numBytesUsed)
{
const auto i = data[numBytesUsed];
v = (v << 7) + (i & 0x7f);
if (! (i & 0x80))
return { (int) v, numBytesUsed + 1 };
}
// If this is hit, the input was malformed. Either there were not enough
// bytes of input to construct a full value, or no terminating byte was
// found. This implementation only supports variable-length values of up
// to four bytes.
return {};
}
int MidiMessage::readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept
{
numBytesUsed = 0;
@@ -224,16 +249,8 @@ MidiMessage::MidiMessage (const void* srcData, int sz, int& numBytesUsed, const
}
else if (byte == 0xff)
{
if (sz == 1)
{
size = 1;
}
else