From 315db2df931c02a5a691f5837a9b5611f21f803e Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 22 Feb 2019 09:00:43 +0000 Subject: [PATCH 01/20] Documentation fixes --- .../format/juce_AudioFormatReader.cpp | 16 ++++---- .../format/juce_AudioFormatReader.h | 40 +++++++++---------- modules/juce_core/text/juce_String.h | 1 + modules/juce_dsp/frequency/juce_Windowing.h | 1 - modules/juce_dsp/maths/juce_LogRampedValue.h | 3 -- .../juce_dsp/processors/juce_Oversampling.h | 2 - 6 files changed, 29 insertions(+), 34 deletions(-) diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp index e05f21e65e..c68c6d8463 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp @@ -58,7 +58,7 @@ bool AudioFormatReader::read (float* const* destChannels, int numDestChannels, return true; } -bool AudioFormatReader::read (int* const* destSamples, +bool AudioFormatReader::read (int* const* destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, @@ -74,7 +74,7 @@ bool AudioFormatReader::read (int* const* destSamples, auto silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead); for (int i = numDestChannels; --i >= 0;) - if (auto d = destSamples[i]) + if (auto d = destChannels[i]) zeromem (d, sizeof (int) * (size_t) silence); startOffsetInDestBuffer += silence; @@ -85,7 +85,7 @@ bool AudioFormatReader::read (int* const* destSamples, if (numSamplesToRead <= 0) return true; - if (! readSamples (const_cast (destSamples), + if (! readSamples (const_cast (destChannels), jmin ((int) numChannels, numDestChannels), startOffsetInDestBuffer, startSampleInSource, numSamplesToRead)) return false; @@ -94,26 +94,26 @@ bool AudioFormatReader::read (int* const* destSamples, { if (fillLeftoverChannelsWithCopies) { - auto lastFullChannel = destSamples[0]; + auto lastFullChannel = destChannels[0]; for (int i = (int) numChannels; --i > 0;) { - if (destSamples[i] != nullptr) + if (destChannels[i] != nullptr) { - lastFullChannel = destSamples[i]; + lastFullChannel = destChannels[i]; break; } } if (lastFullChannel != nullptr) for (int i = (int) numChannels; i < numDestChannels; ++i) - if (auto d = destSamples[i]) + if (auto d = destChannels[i]) memcpy (d, lastFullChannel, sizeof (int) * originalNumSamplesToRead); } else { for (int i = (int) numChannels; i < numDestChannels; ++i) - if (auto d = destSamples[i]) + if (auto d = destChannels[i]) zeromem (d, sizeof (int) * originalNumSamplesToRead); } } diff --git a/modules/juce_audio_formats/format/juce_AudioFormatReader.h b/modules/juce_audio_formats/format/juce_AudioFormatReader.h index da14d670a4..4a472a1884 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatReader.h +++ b/modules/juce_audio_formats/format/juce_AudioFormatReader.h @@ -71,7 +71,7 @@ public: //============================================================================== /** Reads samples from the stream. - @param destSamples an array of float buffers into which the sample data for each + @param destChannels an array of float buffers into which the sample data for each channel will be written. Channels that aren't needed can be null @param numDestChannels the number of array elements in the destChannels array @param startSampleInSource the position in the audio file or stream at which the samples @@ -92,7 +92,7 @@ public: /** Reads samples from the stream. - @param destSamples an array of buffers into which the sample data for each + @param destChannels an array of buffers into which the sample data for each channel will be written. If the format is fixed-point, each channel will be written as an array of 32-bit signed integers using the full @@ -100,8 +100,8 @@ public: bit-depth. If it is a floating-point format, you should cast the resulting array to a (float**) to get the values (in the range -1.0 to 1.0 or beyond) - If the format is stereo, then destSamples[0] is the left channel - data, and destSamples[1] is the right channel. + If the format is stereo, then destChannels[0] is the left channel + data, and destChannels[1] is the right channel. The numDestChannels parameter indicates how many pointers this array contains, but some of these pointers can be null if you don't want to read data for some of the channels @@ -128,7 +128,7 @@ public: error - the reader should just return zeros for these regions @see readMaxLevels */ - bool read (int* const* destSamples, + bool read (int* const* destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, @@ -253,18 +253,18 @@ public: Callers should use read() instead of calling this directly. - @param destSamples the array of destination buffers to fill. Some of these - pointers may be null - @param numDestChannels the number of items in the destSamples array. This - value is guaranteed not to be greater than the number of - channels that this reader object contains - @param startOffsetInDestBuffer the number of samples from the start of the - dest data at which to begin writing - @param startSampleInFile the number of samples into the source data at which - to begin reading. This value is guaranteed to be >= 0. - @param numSamples the number of samples to read + @param destChannels the array of destination buffers to fill. Some of these + pointers may be null + @param numDestChannels the number of items in the destChannels array. This + value is guaranteed not to be greater than the number of + channels that this reader object contains + @param startOffsetInDestBuffer the number of samples from the start of the + dest data at which to begin writing + @param startSampleInFile the number of samples into the source data at which + to begin reading. This value is guaranteed to be >= 0. + @param numSamples the number of samples to read */ - virtual bool readSamples (int** destSamples, + virtual bool readSamples (int** destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, @@ -303,18 +303,18 @@ protected: /** Used by AudioFormatReader subclasses to clear any parts of the data blocks that lie beyond the end of their available length. */ - static void clearSamplesBeyondAvailableLength (int** destSamples, int numDestChannels, + static void clearSamplesBeyondAvailableLength (int** destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int& numSamples, int64 fileLengthInSamples) { - jassert (destSamples != nullptr); + jassert (destChannels != nullptr); const int64 samplesAvailable = fileLengthInSamples - startSampleInFile; if (samplesAvailable < numSamples) { for (int i = numDestChannels; --i >= 0;) - if (destSamples[i] != nullptr) - zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); + if (destChannels[i] != nullptr) + zeromem (destChannels[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); numSamples = (int) samplesAvailable; } diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index 6d74e159d0..b1acf00486 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -978,6 +978,7 @@ public: decimal places, adding trailing zeros as required, and will not use exponent notation. If 0 or less, it will use exponent notation if necessary. + @param useScientificNotation if the number should be formatted using scientific notation @see getFloatValue, getIntValue */ String (double doubleValue, int numberOfDecimalPlaces, bool useScientificNotation = false); diff --git a/modules/juce_dsp/frequency/juce_Windowing.h b/modules/juce_dsp/frequency/juce_Windowing.h index 907e65a334..1c6be2d17c 100644 --- a/modules/juce_dsp/frequency/juce_Windowing.h +++ b/modules/juce_dsp/frequency/juce_Windowing.h @@ -85,7 +85,6 @@ public: @param samples the destination buffer pointer @param size the size of the destination buffer allocated in the object - @param type the type of windowing method being used @param normalise if the result must be normalised, creating a DC amplitude response of one @param beta an optional argument useful only for Kaiser's method, diff --git a/modules/juce_dsp/maths/juce_LogRampedValue.h b/modules/juce_dsp/maths/juce_LogRampedValue.h index 7af99bc5da..e32aca3916 100644 --- a/modules/juce_dsp/maths/juce_LogRampedValue.h +++ b/modules/juce_dsp/maths/juce_LogRampedValue.h @@ -92,8 +92,6 @@ public: /** Set a new ramp length directly in samples. @param numSteps The number of samples over which the ramp should be active - @param increasingRateOfChange If the log behaviour makes the ramp increase - slowly at the beginning, rather than at the end */ void reset (int numSteps) noexcept { @@ -108,7 +106,6 @@ public: /** Set a new target value. @param newValue The new target value - @param force If true, the value will be set immediately, bypassing the ramp */ void setTargetValue (FloatType newValue) noexcept { diff --git a/modules/juce_dsp/processors/juce_Oversampling.h b/modules/juce_dsp/processors/juce_Oversampling.h index 8dedeac47f..7c428180df 100644 --- a/modules/juce_dsp/processors/juce_Oversampling.h +++ b/modules/juce_dsp/processors/juce_Oversampling.h @@ -146,8 +146,6 @@ public: content created by the oversampled process, so usually the attenuation is increased when upsampling compared to downsampling. - @param type the type of filter design employed for filtering - during oversampling @param normalisedTransitionWidthUp a value between 0 and 0.5 which specifies how much the transition between passband and stopband is steep, for upsampling filtering (the lower the better) From ac5261896686661be822a0a3aea677f6a4373ce3 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 22 Feb 2019 10:08:55 +0000 Subject: [PATCH 02/20] Ensure that the standalone plug-in saves its state when the OS sends a quit request --- .../Standalone/juce_StandaloneFilterApp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp index c3297249b2..8b4376f46e 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterApp.cpp @@ -117,6 +117,9 @@ public: //============================================================================== void systemRequestedQuit() override { + if (mainWindow.get() != nullptr) + mainWindow->pluginHolder->savePluginState(); + if (ModalComponentManager::getInstance()->cancelAllModalComponents()) { Timer::callAfterDelay (100, []() From 91ed59d117ead48623fad7d7379bf642b7b5aa44 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 22 Feb 2019 10:51:08 +0000 Subject: [PATCH 03/20] Projucer: Fixed a bug exporting CLion projects --- .../Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h index 88d6ec4a79..70b91db7a8 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h @@ -1157,7 +1157,7 @@ private: else if (configSettings[key] == "YES_AGGRESSIVE") compilerFlags.add ("--Wconditional-uninitialized"); else compilerFlags.add (")-Wno-uninitialized"); } - else if (key == "WARNING_CFLAGS") compilerFlags.add (configSettings[key]); + else if (key == "WARNING_CFLAGS") compilerFlags.add (configSettings[key].unquoted()); } out << addToCMakeVariable ("CMAKE_CXX_FLAGS", compilerFlags.joinIntoString (" ")) << newLine From 22fc71585c91e9eb6da0eeb802a98b892ce9cacb Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 26 Feb 2019 10:58:57 +0000 Subject: [PATCH 04/20] VST3: Added a missing case statement from getChannelType() --- modules/juce_audio_processors/format_types/juce_VST3Common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index 17b9c0cdfc..7e4887293d 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -237,7 +237,8 @@ static inline AudioChannelSet::ChannelType getChannelType (Steinberg::Vst::Speak case Steinberg::Vst::kSpeakerTrc: return AudioChannelSet::topRearCentre; case Steinberg::Vst::kSpeakerTrr: return AudioChannelSet::topRearRight; case Steinberg::Vst::kSpeakerLfe2: return AudioChannelSet::LFE2; - case Steinberg::Vst::kSpeakerACN0: return ((arr & Steinberg::Vst::kSpeakerC) != 0 ? AudioChannelSet::discreteChannel0 : AudioChannelSet::centre); /* kSpeakerACN0 */ + case Steinberg::Vst::kSpeakerM: return ((arr & Steinberg::Vst::kSpeakerC) != 0 ? AudioChannelSet::discreteChannel0 : AudioChannelSet::centre); + case Steinberg::Vst::kSpeakerACN0: return AudioChannelSet::ambisonicACN0; case Steinberg::Vst::kSpeakerACN1: return AudioChannelSet::ambisonicACN1; case Steinberg::Vst::kSpeakerACN2: return AudioChannelSet::ambisonicACN2; case Steinberg::Vst::kSpeakerACN3: return AudioChannelSet::ambisonicACN3; From ccbcc41b7afc9c140cda335c813cf8e2b17e47ea Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 28 Feb 2019 16:05:42 +0000 Subject: [PATCH 05/20] Android: Fixed a crash when pressing the back button --- .../app/com/roli/juce/ComponentPeerView.java | 2 +- .../native/juce_android_Windowing.cpp | 321 +++++++++--------- 2 files changed, 157 insertions(+), 166 deletions(-) diff --git a/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java b/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java index d5f49315a3..9a43aa5ecd 100644 --- a/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java +++ b/modules/juce_gui_basics/native/java/app/com/roli/juce/ComponentPeerView.java @@ -240,7 +240,7 @@ public final class ComponentPeerView extends ViewGroup return super.onKeyDown (keyCode, event); case KeyEvent.KEYCODE_BACK: { - ((Activity) getContext ()).onBackPressed (); + backButtonPressed(); return true; } diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index a6d6b67621..6803b9a356 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -29,170 +29,161 @@ namespace juce // This byte-code is generated from native/java/com/roli/juce/ComponentPeerView.java with min sdk version 16 // See juce_core/native/java/README.txt on how to generate this byte-code. static const uint8 javaComponentPeerView[] = -{31,139,8,8,248,105,229,91,0,3,67,111,109,112,111,110,101,110,116,80,101,101,114,86,105,101,119,46,100,101,120,0,165,154, -11,124,92,85,157,199,255,231,220,59,51,201,100,50,153,76,210,164,73,38,233,228,217,105,155,38,83,160,208,146,180,244,13, -105,147,182,52,105,160,73,129,222,76,110,146,105,39,247,78,103,38,143,10,46,225,177,148,69,228,225,118,1,5,93,68,100,171, -162,219,34,178,5,92,101,149,197,174,162,91,124,176,85,235,10,10,31,145,45,136,221,186,174,136,178,191,115,238,153,100, -250,2,117,39,159,239,252,255,231,127,254,247,188,207,255,156,153,204,160,57,233,141,158,191,152,158,156,245,224,205,149, -149,85,69,59,14,196,31,217,241,202,99,15,124,242,195,239,188,245,102,211,239,146,201,249,68,73,34,154,236,189,32,72,234, -245,232,60,162,227,228,216,23,129,176,78,116,17,228,43,144,165,194,215,67,52,4,57,59,143,72,131,188,172,128,232,112,13, -209,126,200,19,229,68,39,193,59,160,116,54,81,57,168,2,53,160,14,52,130,121,96,21,88,11,58,64,23,216,2,118,130,7,193,211, -224,69,240,107,80,92,129,54,128,237,96,28,220,9,30,6,79,129,239,129,95,129,202,74,162,86,208,1,110,0,15,129,239,130,223, -129,198,42,162,30,240,0,248,15,240,54,168,9,17,45,7,6,184,22,220,1,30,3,71,193,27,32,80,77,212,0,86,131,43,192,45,224,33, -176,31,60,1,158,4,255,12,158,5,135,193,17,240,34,56,6,94,6,175,130,215,193,175,192,73,240,54,248,35,112,99,140,242,129, -31,148,130,10,80,13,234,64,19,152,15,150,131,110,112,13,216,5,38,192,77,224,78,240,0,120,24,28,4,79,131,23,193,15,193, -113,112,18,188,3,244,57,68,133,160,20,212,130,22,176,28,116,129,94,112,21,136,129,33,48,10,174,5,183,128,143,131,71,193, -19,224,107,224,8,248,49,120,11,252,30,248,194,24,103,80,15,154,193,82,176,1,244,131,36,184,30,220,9,62,15,190,8,158,4,95, -6,223,6,63,5,191,6,84,139,182,129,122,112,1,88,11,122,128,1,118,129,155,193,29,96,31,184,23,124,10,236,7,79,130,195,224, -135,224,21,112,2,188,13,220,117,152,43,80,5,26,192,50,208,9,186,193,0,24,1,73,48,9,174,5,55,128,219,192,93,224,30,240,25, -240,21,112,4,252,28,80,61,81,9,104,2,139,193,70,208,11,76,48,6,166,192,157,224,62,240,16,56,8,190,10,190,1,142,128,31, -129,151,193,27,224,36,248,45,168,106,192,88,129,21,96,45,216,10,98,224,58,112,59,248,24,120,28,124,11,188,6,126,3,244,70, -244,11,132,65,11,88,6,186,192,118,48,14,174,3,55,131,219,193,71,192,189,224,227,224,31,192,103,193,65,240,20,120,6,188,0, -142,129,55,193,219,224,15,128,154,80,7,200,107,114,246,175,11,96,75,147,31,20,129,0,40,6,34,32,148,144,179,231,103,129, -50,80,46,246,61,192,182,35,108,47,194,118,34,108,25,194,242,38,44,63,154,35,226,133,51,213,164,134,148,208,37,82,213,210, -92,16,1,8,49,132,208,67,11,64,51,88,8,90,64,43,136,170,184,115,30,56,31,92,0,22,131,37,224,82,208,5,54,130,77,96,51,57, -125,200,190,116,37,31,44,115,250,197,84,218,173,116,97,23,125,229,202,158,167,244,253,176,123,149,159,120,249,84,222,1, -101,247,43,187,87,141,75,86,159,149,227,47,198,229,80,153,163,139,49,121,70,61,91,171,124,10,212,88,136,54,20,170,241,56, -172,252,133,126,68,249,71,148,127,161,26,163,163,101,78,223,23,40,251,82,165,139,114,46,86,250,75,208,219,148,126,28,122, -187,210,79,66,95,166,116,29,147,183,92,233,1,232,151,40,61,4,125,133,210,27,160,175,202,206,75,142,253,130,28,189,29,250, -26,165,175,201,177,111,206,209,175,204,209,119,228,148,57,146,99,79,66,95,173,244,201,28,251,93,101,51,186,24,195,149,74, -159,202,41,231,214,28,127,49,110,107,179,207,194,190,78,233,247,229,248,236,207,209,15,148,59,235,168,89,141,231,101,74, -63,4,123,135,210,159,129,190,94,233,207,67,239,84,250,247,161,111,80,250,177,28,251,43,57,246,227,229,98,78,25,93,69,142, -60,70,98,223,132,233,74,37,239,148,146,209,71,148,220,167,228,223,41,121,143,146,247,42,255,7,73,236,181,102,250,123,41, -171,232,71,36,246,93,136,126,168,228,207,164,172,164,87,197,92,98,53,223,37,101,21,125,66,202,102,250,178,148,5,244,85, -185,254,106,233,66,18,123,166,132,14,146,216,35,213,244,117,18,235,222,77,163,82,6,232,3,144,249,200,103,82,46,164,231, -72,172,203,90,153,46,80,246,2,236,162,111,200,254,57,233,34,212,155,144,178,152,44,149,190,86,172,51,101,15,96,103,238, -86,233,49,41,53,26,39,39,214,76,40,57,41,37,163,41,37,111,32,177,215,56,165,164,172,163,235,73,196,163,26,89,95,9,162, -195,19,82,46,162,127,146,114,22,61,69,98,63,54,81,159,146,207,146,136,89,141,210,191,2,145,228,14,41,235,233,155,82,46, -166,239,203,241,156,43,243,43,81,194,151,228,56,206,147,233,42,216,47,87,114,139,148,62,234,150,178,132,126,160,228,139, -114,92,231,72,255,16,70,178,71,202,8,109,149,178,132,182,43,105,72,25,37,83,202,74,218,37,165,91,222,175,66,170,127,33, -68,191,180,148,249,180,71,74,47,93,167,242,63,40,101,30,253,149,148,206,56,132,208,179,155,148,188,89,201,191,150,114,54, -221,162,228,94,101,191,85,202,114,250,27,37,111,83,242,67,82,86,208,237,82,182,210,253,74,62,32,101,136,62,171,214,209, -231,148,124,84,201,207,171,252,47,168,244,63,42,121,64,173,179,199,164,12,211,23,165,108,164,199,165,116,230,43,164,230, -75,164,15,169,245,249,164,148,206,252,133,16,237,159,150,114,1,29,86,242,223,164,108,160,231,165,44,165,239,72,57,159, -254,93,165,143,40,191,23,148,252,174,202,255,158,234,255,207,73,196,224,32,101,164,188,144,62,38,247,129,159,94,38,17, -119,157,245,219,132,104,107,147,136,189,26,13,72,201,233,83,36,226,111,17,125,148,156,179,142,200,137,211,34,62,137,51, -99,7,228,87,84,176,174,82,107,184,73,249,137,252,36,242,95,80,249,226,60,40,38,231,60,189,79,61,63,5,249,187,200,140,255, -109,208,239,142,56,231,217,253,144,15,129,71,35,206,185,245,37,105,231,206,222,107,18,251,18,119,175,96,1,37,3,6,108,65, -218,30,240,202,51,42,15,41,241,124,41,124,250,69,125,238,82,170,227,62,248,229,227,233,158,116,1,245,156,239,35,43,112, -62,188,124,44,72,75,89,251,140,53,124,17,118,199,140,207,34,248,120,181,45,56,178,182,52,50,58,216,115,55,105,250,226,29, -149,180,53,237,165,37,90,25,5,181,237,208,178,254,61,153,2,218,29,104,194,62,247,233,187,3,243,33,11,244,221,209,5,180, -218,37,252,151,106,30,186,104,135,139,130,37,226,25,63,234,42,195,92,88,129,89,104,239,233,117,68,190,35,206,113,77,142, -201,210,38,231,78,210,31,244,169,190,214,97,46,146,225,90,140,118,127,192,79,253,37,133,178,223,76,254,33,126,55,57,119, -128,100,64,220,52,252,211,246,203,167,237,17,105,231,234,102,176,77,221,129,122,2,133,114,126,52,216,69,189,70,147,115, -46,247,132,11,209,74,113,3,65,15,107,69,187,171,80,179,127,218,111,228,156,126,33,233,231,71,92,16,61,177,225,39,214,127, -208,29,156,149,12,151,211,103,168,78,23,179,231,65,171,250,247,33,186,233,85,148,140,214,211,190,252,254,125,1,10,233,46, -148,112,13,61,76,94,125,137,126,21,205,241,138,52,195,202,237,123,160,8,90,63,197,105,251,253,136,180,225,30,218,134,247, -173,242,189,23,43,181,14,43,35,25,16,61,45,209,75,169,126,229,66,106,98,34,142,89,97,23,218,211,35,106,114,121,49,126, -110,18,37,230,33,102,5,53,43,48,128,167,124,122,165,235,91,20,108,170,31,106,165,160,103,32,175,132,186,242,220,158,96, -121,40,175,64,106,86,244,106,234,113,251,180,37,90,41,5,121,176,161,126,77,148,130,174,221,129,29,232,157,207,221,229, -214,93,193,89,65,41,173,168,73,127,171,99,12,2,28,81,204,167,207,209,157,214,239,163,200,39,11,245,200,73,112,2,188,5, -126,4,142,98,202,229,29,115,230,53,117,9,253,89,233,211,95,78,190,56,191,203,16,143,76,114,206,19,174,213,223,204,234, -110,100,243,166,24,159,123,43,107,188,133,57,243,45,94,63,80,235,160,59,92,36,247,177,88,127,34,125,44,187,110,162,203, -168,86,19,179,233,236,175,87,213,186,236,94,81,68,101,92,222,87,249,82,228,248,165,37,25,189,152,116,22,121,123,166,252, -55,154,156,251,168,184,67,247,161,14,191,170,67,188,254,187,201,217,255,193,64,209,244,186,252,131,106,207,214,64,177, -172,135,171,117,204,231,58,119,68,43,176,88,236,28,220,5,117,249,92,144,34,127,212,84,121,121,115,157,152,225,151,207,57, -55,221,64,142,205,13,155,240,44,159,251,222,125,88,162,250,144,245,15,191,143,255,210,233,62,59,237,152,119,150,118,44, -58,139,109,73,142,77,87,117,93,50,215,185,55,7,153,136,188,253,81,78,142,212,104,219,34,68,145,183,182,69,61,180,45,234, -86,214,124,172,31,220,220,3,219,162,58,242,243,176,11,202,208,158,106,10,179,98,213,95,49,246,27,231,58,49,248,236,237, -239,89,21,164,228,150,149,164,95,30,249,95,241,25,65,147,243,222,123,206,103,206,95,251,238,187,178,223,43,90,73,55,196, -51,249,176,139,122,98,115,157,251,122,176,184,123,0,79,233,226,41,174,203,153,194,248,53,123,196,103,36,145,99,5,124,136, -215,216,141,155,219,168,41,205,2,145,19,118,116,54,141,231,121,41,242,134,21,136,162,221,62,220,46,52,248,137,81,66,190, -184,232,113,167,93,217,207,96,37,106,220,4,94,228,136,250,175,159,235,124,158,10,178,233,250,57,234,199,147,69,108,169, -39,31,229,121,209,86,47,15,214,159,119,158,135,236,21,21,52,126,159,151,69,78,88,129,2,17,7,248,18,254,198,187,89,221,10, -199,208,106,175,108,175,108,167,22,44,142,252,196,25,31,81,215,71,231,58,159,129,78,29,31,167,167,194,38,250,232,70,93, -201,45,237,24,217,96,32,242,27,231,174,41,94,143,228,204,123,62,74,19,229,61,174,198,219,190,178,146,122,198,115,75,93, -130,58,157,117,118,21,214,153,243,89,149,203,207,104,255,138,103,66,40,168,251,5,120,99,241,44,98,76,91,202,208,6,86,196, -172,128,56,31,188,249,86,64,196,226,2,207,15,238,126,151,22,176,255,145,163,19,249,117,247,119,177,115,152,21,14,224,86, -233,213,45,236,53,248,186,172,64,80,72,183,231,133,241,188,229,226,116,45,142,28,123,127,207,21,142,231,55,222,223,243, -18,120,90,1,17,3,188,5,193,226,139,170,230,83,176,182,62,212,130,24,121,30,125,155,130,149,139,159,170,37,81,138,40,227, -11,162,140,112,137,144,44,232,90,227,242,185,110,220,250,220,44,43,92,234,88,202,214,184,125,238,27,135,158,43,203,150, -123,212,139,153,124,9,237,184,169,148,209,187,184,55,220,253,178,151,229,45,245,206,166,63,181,7,243,104,232,221,220,246, -252,37,45,17,37,69,126,252,231,183,96,185,106,65,227,255,187,5,203,101,11,196,182,241,200,181,38,214,150,136,21,173,74, -138,24,35,238,165,105,185,246,184,60,163,47,142,56,223,65,160,141,56,17,61,88,253,149,26,230,163,180,126,13,78,68,215, -128,27,39,162,60,221,174,166,243,116,31,91,138,146,253,184,53,70,254,8,222,9,6,235,235,112,30,106,226,60,204,195,153,215, -165,115,77,156,131,187,121,228,205,66,30,57,14,94,7,175,137,245,94,140,182,137,251,162,216,25,156,207,45,107,156,173,213, -71,234,154,231,205,207,137,137,131,145,153,189,161,41,107,34,226,220,251,150,112,15,246,151,21,222,6,15,63,5,87,68,126, -47,250,231,196,205,177,136,243,157,137,136,31,226,134,87,201,239,131,167,134,88,42,98,73,5,226,210,108,228,13,98,135,122, -217,50,86,130,209,182,162,97,138,162,199,23,74,127,43,58,135,2,122,207,162,0,238,114,13,178,252,108,78,144,91,209,26,10, -112,39,79,124,170,138,156,112,190,243,205,125,61,126,90,250,217,211,210,162,79,165,228,156,119,197,104,5,83,54,231,51, -148,35,243,148,44,87,178,74,249,55,225,51,148,72,71,84,58,130,217,212,41,123,247,83,231,163,154,235,236,57,202,213,92, -103,207,79,71,247,200,239,98,184,164,57,199,46,100,161,76,235,170,110,183,202,115,195,143,43,155,71,201,124,37,125,234, -89,63,90,228,204,175,58,207,213,51,33,53,127,226,51,147,200,111,86,109,108,206,105,183,96,161,146,45,234,121,166,238,26, -66,22,77,219,138,84,93,206,115,129,233,186,152,250,28,131,182,182,199,173,120,102,57,149,173,182,71,147,182,101,90,153, -205,166,153,234,141,155,19,45,59,141,113,220,161,215,17,95,215,65,172,131,120,7,196,122,226,235,59,169,124,131,185,103, -192,54,82,131,107,226,233,209,120,58,221,25,79,103,76,203,76,17,235,36,222,9,215,206,78,210,58,241,86,214,105,88,131,41, -59,62,216,106,36,147,173,43,99,153,248,120,60,179,167,141,46,56,213,158,76,38,226,49,35,19,183,173,134,172,79,103,124, -200,140,237,137,37,204,213,70,34,49,96,196,118,165,219,168,226,92,79,229,102,197,108,11,109,201,180,174,22,114,50,147, -155,53,156,50,146,35,241,88,186,117,181,97,141,27,40,176,230,44,89,118,194,78,173,139,39,50,102,234,220,249,93,70,38,21, -159,108,163,121,239,153,127,74,81,179,207,116,221,108,196,45,180,175,252,204,156,45,102,12,25,37,211,25,118,186,117,213, -152,53,152,48,219,168,52,215,216,177,42,110,13,138,210,103,202,24,199,204,181,98,122,214,142,155,162,240,202,83,51,186, -108,49,92,42,111,222,169,121,98,206,27,54,89,235,236,216,88,122,245,136,97,13,155,217,105,205,109,202,180,107,110,151, -166,141,151,166,236,177,100,27,93,120,102,78,79,202,52,55,13,164,205,212,184,153,66,45,151,38,236,1,35,209,105,236,177, -199,50,51,213,204,121,239,231,218,168,229,84,135,184,149,28,203,140,154,153,17,123,176,117,149,145,54,59,68,26,19,111,97, -252,228,178,104,60,183,255,218,193,120,198,78,117,88,67,118,27,205,63,183,219,25,69,46,124,31,223,46,169,119,25,150,49, -44,90,188,174,51,102,143,182,166,236,68,188,117,231,88,204,108,61,99,155,53,156,99,47,53,156,218,243,165,127,105,57,109, -84,251,126,143,182,81,93,231,160,145,24,143,239,106,53,44,203,206,200,61,213,186,214,138,37,236,116,220,26,94,157,48,210, -114,179,156,233,211,129,113,73,169,252,218,179,228,119,153,163,3,202,193,76,139,21,35,98,74,107,2,139,171,21,75,44,213, -109,238,30,51,173,24,150,117,113,110,142,83,94,93,142,169,35,145,48,135,141,196,202,88,204,76,167,215,78,198,204,164,51, -25,13,103,241,73,13,143,141,162,115,57,94,37,185,94,136,10,195,206,168,204,24,55,218,221,99,177,17,103,230,114,158,11, -230,184,108,26,216,41,55,101,117,142,173,219,140,141,165,16,171,206,241,72,55,130,128,53,44,86,204,140,45,101,14,37,80, -14,154,49,110,59,177,171,199,72,13,155,185,173,173,60,139,187,211,180,54,210,123,182,109,94,75,190,220,165,65,172,151, -120,111,7,185,122,59,240,130,186,158,220,189,235,59,214,173,91,79,58,100,135,120,23,225,184,119,125,31,50,133,210,185,94, -188,73,173,15,185,157,125,8,234,189,125,120,170,79,150,192,250,72,235,19,207,225,173,83,168,136,233,125,66,17,129,189,31, -199,65,127,7,5,251,207,156,175,146,254,179,12,151,215,144,83,214,16,141,70,167,245,69,57,250,121,57,250,249,57,250,5,208, -11,28,125,93,194,24,78,147,219,144,251,79,24,133,236,52,6,204,4,229,25,234,180,160,10,99,112,240,236,81,133,216,0,21,139, -3,100,213,88,38,99,91,155,83,40,210,28,36,247,128,141,228,40,164,12,172,228,142,201,51,129,60,49,25,250,6,201,133,179, -199,72,81,65,204,30,52,55,219,136,212,43,51,34,49,29,221,201,47,19,61,41,195,74,15,217,169,81,42,20,39,15,66,122,90,122, -163,32,231,0,66,65,246,24,210,250,96,124,104,136,152,73,46,83,132,95,242,13,205,4,218,65,202,199,26,88,233,244,112,150, -80,103,206,54,117,142,81,33,204,98,207,160,203,102,42,77,121,34,41,6,158,188,66,83,78,62,177,148,68,241,61,241,81,83,22, -122,153,25,31,30,201,80,9,212,78,181,226,54,89,221,49,44,32,75,230,59,43,139,138,160,202,118,99,183,202,230,250,102,12, -29,131,228,65,106,139,49,113,101,86,217,70,5,66,177,237,140,136,31,20,64,162,123,15,198,123,180,27,107,50,30,51,201,15, -203,86,43,46,6,79,52,90,214,127,122,56,151,93,234,141,167,227,3,241,132,152,67,241,204,21,56,208,236,137,30,123,23,154, -23,154,78,75,167,132,137,200,150,76,24,123,214,165,12,116,78,71,238,149,242,29,87,219,17,42,194,64,98,30,49,112,155,141, -49,49,193,129,105,195,22,51,141,136,48,109,89,53,189,22,168,208,177,32,114,174,177,39,176,182,166,147,91,147,84,58,157, -144,81,245,178,248,224,32,218,164,170,233,178,81,135,124,230,20,67,202,24,206,150,41,13,40,70,149,41,207,122,202,27,49, -210,242,124,165,242,145,248,160,217,109,15,101,228,153,177,46,101,143,58,61,133,11,28,123,196,92,234,35,118,58,67,44,78, -94,204,229,38,25,28,210,164,197,71,71,169,72,92,217,226,70,98,181,145,76,119,97,132,169,80,25,186,205,196,90,107,112,58, -31,201,238,140,145,202,80,190,60,165,122,246,36,77,242,73,245,26,231,196,34,119,28,113,104,151,137,42,210,29,86,58,99,32, -22,83,94,60,189,41,105,32,48,227,177,180,26,121,242,236,50,247,172,22,85,149,239,58,199,213,175,48,155,209,61,34,198,197, -149,144,59,180,16,243,101,166,68,205,27,113,228,144,158,48,135,50,228,78,152,214,112,102,132,220,170,21,204,34,221,18, -115,234,177,204,137,141,114,114,237,196,224,136,124,159,160,98,219,202,94,10,87,167,76,35,131,153,44,153,49,173,49,211, -153,148,189,71,76,239,140,81,45,129,156,39,179,107,160,106,198,212,109,140,155,217,78,99,152,50,102,174,191,28,183,83, -139,232,206,216,201,36,76,133,182,37,150,80,54,144,148,99,139,202,102,157,118,83,32,183,109,97,65,76,8,255,156,59,21,249, -237,83,194,20,229,219,86,118,253,21,74,181,107,44,145,137,39,197,152,203,36,214,80,158,136,119,210,25,30,221,241,15,152, -217,168,225,195,241,97,227,228,146,91,30,21,58,211,230,113,228,53,120,110,12,81,43,131,104,225,74,202,245,231,77,26,41, -120,202,61,235,74,202,48,197,82,84,151,50,135,197,44,166,206,125,247,166,80,202,28,181,199,77,167,229,155,172,211,66,172, -43,37,131,140,150,54,51,228,79,139,112,52,125,243,37,31,210,178,255,134,88,71,229,185,169,14,167,245,114,9,139,199,114, -238,79,242,177,206,236,218,161,217,72,157,245,106,74,179,210,217,208,179,53,158,19,75,170,206,106,22,55,31,3,97,60,237,4, -35,185,212,10,211,167,4,33,111,54,153,112,218,116,69,60,145,216,104,103,228,76,250,210,88,218,217,128,128,7,145,154,222, -194,112,22,75,198,105,23,142,125,100,99,189,204,36,103,167,157,214,116,204,212,165,122,170,103,70,226,56,223,196,123,67, -84,201,69,176,138,8,174,161,12,168,98,8,242,198,50,67,75,100,44,101,227,228,26,55,18,98,166,165,216,52,68,186,184,139,82, -145,120,207,93,31,249,194,208,99,111,77,155,20,24,63,61,250,122,199,103,122,205,38,136,77,18,159,140,130,69,196,246,208, -65,206,200,227,239,107,167,67,248,0,220,220,175,241,175,179,194,189,26,251,23,86,50,71,163,56,111,153,252,237,206,118,86, -92,28,111,231,233,234,118,122,144,115,122,149,121,252,252,226,109,252,210,137,133,244,113,206,94,71,242,12,249,8,10,243, -63,78,159,115,68,141,54,252,21,118,55,243,52,243,23,168,141,191,201,38,248,215,63,56,113,43,227,46,239,202,133,237,45, -237,237,203,251,53,26,244,94,167,49,179,165,253,145,90,77,251,52,91,192,202,103,69,107,52,254,16,227,172,184,220,197,249, -229,213,46,114,49,151,230,246,242,5,15,187,188,110,114,51,55,119,107,243,231,243,241,102,23,159,207,211,205,84,225,84,93, -193,95,103,255,37,148,151,68,199,110,11,17,206,50,255,6,122,66,227,191,100,199,133,125,39,210,244,168,38,222,143,105,188, -239,26,200,23,53,214,7,241,140,20,120,228,23,82,249,80,136,142,40,135,159,57,14,223,116,196,207,57,251,42,243,84,111,216, -176,176,111,67,95,11,25,108,135,124,234,70,141,191,196,238,64,21,31,170,90,72,191,100,252,19,108,151,167,122,47,15,86, -243,100,53,47,106,251,52,207,84,111,255,52,159,172,166,219,185,246,9,54,130,76,94,120,11,31,175,190,167,127,231,94,141, -126,202,120,31,221,200,229,83,254,189,225,208,61,244,123,238,50,62,197,126,194,158,99,87,163,210,19,92,127,141,221,196, -62,203,62,131,26,150,237,237,163,61,210,145,31,166,106,254,212,245,213,27,180,252,43,121,167,230,57,198,48,133,180,141, -175,104,102,37,69,81,135,64,167,86,240,8,227,203,218,53,223,215,88,235,50,198,52,239,71,24,95,200,66,133,151,184,188,46, -223,34,87,193,78,183,183,133,149,148,241,107,219,218,221,190,101,172,122,150,176,159,106,228,235,88,181,159,238,214,216, -47,80,127,88,99,71,49,73,193,50,238,107,230,163,213,88,42,59,35,53,46,18,178,169,222,69,47,71,231,211,135,53,182,95,12, -247,65,141,109,247,248,227,33,250,54,99,255,9,195,179,26,237,99,149,45,59,55,76,238,168,216,75,188,154,189,196,102,87, -241,26,222,171,243,71,88,249,69,142,33,36,13,65,24,242,249,28,24,66,108,118,101,86,169,34,206,152,151,179,187,194,181,83, -83,250,243,229,117,236,173,114,210,220,228,187,43,140,213,194,235,111,152,210,15,85,176,91,195,175,137,183,169,74,188, -221,87,201,248,1,112,180,146,244,162,138,34,206,228,223,60,56,78,85,33,251,193,26,188,29,170,209,111,228,148,15,216,159, -64,8,52,179,35,53,140,77,205,97,236,129,57,165,236,0,228,97,112,28,76,133,25,219,7,158,5,39,193,173,181,240,1,7,192,205, -117,140,29,2,199,5,245,140,29,109,96,250,190,70,166,239,111,100,236,88,163,206,30,158,15,191,5,156,61,11,94,91,160,190, -203,201,126,71,150,149,217,223,97,138,239,120,178,191,197,20,223,9,101,127,143,169,211,204,111,50,197,119,74,217,223,101, -102,191,183,18,191,205,212,2,142,46,190,171,99,97,231,55,72,207,67,119,135,29,187,248,63,54,11,56,223,171,201,255,109, -135,157,122,197,111,57,53,229,47,254,231,172,135,157,114,197,255,169,73,61,43,255,255,29,112,218,42,126,55,250,127,111, -26,247,20,112,42,0,0}; +{31,139,8,8,1,253,119,92,0,3,74,97,118,97,68,101,120,66,121,116,101,67,111,100,101,46,100,101,120,0,165,154,11,124,92,85,157, +199,255,231,220,121,36,147,201,100,50,73,147,54,153,180,147,164,73,167,109,154,76,120,53,37,41,244,25,72,155,210,71,166,149,38, +69,184,153,185,73,166,157,220,59,157,153,36,141,226,82,144,109,171,86,165,110,69,150,151,168,149,15,98,87,237,46,32,91,193,237, +242,80,116,81,1,69,235,10,88,93,92,1,31,31,100,203,218,207,234,210,253,157,115,207,36,183,47,81,55,253,124,231,255,63,255,243, +63,239,115,254,231,76,154,164,177,203,23,187,248,82,170,47,249,108,247,151,235,94,184,235,163,155,215,44,254,82,229,169,135,223, +24,25,51,30,92,117,226,206,101,11,136,50,68,180,107,203,37,33,82,63,55,206,39,250,21,217,246,118,16,118,17,45,134,60,1,89, +9,153,247,18,25,144,149,69,68,26,100,87,9,209,161,217,68,119,67,254,176,154,232,56,56,1,78,129,63,128,211,128,207,36,242,128, +98,80,10,154,193,124,176,8,180,131,203,192,53,224,86,240,105,112,20,188,8,222,6,51,102,17,45,3,253,32,7,246,129,123,193,87,193, +247,193,59,160,162,6,117,1,3,236,1,143,128,151,65,113,45,81,7,216,13,190,6,94,1,60,76,212,0,86,131,235,65,22,220,14,30,3,207, +131,147,160,168,142,104,30,232,4,219,193,30,176,31,220,9,238,1,159,1,15,128,195,224,33,112,20,28,3,79,131,111,129,239,130,239, +131,227,224,21,240,115,240,6,248,13,120,11,156,2,255,11,24,230,205,3,124,32,0,26,192,98,176,18,172,7,3,96,24,228,192,110,176, +15,124,18,124,26,28,5,143,131,231,192,113,112,2,188,6,126,7,78,1,247,28,162,16,104,0,237,224,114,176,28,92,5,214,128,141,224, +122,176,29,220,12,110,3,119,130,251,193,67,224,95,192,15,192,79,193,155,224,29,224,141,16,5,65,29,104,3,87,130,56,72,128,28,56, +0,62,5,238,1,247,129,35,224,73,240,34,120,21,252,14,120,235,137,102,130,249,160,3,172,6,235,193,8,200,130,93,224,253,96,47, +216,15,238,1,135,193,227,224,25,240,67,240,10,120,3,156,4,167,65,81,3,81,61,136,129,197,160,27,244,130,56,216,6,174,7,6,48,65, +30,188,15,124,20,124,22,60,4,190,9,94,5,191,7,190,70,162,70,176,16,92,14,214,128,205,32,9,70,193,4,216,3,14,130,187,193,231, +193,151,193,35,224,9,240,45,240,44,120,19,4,230,98,255,130,26,176,0,116,128,141,64,7,22,248,16,184,15,60,14,190,13,126,12,126, +1,222,6,90,19,214,15,52,128,118,176,22,108,4,91,129,14,134,65,26,100,193,141,224,38,176,7,124,28,124,18,220,15,142,128,39,193, +247,192,11,224,69,240,99,240,114,147,125,118,221,0,199,153,2,160,12,4,65,57,16,193,160,130,236,243,62,3,84,1,28,99,194,113,36, +28,55,194,209,162,90,17,27,0,182,49,97,187,17,182,7,97,121,9,203,65,152,70,194,240,9,195,32,52,69,205,96,30,136,2,132,23,66, +216,161,133,160,5,44,2,173,160,13,196,84,204,185,8,92,12,46,1,151,130,14,112,21,88,7,174,1,235,193,6,178,199,80,248,113,41,121, +107,149,61,46,166,210,30,165,11,187,24,43,87,246,34,165,239,135,221,167,252,196,143,95,229,29,84,246,128,178,251,212,188,20, +244,25,14,127,49,47,119,87,217,186,152,147,67,170,108,189,242,41,81,115,33,250,80,170,230,227,176,242,23,250,67,202,63,170,252, +75,213,28,61,86,101,143,125,161,178,47,81,186,168,231,114,165,63,5,189,83,233,207,65,239,82,250,113,232,75,149,254,26,244,43, +148,126,18,250,149,133,58,177,168,203,148,94,4,125,133,210,131,14,251,76,135,30,129,190,74,233,81,135,253,18,135,222,229,208, +87,57,234,236,117,216,227,208,87,42,125,155,195,158,175,154,214,197,28,46,87,122,210,81,79,218,225,47,230,109,117,161,44,236, +221,74,191,209,225,179,223,161,31,172,182,247,81,139,154,207,171,149,126,55,236,61,74,63,4,125,141,210,191,2,189,87,233,143,66, +95,171,244,99,14,251,51,14,251,115,213,98,77,25,93,71,182,252,137,156,226,8,93,171,228,199,165,100,244,9,37,15,42,249,73,37, +111,87,242,83,202,255,62,18,103,173,133,62,45,101,45,253,152,196,185,11,211,113,37,127,38,101,13,189,74,98,223,113,186,77,202, +90,186,87,202,22,250,154,148,37,244,117,185,255,234,233,50,18,103,163,142,158,32,177,223,61,52,42,101,144,222,7,89,140,19,207, +164,92,68,79,147,216,143,245,50,93,162,236,37,56,61,223,144,227,178,211,101,104,47,45,101,57,153,42,253,126,177,119,148,61,136, +19,185,83,165,199,164,212,104,156,236,24,51,161,228,46,41,25,237,86,242,102,18,103,140,83,86,202,6,186,137,68,28,154,45,219, +171,64,84,120,88,202,118,122,68,202,25,244,207,36,206,97,51,245,43,249,36,137,88,213,36,253,103,33,130,124,76,202,70,250,150, +148,151,210,247,229,60,206,147,249,53,168,225,33,57,127,243,101,186,22,246,141,74,110,146,210,79,125,82,86,208,15,148,124,81, +206,231,28,233,31,198,76,198,165,140,210,102,41,43,104,155,146,186,148,49,249,78,10,163,165,29,82,122,228,155,42,172,198,23,70, +212,203,73,89,76,147,82,250,232,70,149,255,1,41,139,232,111,164,180,231,33,140,145,125,80,201,91,149,252,91,41,103,210,30,37, +247,42,251,62,41,171,233,67,74,126,88,201,143,72,57,139,246,75,217,70,119,41,121,183,148,97,122,80,237,159,47,42,121,88,201,127, +80,249,95,82,233,47,43,249,21,181,191,142,72,25,161,127,148,178,137,254,73,74,123,189,194,106,189,68,250,171,106,95,62,42, +165,189,126,97,68,249,163,82,46,164,111,42,249,140,148,115,233,223,164,172,164,239,72,185,128,190,171,210,223,83,126,207,41,249, +188,202,127,65,141,255,231,36,98,111,136,242,82,94,70,119,202,253,31,160,19,36,226,173,189,127,155,17,101,45,18,49,87,163, +65,41,57,125,142,68,220,45,163,191,39,251,142,35,178,227,179,136,75,226,174,88,5,121,64,5,233,90,181,135,155,149,159,200,143, +35,255,144,202,23,247,64,57,217,247,232,141,170,124,18,242,217,232,180,255,117,208,147,81,251,30,51,33,199,192,77,81,251,190, +218,39,237,92,234,39,154,196,185,196,123,48,84,66,153,224,13,176,133,104,91,208,39,239,166,34,164,68,249,215,225,51,32,218,243, +84,82,3,247,195,175,8,165,227,185,18,138,95,236,39,51,120,17,188,252,44,68,75,88,215,180,53,114,25,78,199,180,79,12,62,62,109, +19,174,170,77,77,140,142,196,15,144,230,186,244,134,26,218,156,243,81,135,86,69,33,109,27,180,130,127,60,95,66,59,131,77,56,231, +126,215,206,224,124,200,18,215,206,216,2,90,233,22,254,75,52,47,45,190,193,77,161,10,81,38,128,182,102,96,45,204,96,37,250, +123,118,27,209,239,138,251,91,147,115,18,104,182,223,34,3,33,191,26,107,3,214,34,19,137,96,182,7,130,1,26,168,40,149,227,102, +242,31,222,30,205,246,221,159,9,138,149,8,76,217,155,167,236,243,164,157,171,23,65,107,179,61,223,241,96,169,92,31,13,118,209, +238,101,205,246,125,28,143,148,162,151,226,245,129,17,214,139,126,215,160,229,192,148,223,210,11,250,213,74,191,0,226,130,24, +201,42,248,137,125,31,242,132,102,100,34,85,244,5,106,112,137,213,243,160,87,3,7,17,221,92,181,148,193,131,245,96,241,192,193, +32,190,101,185,81,195,123,233,16,249,92,29,174,235,104,142,79,164,241,34,167,254,187,203,160,245,83,138,182,221,133,72,27,233, +163,173,248,140,203,207,205,216,169,13,216,25,153,160,24,81,133,171,146,26,151,47,162,102,38,226,152,25,113,161,63,113,209,146, +219,135,249,115,147,168,209,139,152,21,210,204,160,142,82,126,87,141,251,219,20,106,110,28,106,163,144,119,176,168,130,214,21, +121,188,161,234,112,81,137,212,204,216,117,20,247,248,181,14,173,146,66,60,52,183,113,85,140,66,238,157,193,235,49,58,191,103, +157,199,229,14,205,8,73,105,198,146,244,119,46,204,65,16,107,139,122,231,184,236,222,31,164,232,103,74,93,209,147,224,45,240, +38,248,119,112,28,75,46,223,150,211,63,187,175,164,191,40,125,246,143,157,47,238,237,42,196,35,131,236,251,132,107,141,183,178, +134,91,216,252,221,140,207,219,199,154,246,48,123,189,197,207,131,106,31,244,69,202,228,57,22,251,79,164,143,20,246,77,172,139, +234,53,177,154,246,249,58,170,246,101,223,178,50,170,226,242,157,202,151,32,39,32,45,153,216,18,114,177,232,255,76,215,255, +68,179,253,14,21,111,231,126,180,17,80,109,136,159,103,154,237,243,31,10,150,77,237,203,23,84,127,54,7,203,101,59,92,237,227, +31,53,219,111,67,51,120,137,56,57,120,3,186,100,185,16,69,223,209,84,125,47,55,219,49,35,32,203,217,47,220,95,56,108,30,216,132, +231,175,223,101,12,139,213,24,10,254,111,191,139,127,199,212,152,237,126,188,115,158,126,120,230,157,107,43,117,216,92,170,173, +202,121,246,123,57,196,68,228,29,136,113,178,165,70,91,219,17,69,222,220,26,243,210,214,152,71,89,139,177,127,240,98,15,110, +141,185,144,95,132,83,80,133,254,224,14,98,229,106,188,98,238,27,231,217,49,248,252,253,143,175,8,81,102,211,50,114,109,140,158, +18,223,13,52,185,238,11,47,88,230,226,213,167,79,203,113,47,107,37,151,46,202,20,195,46,218,233,152,103,127,119,9,5,251,6, +81,10,213,180,51,238,90,194,176,82,152,191,22,175,248,238,36,114,204,96,9,226,181,143,101,54,94,78,205,185,232,127,89,177,106, +26,47,242,81,244,183,102,112,33,122,29,125,67,76,146,221,143,194,119,45,241,157,163,84,225,67,142,104,111,211,60,251,123,83, +136,77,181,199,209,30,74,150,177,37,222,98,180,83,140,190,249,120,168,241,162,139,188,100,45,155,73,227,119,248,88,244,45,19, +119,6,206,61,239,224,191,57,93,208,205,200,32,218,240,201,254,101,54,160,95,90,168,60,250,178,61,31,162,173,244,60,251,187,206, +153,243,97,143,76,216,196,152,60,104,43,179,169,19,51,25,10,70,223,182,223,150,226,103,210,177,206,197,228,150,245,237,85,243, +107,93,59,139,226,227,206,90,59,208,166,189,175,182,97,95,217,223,73,185,252,46,118,7,202,132,81,81,223,243,240,214,196,236, +50,77,206,46,43,99,102,208,143,250,125,197,102,80,220,11,37,222,23,15,156,166,133,236,191,229,236,68,127,215,247,2,78,10,51,113, +254,102,35,178,154,65,17,161,125,110,19,103,12,210,227,125,126,188,104,169,184,77,203,163,47,189,187,231,149,182,231,55,223, +221,243,10,120,154,65,113,23,248,74,66,229,139,107,23,80,168,190,49,220,138,152,216,142,183,76,168,230,210,163,245,36,106,17, +117,124,73,212,17,9,9,201,66,238,85,110,191,251,150,205,223,152,97,70,42,108,75,213,42,143,223,115,203,208,55,170,10,245,30,247, +97,37,79,160,31,31,172,100,116,154,232,225,3,63,243,177,162,37,190,153,244,231,142,96,62,13,157,118,246,231,175,233,137,168,41, +250,147,191,188,7,75,85,15,154,254,223,61,88,42,123,128,101,102,94,185,215,196,222,18,177,161,77,73,17,83,196,251,62,39,247, +30,151,119,114,105,212,254,93,3,250,136,27,208,139,221,95,163,61,75,161,202,198,85,184,1,221,131,30,220,128,242,54,187,142,46, +114,249,217,18,212,28,192,185,139,190,3,254,24,10,53,54,224,254,211,196,253,87,132,59,110,157,139,107,226,222,219,201,163,191, +45,229,209,95,131,55,192,107,98,191,151,163,111,226,125,232,23,145,136,207,171,106,154,169,53,70,27,90,230,47,112,196,192,197, +209,233,179,161,41,235,149,81,251,157,215,193,189,56,95,102,228,90,120,4,40,180,44,250,7,49,62,59,78,94,29,181,127,55,98,6,219, +228,139,174,134,223,1,79,142,216,233,199,55,147,89,212,129,200,97,6,19,56,161,62,182,148,85,96,182,205,216,28,138,97,196,151, +74,127,51,54,155,130,174,120,123,16,111,183,70,89,127,33,39,196,205,88,29,5,185,157,55,87,204,239,91,246,239,117,157,63,15,156, +149,126,244,172,180,24,83,37,217,247,91,57,122,193,148,205,254,206,100,203,34,37,171,149,172,85,254,205,136,162,34,29,85,233, +40,86,211,69,133,183,158,125,31,114,181,214,133,123,147,171,181,46,220,151,182,238,149,191,115,225,146,22,135,93,200,82,153,118, +169,182,61,42,207,3,63,174,108,94,37,139,149,244,171,178,1,244,200,94,95,117,127,171,50,97,181,126,226,59,146,200,111,81,125, +108,113,244,91,176,72,201,86,85,158,169,183,133,144,101,83,182,50,213,150,93,46,56,213,150,122,215,138,190,118,165,204,84,254, +10,170,90,105,141,102,44,211,48,243,27,12,35,187,37,101,76,180,110,215,199,117,98,221,196,187,123,136,245,16,239,129,88,67,124, +77,47,85,175,53,38,7,45,61,155,92,149,202,141,166,114,185,222,84,46,111,152,70,150,88,47,241,94,184,246,246,146,214,139,143, +170,94,221,76,102,173,84,178,77,207,100,218,150,39,242,169,241,84,126,178,147,46,57,211,158,201,164,83,9,61,159,178,204,185,5, +159,222,212,144,145,152,76,164,141,149,122,58,61,168,39,118,228,58,105,214,133,74,57,179,18,150,137,190,228,219,86,10,185,43, +239,204,26,206,234,153,145,84,34,215,182,82,55,199,117,84,56,251,60,89,86,218,202,118,167,210,121,35,123,225,252,117,122,62,155, +218,213,73,243,255,100,254,25,85,205,60,215,117,131,158,50,209,191,234,115,115,54,25,9,100,84,76,101,88,185,182,21,99,102, +50,109,116,82,165,211,216,179,34,101,38,69,237,211,117,140,99,229,218,176,60,171,199,13,81,121,205,153,25,235,44,49,93,42,111, +254,153,121,98,205,231,174,55,187,173,196,88,110,229,136,110,14,27,133,101,117,118,101,202,213,57,164,41,227,85,89,107,44,211, +73,151,157,155,19,207,26,198,250,193,156,145,29,55,178,104,229,170,180,53,168,167,123,245,73,107,44,63,221,204,156,63,93,174, +147,90,207,116,72,153,153,177,252,168,145,31,177,146,109,43,244,156,209,35,210,88,120,19,243,39,183,69,211,133,253,87,39,83,121, +43,219,99,14,89,157,180,224,194,110,231,84,185,232,93,124,215,73,125,157,110,234,195,162,199,221,189,9,107,180,45,107,165,83, +109,219,199,18,70,219,57,199,108,238,5,206,210,220,51,71,190,228,175,173,167,147,234,223,173,104,39,53,244,38,245,244,120,106, +71,155,110,154,86,94,158,169,182,213,102,34,109,229,82,230,240,202,180,158,147,135,229,92,159,30,204,75,86,229,215,159,39,127, +157,49,58,168,28,140,156,216,49,34,166,180,165,177,185,218,176,197,178,125,198,206,49,195,76,96,91,151,59,115,236,250,26,28, +166,158,116,218,24,214,211,203,19,9,35,151,91,189,43,97,100,236,197,152,123,30,159,236,240,216,40,6,231,240,170,112,122,33,42, +12,219,179,50,109,188,198,234,27,75,140,216,43,231,40,23,114,184,172,31,220,46,15,101,157,195,214,103,36,198,178,136,85,23,40, +210,135,32,96,14,139,29,51,109,203,26,67,105,212,131,110,140,91,118,236,138,235,217,97,195,217,219,154,243,184,219,93,195,171, +56,190,117,195,106,242,59,183,6,177,45,196,183,244,144,123,75,15,126,160,174,33,207,150,53,61,221,221,107,200,5,217,35,62,69, +56,222,178,166,31,153,66,233,93,35,62,164,214,143,220,222,126,4,245,45,253,40,213,47,107,96,253,164,245,139,114,248,232,21,42, +98,122,191,80,68,96,31,192,117,48,208,67,161,129,115,215,171,98,224,60,211,229,211,229,146,205,141,197,98,83,122,187,67,191, +200,161,95,236,208,47,129,94,98,235,221,105,125,56,71,30,93,158,63,97,20,178,87,31,52,210,84,164,171,219,130,102,233,201,228, +249,163,10,177,65,42,23,23,200,138,177,124,222,50,55,100,81,165,145,36,207,160,133,228,40,164,12,172,228,73,200,59,129,188,9, +25,250,146,228,198,221,163,103,169,36,97,37,141,13,22,34,245,242,188,72,76,69,119,10,200,68,60,171,155,185,33,43,59,74,165,226, +230,65,72,207,73,111,84,100,95,64,168,200,26,67,218,149,76,13,13,17,51,200,109,136,240,75,254,161,233,64,155,164,98,236,129, +229,246,8,103,8,117,250,110,83,247,24,149,194,44,206,12,134,108,100,115,84,36,146,98,226,201,39,52,229,228,23,91,73,84,31,79, +141,26,178,210,171,141,212,240,72,158,42,160,246,170,29,183,222,236,75,96,3,153,50,223,222,89,84,6,85,246,27,167,85,118,215,63, +109,232,73,146,23,169,77,250,196,181,5,101,43,149,8,197,178,242,34,126,80,16,137,190,73,204,247,104,31,246,100,42,97,80,0,150, +205,102,74,76,158,232,180,108,255,236,112,46,135,180,37,149,75,13,166,210,98,13,69,153,247,224,66,179,38,226,214,14,116,47,60, +149,150,78,105,3,145,45,147,214,39,187,179,58,6,231,66,238,181,242,115,43,177,17,42,195,68,98,29,49,113,27,244,49,177,192,193, +41,195,38,35,135,136,48,101,89,49,181,23,168,212,182,32,114,174,178,38,176,183,166,146,155,51,84,57,149,144,81,245,234,84,50, +137,62,169,102,214,89,104,67,150,57,195,144,213,135,11,117,74,3,170,81,117,202,187,158,138,70,244,156,188,95,169,122,36,149,52, +250,172,161,188,188,51,186,179,214,168,61,82,184,192,49,46,214,210,53,98,229,242,196,82,228,195,90,174,151,193,33,71,90,106, +116,148,202,196,147,45,165,167,87,234,153,220,58,204,48,149,42,67,159,145,94,109,38,167,242,145,236,203,235,217,60,21,203,91, +42,62,153,49,200,47,213,235,237,27,139,60,41,196,161,29,6,154,200,245,152,185,188,142,88,76,69,169,220,250,140,142,192,140,98, +57,53,243,228,221,97,76,174,20,77,85,239,184,192,211,175,180,144,209,55,34,230,197,157,150,39,180,20,235,101,100,69,203,215,224, +202,33,87,218,24,202,147,39,109,152,195,249,17,242,168,94,48,147,92,166,88,83,175,105,76,92,35,23,215,74,39,71,228,231,4,149, +91,102,225,81,184,50,107,232,121,172,100,197,180,105,149,145,203,103,173,73,177,188,211,70,181,5,28,37,11,123,160,118,218,212 +,167,143,27,133,65,99,154,242,134,211,95,206,219,153,85,244,229,173,76,6,166,106,156,73,217,143,179,158,6,228,177,76,236,128, +9,42,181,156,143,40,10,88,103,196,37,42,182,204,194,134,43,149,234,186,177,116,62,149,17,147,44,147,216,52,69,34,192,73,103,120, +244,165,222,103,20,194,132,31,247,133,133,171,74,158,113,52,104,175,147,215,150,248,50,137,34,203,243,121,132,7,119,70,110, +56,95,70,207,194,83,30,82,119,70,198,37,150,165,134,172,49,44,150,45,123,225,199,54,133,179,198,168,53,110,216,61,95,111,158, +21,83,221,89,25,85,180,156,145,167,64,78,196,159,169,167,46,249,145,150,227,215,197,198,169,118,166,122,236,222,203,61,43,138, +57,30,76,178,88,111,97,179,208,76,164,206,251,22,165,25,185,66,172,217,156,114,4,143,218,243,154,197,83,71,71,220,206,217,209, +71,238,173,210,220,25,81,199,87,72,166,237,62,189,39,149,78,95,99,229,229,74,250,115,216,203,133,8,128,130,72,77,157,89,56,139, +61,98,247,11,247,60,178,177,65,166,147,51,115,118,111,122,166,219,82,35,117,229,71,82,184,208,196,231,220,152,146,237,176,138, +144,173,161,14,168,98,10,138,198,242,67,29,50,120,178,113,114,143,235,105,177,210,82,172,31,34,151,120,124,82,153,248,116,238, +143,98,97,136,91,155,115,6,5,199,207,14,183,190,241,233,81,179,9,98,187,136,239,138,129,118,98,147,116,132,51,242,6,250,187,232, +81,124,227,109,25,208,248,19,172,116,175,198,142,177,138,57,26,165,120,235,174,223,111,239,98,229,229,169,46,158,171,235,162, +251,56,167,87,153,55,192,47,223,202,175,154,88,68,247,112,246,58,146,231,200,251,81,89,224,33,250,162,45,102,107,195,143,179, +3,204,219,194,159,167,78,254,91,54,193,159,252,192,196,62,198,221,190,229,139,186,90,187,186,174,24,208,40,233,187,81,99,70,107, +215,253,245,154,246,121,182,144,85,207,136,205,214,248,103,25,103,229,213,110,206,55,214,185,201,205,220,154,199,199,23,30,114, +251,60,228,97,30,238,209,22,44,224,227,45,110,190,128,231,90,104,150,221,244,44,254,58,123,67,40,39,196,192,62,28,38,92,94, +129,181,244,136,198,95,99,191,18,246,237,72,211,97,77,124,190,164,241,254,235,33,127,168,177,126,136,99,82,160,200,47,165,242, +145,48,61,167,28,126,110,59,124,219,22,255,193,217,215,153,183,110,237,218,69,253,107,251,91,73,103,55,200,82,183,104,252,167, +236,99,104,226,35,181,139,232,117,198,239,101,59,188,117,123,121,168,142,103,234,120,89,39,31,59,180,141,79,174,161,253,92,187, +151,141,32,139,151,238,225,227,117,183,15,108,223,171,209,43,140,247,211,45,92,150,9,236,141,132,111,167,63,112,183,254,57, +246,18,123,154,189,23,77,190,197,93,191,100,31,100,15,178,47,160,254,165,123,251,105,82,58,242,103,168,142,31,189,169,110,173, +86,124,45,239,213,188,63,97,26,127,146,182,242,101,45,172,162,44,102,19,236,213,74,238,103,124,105,151,230,255,87,214,182,148, +49,205,247,9,198,23,177,112,233,149,110,159,219,223,238,46,217,238,241,181,178,138,42,254,254,206,46,143,127,41,171,155,33,236, +103,26,121,55,171,11,208,1,141,253,39,218,143,104,236,71,88,162,80,21,247,183,240,209,58,108,148,237,209,217,110,18,178,185, +209,77,63,139,45,160,143,106,236,1,49,217,71,52,182,205,27,72,133,233,59,140,189,12,195,83,26,29,100,53,173,219,215,238,186,97, +214,94,226,117,236,167,108,102,45,159,205,183,184,248,253,172,122,177,109,8,75,67,8,134,98,62,7,134,48,155,89,83,80,106,137, +51,230,227,236,182,72,100,247,110,215,177,234,122,246,106,53,105,30,242,223,22,193,94,225,13,55,239,118,29,158,197,246,69,94, +18,31,39,197,199,254,26,198,15,129,103,107,200,85,54,171,140,51,249,47,10,199,147,53,200,62,56,27,31,135,103,187,110,225,84,12, +216,159,65,24,44,100,79,205,102,236,36,184,109,78,37,59,52,135,177,199,192,9,112,18,236,139,48,246,40,120,13,252,17,220,86,207, +216,33,112,10,28,110,128,31,120,174,17,101,230,50,215,41,176,191,137,177,99,77,46,182,111,1,99,7,23,114,246,0,120,118,97,208, +241,251,176,130,44,252,93,165,248,125,78,225,111,43,197,239,127,10,127,95,233,162,233,191,177,20,191,63,42,252,157,101,225,119, +84,226,111,45,181,160,173,139,223,203,177,136,253,119,69,199,160,123,34,182,93,252,31,53,11,218,191,67,147,255,111,29,177,219, +21,127,155,169,41,127,241,255,201,174,136,93,175,248,63,104,82,101,229,255,109,7,237,190,138,191,3,253,63,65,69,100,73,64,42,0,0,0,0}; //============================================================================== #if JUCE_PUSH_NOTIFICATIONS && JUCE_MODULE_AVAILABLE_juce_gui_extra @@ -905,7 +896,7 @@ private: CALLBACK (handleAppPausedJni, "handleAppPaused", "(J)V") \ CALLBACK (handleAppResumedJni, "handleAppResumed", "(J)V") \ - DECLARE_JNI_CLASS_WITH_BYTECODE (ComponentPeerView, "com/roli/juce/ComponentPeerView", 16, javaComponentPeerView, sizeof(javaComponentPeerView)) + DECLARE_JNI_CLASS_WITH_BYTECODE (ComponentPeerView, "com/roli/juce/ComponentPeerView", 16, javaComponentPeerView, sizeof (javaComponentPeerView)) #undef JNI_CLASS_MEMBERS static void JNICALL handlePaintJni (JNIEnv*, jobject /*view*/, jlong host, jobject canvas, jobject paint) { if (auto* myself = reinterpret_cast (host)) myself->handlePaintCallback (canvas, paint); } From efe197de398231dfec194bac5748bdadf8f7d49b Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 11 Mar 2019 10:18:37 +0000 Subject: [PATCH 06/20] Ensure that the current state is valid when calling ADSR::setParameters() after calling ADSR::noteOn() and recalculate the release rate if ADSR::noteOff() is called when not in the sustain stage --- modules/juce_audio_basics/utilities/juce_ADSR.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/juce_audio_basics/utilities/juce_ADSR.h b/modules/juce_audio_basics/utilities/juce_ADSR.h index 3821333f06..481782edda 100644 --- a/modules/juce_audio_basics/utilities/juce_ADSR.h +++ b/modules/juce_audio_basics/utilities/juce_ADSR.h @@ -71,6 +71,9 @@ public: sustainLevel = newParameters.sustain; calculateRates (newParameters); + + if (currentState != State::idle) + checkCurrentState(); } /** Returns the parameters currently being used by an ADSR object. @@ -115,9 +118,16 @@ public: if (currentState != State::idle) { if (releaseRate > 0.0f) + { + if (currentState != State::sustain) + releaseRate = static_cast (envelopeVal / (currentParameters.release * sr)); + currentState = State::release; + } else + { reset(); + } } } @@ -205,6 +215,13 @@ private: releaseRate = (parameters.release > 0.0f ? static_cast (sustainLevel / (parameters.release * sr)) : -1.0f); } + void checkCurrentState() + { + if (currentState == State::attack && attackRate <= 0.0f) currentState = decayRate > 0.0f ? State::decay : State::sustain; + else if (currentState == State::decay && decayRate <= 0.0f) currentState = State::sustain; + else if (currentState == State::release && releaseRate <= 0.0f) reset(); + } + //============================================================================== enum class State { idle, attack, decay, sustain, release }; From 2ef4ea53cf93d02f03f48e12ad29234b7b1892ae Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 28 Feb 2019 16:46:47 +0000 Subject: [PATCH 07/20] APVTS: Improve the performance of parameter lookups --- .../utilities/juce_AudioProcessorValueTreeState.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index 1ef3e4ad2b..18ebd40412 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -543,7 +543,12 @@ private: const Identifier valueType { "PARAM" }, valuePropertyID { "value" }, idPropertyID { "id" }; - std::map> adapterTable; + struct StringRefLessThan final + { + bool operator() (StringRef a, StringRef b) const noexcept { return a.text.compare (b.text) < 0; } + }; + + std::map, StringRefLessThan> adapterTable; CriticalSection valueTreeChanging; From 4700dd9773f3d8b261ad97aba850476432c23c5e Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Wed, 27 Feb 2019 16:59:42 +0000 Subject: [PATCH 08/20] Serialise doubles into more human friendly XML and JSON --- BREAKING-CHANGES.txt | 24 +++++++ modules/juce_core/containers/juce_Variant.cpp | 2 +- modules/juce_core/javascript/juce_JSON.cpp | 16 +++-- modules/juce_core/text/juce_String.cpp | 70 +++++++++++++++++++ modules/juce_core/xml/juce_XmlElement.cpp | 16 +++-- .../values/juce_ValueTree.cpp | 13 ++-- 6 files changed, 124 insertions(+), 17 deletions(-) diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index f90978df1c..910e52ad5b 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -4,6 +4,30 @@ JUCE breaking changes Develop ======= +Change +------ +The formatting of floating point numbers written to XML and JSON files has +changed. + +Note that there is no change in precision - the XML and JSON files containing +the new format numbers will parse in exactly the same way, it is only the +string representation that has changed. + +Possible Issues +--------------- +If you rely upon exactly reproducing XML or JSON files then the new files may +be different. + +Workaround +---------- +Update any reference XML or JSON files to use the new format. + +Rationale +--------- +The new format retains full precision, provides a human friendly representation +of values near 1, and uses scientific notation for small and large numbers. +This prevents needless file size bloat from numbers like 0.00000000000000001. + Version 5.4.3 ============= diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index 1426f43f2d..cd30816170 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -175,7 +175,7 @@ public: int toInt (const ValueUnion& data) const noexcept override { return (int) data.doubleValue; } int64 toInt64 (const ValueUnion& data) const noexcept override { return (int64) data.doubleValue; } double toDouble (const ValueUnion& data) const noexcept override { return data.doubleValue; } - String toString (const ValueUnion& data) const override { return minimiseLengthOfFloatString (String (data.doubleValue, 15, true)); } + String toString (const ValueUnion& data) const override { return serialiseDouble (data.doubleValue); } bool toBool (const ValueUnion& data) const noexcept override { return data.doubleValue != 0.0; } bool isDouble() const noexcept override { return true; } bool isComparable() const noexcept override { return true; } diff --git a/modules/juce_core/javascript/juce_JSON.cpp b/modules/juce_core/javascript/juce_JSON.cpp index 08082ae098..020c74edc3 100644 --- a/modules/juce_core/javascript/juce_JSON.cpp +++ b/modules/juce_core/javascript/juce_JSON.cpp @@ -352,8 +352,7 @@ struct JSONFormatter if (juce_isfinite (d)) { - String doubleString (d, maximumDecimalPlaces, true); - out << minimiseLengthOfFloatString (doubleString); + out << serialiseDouble (d); } else { @@ -664,12 +663,17 @@ public: tests[1] = "1"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; - tests[0.76378] = "7.6378e-1"; - tests[-10] = "-1e1"; - tests[10.01] = "1.001e1"; - tests[0.0123] = "1.23e-2"; + tests[0.76378] = "0.76378"; + tests[-10] = "-10"; + tests[10.01] = "10.01"; + tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; tests[1e+40] = "1e40"; + tests[-12345678901234567.0] = "-1.234567890123457e16"; + tests[192000] = "192000"; + tests[1234567] = "1.234567e6"; + tests[0.00006] = "0.00006"; + tests[0.000006] = "6e-6"; for (auto& test : tests) expectEquals (JSON::toString (test.first), test.second); diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 0a72b49274..c334f2a93e 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -2258,6 +2258,48 @@ static String minimiseLengthOfFloatString (const String& input) return input; } +static String serialiseDouble (double input) +{ + auto absInput = std::abs (input); + + if (absInput >= 1.0e6 || absInput <= 1.0e-5) + return minimiseLengthOfFloatString ({ input, 15, true }); + + int intInput = (int) input; + + if ((double) intInput == input) + return minimiseLengthOfFloatString ({ input, 1 }); + + auto numberOfDecimalPlaces = [absInput] + { + if (absInput < 1.0) + { + if (absInput >= 1.0e-3) + { + if (absInput >= 1.0e-1) return 16; + if (absInput >= 1.0e-2) return 17; + return 18; + } + + if (absInput >= 1.0e-4) return 19; + return 20; + } + + if (absInput < 1.0e3) + { + if (absInput < 1.0e1) return 15; + if (absInput < 1.0e2) return 14; + return 13; + } + + if (absInput < 1.0e4) return 12; + if (absInput < 1.0e5) return 11; + return 10; + }(); + + return minimiseLengthOfFloatString (String (input, numberOfDecimalPlaces)); +} + //============================================================================== //============================================================================== #if JUCE_UNIT_TESTS @@ -2851,6 +2893,34 @@ public: expectEquals (minimiseLengthOfFloatString (String (test.first, 15, true)), test.second); } } + + { + beginTest ("Serialisation"); + + std::map tests; + tests[1234567890123456.7] = "1.234567890123457e15"; + tests[12345678.901234567] = "1.234567890123457e7"; + tests[1234567.8901234567] = "1.234567890123457e6"; + tests[123456.78901234567] = "123456.7890123457"; + tests[12345.678901234567] = "12345.67890123457"; + tests[1234.5678901234567] = "1234.567890123457"; + tests[123.45678901234567] = "123.4567890123457"; + tests[12.345678901234567] = "12.34567890123457"; + tests[1.2345678901234567] = "1.234567890123457"; + tests[0.12345678901234567] = "0.1234567890123457"; + tests[0.012345678901234567] = "0.01234567890123457"; + tests[0.0012345678901234567] = "0.001234567890123457"; + tests[0.00012345678901234567] = "0.0001234567890123457"; + tests[0.000012345678901234567] = "0.00001234567890123457"; + tests[0.0000012345678901234567] = "1.234567890123457e-6"; + tests[0.00000012345678901234567] = "1.234567890123457e-7"; + + for (auto& test : tests) + { + expectEquals (serialiseDouble (test.first), test.second); + expectEquals (serialiseDouble (-test.first), "-" + test.second); + } + } } }; diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index 0c745e2a79..ff46dcf8ff 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -580,8 +580,7 @@ void XmlElement::setAttribute (const Identifier& attributeName, const int number void XmlElement::setAttribute (const Identifier& attributeName, const double number) { - String doubleString (number, 15, true); - setAttribute (attributeName, minimiseLengthOfFloatString (doubleString)); + setAttribute (attributeName, serialiseDouble (number)); } void XmlElement::removeAttribute (const Identifier& attributeName) noexcept @@ -946,12 +945,17 @@ public: tests[1] = "1"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; - tests[0.76378] = "7.6378e-1"; - tests[-10] = "-1e1"; - tests[10.01] = "1.001e1"; - tests[0.0123] = "1.23e-2"; + tests[0.76378] = "0.76378"; + tests[-10] = "-10"; + tests[10.01] = "10.01"; + tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; tests[1e+40] = "1e40"; + tests[-12345678901234567.0] = "-1.234567890123457e16"; + tests[192000] = "192000"; + tests[1234567] = "1.234567e6"; + tests[0.00006] = "0.00006"; + tests[0.000006] = "6e-6"; for (auto& test : tests) { diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 8ff2983e9c..5f43a5d0a1 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -1198,12 +1198,17 @@ public: tests[1] = "1"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; - tests[0.76378] = "7.6378e-1"; - tests[-10] = "-1e1"; - tests[10.01] = "1.001e1"; - tests[0.0123] = "1.23e-2"; + tests[0.76378] = "0.76378"; + tests[-10] = "-10"; + tests[10.01] = "10.01"; + tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; tests[1e+40] = "1e40"; + tests[-12345678901234567.0] = "-1.234567890123457e16"; + tests[192000] = "192000"; + tests[1234567] = "1.234567e6"; + tests[0.00006] = "0.00006"; + tests[0.000006] = "6e-6"; for (auto& test : tests) { From d11ef30e096917e275d3978466bcec3936bb06c4 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Mon, 4 Mar 2019 11:47:51 +0000 Subject: [PATCH 09/20] CLion: Fixed some issues loading a CMakeLists.txt generated on Windows --- .../ProjectSaving/jucer_ProjectExport_CLion.h | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h index 70b91db7a8..ba9eaf90d9 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CLion.h @@ -383,12 +383,14 @@ private: { if (exporter.isXcode() && target->getTargetFileType() == ProjectType::Target::TargetFileType::executable) { - auto xcodeIcnsFile = getTargetFolder().getParentDirectory() - .getChildFile ("MacOSX") - .getChildFile ("Icon.icns"); + StringArray pathComponents = { "..", "MacOSX", "Icon.icns" }; + auto xcodeIcnsFile = getTargetFolder(); + + for (auto& comp : pathComponents) + xcodeIcnsFile = xcodeIcnsFile.getChildFile (comp); if (xcodeIcnsFile.existsAsFile()) - return xcodeIcnsFile.getRelativePathFrom (getTargetFolder()).quoted(); + return pathComponents.joinIntoString ("/").quoted(); } return {}; @@ -399,12 +401,14 @@ private: if (exporter.isCodeBlocks() && target->getTargetFileType() == ProjectType::Target::TargetFileType::executable) { - auto windowsRcFile = getTargetFolder().getParentDirectory() - .getChildFile ("CodeBlocksWindows") - .getChildFile ("resources.rc"); + StringArray pathComponents = { "..", "CodeBlocksWindows", "resources.rc" }; + auto windowsRcFile = getTargetFolder(); + + for (auto& comp : pathComponents) + windowsRcFile = windowsRcFile.getChildFile (comp); if (windowsRcFile.existsAsFile()) - out << " " << windowsRcFile.getRelativePathFrom (getTargetFolder()).quoted() << newLine; + out << " " << pathComponents.joinIntoString ("/").quoted() << newLine; } out << ")" << newLine << newLine; @@ -966,11 +970,14 @@ private: auto sdkVersion = config.getOSXSDKVersionString().upToFirstOccurrenceOf (" ", false, false); auto sysroot = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" + sdkVersion + ".sdk"; + RelativePath rFile ("JuceLibraryCode/include_juce_audio_plugin_client_AU.r", RelativePath::projectFolder); + rFile = rebaseFromProjectFolderToBuildTarget (rFile); + out << "if (RC_COMPILER)" << newLine << " set (" << resSourcesVar << newLine - << " " << item.determineGroupFolder().getChildFile ("include_juce_audio_plugin_client_AU.r").getFullPathName().quoted() << newLine + << " " << ("${CMAKE_CURRENT_SOURCE_DIR}/" + rFile.toUnixStyle()).quoted() << newLine << " )" << newLine - << " set (" << resOutputVar << " \"${CMAKE_CURRENT_BINARY_DIR}/" << binaryName << ".rsrc\")" << newLine + << " set (" << resOutputVar << " " << ("${CMAKE_CURRENT_BINARY_DIR}/" + binaryName + ".rsrc").quoted() << ")" << newLine << " target_sources (" << targetVarName << " PRIVATE" << newLine << " ${" << resSourcesVar << "}" << newLine << " ${" << resOutputVar << "}" << newLine @@ -1033,7 +1040,7 @@ private: auto updatedPlist = getTargetFolder().getChildFile (config.getName() + "-" + plistFile.getFileName()); plist->writeToFile (updatedPlist, ""); - targetAttributes.set ("INFOPLIST_FILE", updatedPlist.getFullPathName().quoted()); + targetAttributes.set ("INFOPLIST_FILE", ("${CMAKE_CURRENT_SOURCE_DIR}/" + updatedPlist.getFileName()).quoted()); } else { From cc2a7094e81ca94bbb71539dba080087bfffd794 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 4 Mar 2019 14:06:37 +0000 Subject: [PATCH 10/20] Fixed an unused variable warning in the VST3 wrapper --- modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | 1 + 1 file changed, 1 insertion(+) 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 5f1a6b5754..742659faa9 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -1338,6 +1338,7 @@ public: short configs[][2] = { JucePlugin_PreferredChannelConfigurations }; const int numConfigs = sizeof (configs) / sizeof (short[2]); + ignoreUnused (numConfigs); jassert (numConfigs > 0 && (configs[0][0] > 0 || configs[0][1] > 0)); pluginInstance->setPlayConfigDetails (configs[0][0], configs[0][1], 44100.0, 1024); From d4aed754c0b763fbdd513c03b18b176127630d27 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 8 Mar 2019 15:38:34 +0000 Subject: [PATCH 11/20] AAX: Fixed some compiler warnings --- modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 6c13147316..8a871f33df 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -41,6 +41,9 @@ #pragma clang diagnostic ignored "-Wnon-virtual-dtor" #pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wextra-semi" + #if __has_warning("-Wpragma-pack") + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif #endif #ifdef _MSC_VER From d475b17a81bc3ce2bc03fa91555b422e14abed59 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 8 Mar 2019 16:41:27 +0000 Subject: [PATCH 12/20] Fixed some compiler warnings --- extras/AudioPluginHost/AudioPluginHost.jucer | 2 +- .../AudioPluginHost.xcodeproj/project.pbxproj | 4 +- .../Source/Filters/FilterGraph.h | 2 +- .../Source/Filters/FilterIOConfiguration.h | 2 +- .../Source/Filters/InternalFilters.h | 2 +- .../Source/UI/GraphEditorPanel.cpp | 10 +- .../Source/UI/GraphEditorPanel.h | 4 +- .../Source/UI/MainHostWindow.cpp | 2 +- .../Source/UI/MainHostWindow.h | 2 +- .../AudioPluginHost/Source/UI/PluginWindow.h | 14 +-- .../format_types/juce_AudioUnitPluginFormat.h | 2 +- .../juce_AudioUnitPluginFormat.mm | 50 +++++----- .../format_types/juce_VST3Headers.h | 9 ++ .../format_types/juce_VST3PluginFormat.cpp | 21 ++-- .../format_types/juce_VST3PluginFormat.h | 2 +- .../format_types/juce_VSTPluginFormat.cpp | 98 ++++++++++--------- .../format_types/juce_VSTPluginFormat.h | 2 +- .../juce_audio_processors.cpp | 3 + modules/juce_core/native/juce_mac_Network.mm | 2 +- .../juce_opengl/opengl/juce_OpenGLContext.cpp | 4 +- 20 files changed, 132 insertions(+), 105 deletions(-) diff --git a/extras/AudioPluginHost/AudioPluginHost.jucer b/extras/AudioPluginHost/AudioPluginHost.jucer index 894f791c7c..0cecea5328 100644 --- a/extras/AudioPluginHost/AudioPluginHost.jucer +++ b/extras/AudioPluginHost/AudioPluginHost.jucer @@ -7,7 +7,7 @@ companyCopyright="ROLI Ltd."> diff --git a/extras/AudioPluginHost/Builds/MacOSX/AudioPluginHost.xcodeproj/project.pbxproj b/extras/AudioPluginHost/Builds/MacOSX/AudioPluginHost.xcodeproj/project.pbxproj index 14a4b82466..c54a07ccc9 100644 --- a/extras/AudioPluginHost/Builds/MacOSX/AudioPluginHost.xcodeproj/project.pbxproj +++ b/extras/AudioPluginHost/Builds/MacOSX/AudioPluginHost.xcodeproj/project.pbxproj @@ -802,7 +802,7 @@ INFOPLIST_PREPROCESS = NO; INSTALL_PATH = "$(HOME)/Applications"; MACOSX_DEPLOYMENT_TARGET = 10.11; - OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wstrict-aliasing -Wconversion -Wsign-compare -Woverloaded-virtual -Wextra-semi"; + OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code -Wzero-as-null-pointer-constant -Wcast-align -Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wundefined-func-template -Wnullable-to-nonnull-conversion"; PRODUCT_BUNDLE_IDENTIFIER = com.roli.juce.pluginhost; PRODUCT_NAME = "AudioPluginHost"; USE_HEADERMAP = NO; @@ -849,7 +849,7 @@ INSTALL_PATH = "$(HOME)/Applications"; LLVM_LTO = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; - OTHER_CPLUSPLUSFLAGS = "-Wall -Wshadow -Wstrict-aliasing -Wconversion -Wsign-compare -Woverloaded-virtual -Wextra-semi"; + OTHER_CPLUSPLUSFLAGS = "-Wall -Wno-missing-field-initializers -Wshadow-all -Wshorten-64-to-32 -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wconversion -Wsign-compare -Wint-conversion -Wconditional-uninitialized -Woverloaded-virtual -Wreorder -Wconstant-conversion -Wsign-conversion -Wunused-private-field -Wbool-conversion -Wextra-semi -Wno-ignored-qualifiers -Wunreachable-code -Wzero-as-null-pointer-constant -Wcast-align -Winconsistent-missing-destructor-override -Wshift-sign-overflow -Wundefined-func-template -Wnullable-to-nonnull-conversion"; PRODUCT_BUNDLE_IDENTIFIER = com.roli.juce.pluginhost; PRODUCT_NAME = "AudioPluginHost"; USE_HEADERMAP = NO; diff --git a/extras/AudioPluginHost/Source/Filters/FilterGraph.h b/extras/AudioPluginHost/Source/Filters/FilterGraph.h index 592642d4df..318e8c90c1 100644 --- a/extras/AudioPluginHost/Source/Filters/FilterGraph.h +++ b/extras/AudioPluginHost/Source/Filters/FilterGraph.h @@ -40,7 +40,7 @@ class FilterGraph : public FileBasedDocument, public: //============================================================================== FilterGraph (AudioPluginFormatManager&); - ~FilterGraph(); + ~FilterGraph() override; //============================================================================== using NodeID = AudioProcessorGraph::NodeID; diff --git a/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h b/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h index 4fcf3ba6bc..266a3a180e 100644 --- a/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h +++ b/extras/AudioPluginHost/Source/Filters/FilterIOConfiguration.h @@ -35,7 +35,7 @@ class FilterIOConfigurationWindow : public AudioProcessorEditor { public: FilterIOConfigurationWindow (AudioProcessor&); - ~FilterIOConfigurationWindow(); + ~FilterIOConfigurationWindow() override; //============================================================================== void paint (Graphics& g) override; diff --git a/extras/AudioPluginHost/Source/Filters/InternalFilters.h b/extras/AudioPluginHost/Source/Filters/InternalFilters.h index 4432ff08a1..e0b26a2a8d 100644 --- a/extras/AudioPluginHost/Source/Filters/InternalFilters.h +++ b/extras/AudioPluginHost/Source/Filters/InternalFilters.h @@ -38,7 +38,7 @@ class InternalPluginFormat : public AudioPluginFormat public: //============================================================================== InternalPluginFormat(); - ~InternalPluginFormat() {} + ~InternalPluginFormat() override {} //============================================================================== PluginDescription audioInDesc, audioOutDesc, midiInDesc; diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp index 3803bf0b2c..c3b6036a31 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp @@ -197,7 +197,7 @@ struct GraphEditorPanel::FilterComponent : public Component, FilterComponent (const FilterComponent&) = delete; FilterComponent& operator= (const FilterComponent&) = delete; - ~FilterComponent() + ~FilterComponent() override { if (auto f = graph.graph.getNodeForId (pluginID)) { @@ -812,7 +812,7 @@ void GraphEditorPanel::updateComponents() for (auto* f : graph.graph.getNodes()) { - if (getComponentForFilter (f->nodeID) == 0) + if (getComponentForFilter (f->nodeID) == nullptr) { auto* comp = nodes.add (new FilterComponent (*this, f->nodeID)); addAndMakeVisible (comp); @@ -822,7 +822,7 @@ void GraphEditorPanel::updateComponents() for (auto& c : graph.graph.getConnections()) { - if (getComponentForConnection (c) == 0) + if (getComponentForConnection (c) == nullptr) { auto* comp = connectors.add (new ConnectorComponent (*this)); addAndMakeVisible (comp); @@ -844,8 +844,8 @@ void GraphEditorPanel::showPopupMenu (Point mousePos) menu->showMenuAsync ({}, ModalCallbackFunction::create ([this, mousePos] (int r) { - if (auto* mainWindow = findParentComponentOfClass()) - if (auto* desc = mainWindow->getChosenType (r)) + if (auto* mainWin = findParentComponentOfClass()) + if (auto* desc = mainWin->getChosenType (r)) createNewPlugin (*desc, mousePos); })); } diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h index 7112e05a37..291420ea3f 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.h @@ -40,7 +40,7 @@ class GraphEditorPanel : public Component, { public: GraphEditorPanel (FilterGraph& graph); - ~GraphEditorPanel(); + ~GraphEditorPanel() override; void createNewPlugin (const PluginDescription&, Point position); @@ -107,7 +107,7 @@ public: AudioDeviceManager& deviceManager, KnownPluginList& pluginList); - ~GraphDocumentComponent(); + ~GraphDocumentComponent() override; //============================================================================== void createNewPlugin (const PluginDescription&, Point position); diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp index e395667492..4b3522b150 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp @@ -55,7 +55,7 @@ public: setVisible (true); } - ~PluginListWindow() + ~PluginListWindow() override { getAppProperties().getUserSettings()->setValue ("listWindowPos", getWindowStateAsString()); clearContentComponent(); diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.h b/extras/AudioPluginHost/Source/UI/MainHostWindow.h index 78e87e8992..8ca9e21517 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.h +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.h @@ -60,7 +60,7 @@ class MainHostWindow : public DocumentWindow, public: //============================================================================== MainHostWindow(); - ~MainHostWindow(); + ~MainHostWindow() override; //============================================================================== void closeButtonPressed() override; diff --git a/extras/AudioPluginHost/Source/UI/PluginWindow.h b/extras/AudioPluginHost/Source/UI/PluginWindow.h index 0fc39c3fc0..386ee07f83 100644 --- a/extras/AudioPluginHost/Source/UI/PluginWindow.h +++ b/extras/AudioPluginHost/Source/UI/PluginWindow.h @@ -40,12 +40,12 @@ class FilterDebugWindow : public AudioProcessorEditor, { public: FilterDebugWindow (AudioProcessor& proc) - : AudioProcessorEditor (proc), processor (proc) + : AudioProcessorEditor (proc), audioProc (proc) { setSize (500, 200); addAndMakeVisible (list); - for (auto* p : processor.getParameters()) + for (auto* p : audioProc.getParameters()) p->addListener (this); log.add ("Parameter debug log started"); @@ -53,7 +53,7 @@ public: void parameterValueChanged (int parameterIndex, float newValue) override { - auto* param = processor.getParameters()[parameterIndex]; + auto* param = audioProc.getParameters()[parameterIndex]; auto value = param->getCurrentValueAsText().quoted() + " (" + String (newValue, 4) + ")"; appendToLog ("parameter change", *param, value); @@ -61,7 +61,7 @@ public: void parameterGestureChanged (int parameterIndex, bool gestureIsStarting) override { - auto* param = processor.getParameters()[parameterIndex]; + auto* param = audioProc.getParameters()[parameterIndex]; appendToLog ("gesture", *param, gestureIsStarting ? "start" : "end"); } @@ -120,7 +120,7 @@ private: StringArray pendingLogEntries; CriticalSection pendingLogLock; - AudioProcessor& processor; + AudioProcessor& audioProc; }; //============================================================================== @@ -170,7 +170,7 @@ public: setVisible (true); } - ~PluginWindow() + ~PluginWindow() override { clearContentComponent(); } @@ -287,7 +287,7 @@ private: owner.addListener (this); } - ~PropertyComp() + ~PropertyComp() override { owner.removeListener (this); } diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index de59213181..aaec61154c 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -40,7 +40,7 @@ class JUCE_API AudioUnitPluginFormat : public AudioPluginFormat public: //============================================================================== AudioUnitPluginFormat(); - ~AudioUnitPluginFormat(); + ~AudioUnitPluginFormat() override; //============================================================================== String getName() const override { return "AudioUnit"; } diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index 19d5531f7e..2e7e75533c 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -163,7 +163,7 @@ namespace AudioUnitFormatHelpers desc.componentSubType = stringToOSType (tokens[1]); desc.componentManufacturer = stringToOSType (tokens[2]); - if (AudioComponent comp = AudioComponentFindNext (0, &desc)) + if (AudioComponent comp = AudioComponentFindNext (nullptr, &desc)) { getNameAndManufacturer (comp, name, manufacturer); @@ -206,17 +206,17 @@ namespace AudioUnitFormatHelpers const char* const utf8 = fileOrIdentifier.toUTF8(); - if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, + if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (nullptr, (const UInt8*) utf8, (CFIndex) strlen (utf8), file.isDirectory())) { CFBundleRef bundleRef = CFBundleCreate (kCFAllocatorDefault, url); CFRelease (url); - if (bundleRef != 0) + if (bundleRef != nullptr) { CFTypeRef bundleName = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleName")); - if (bundleName != 0 && CFGetTypeID (bundleName) == CFStringGetTypeID()) + if (bundleName != nullptr && CFGetTypeID (bundleName) == CFStringGetTypeID()) name = String::fromCFString ((CFStringRef) bundleName); if (name.isEmpty()) @@ -224,12 +224,12 @@ namespace AudioUnitFormatHelpers CFTypeRef versionString = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleVersion")); - if (versionString != 0 && CFGetTypeID (versionString) == CFStringGetTypeID()) + if (versionString != nullptr && CFGetTypeID (versionString) == CFStringGetTypeID()) version = String::fromCFString ((CFStringRef) versionString); CFTypeRef manuString = CFBundleGetValueForInfoDictionaryKey (bundleRef, CFSTR("CFBundleGetInfoString")); - if (manuString != 0 && CFGetTypeID (manuString) == CFStringGetTypeID()) + if (manuString != nullptr && CFGetTypeID (manuString) == CFStringGetTypeID()) manufacturer = String::fromCFString ((CFStringRef) manuString); const ResFileRefNum resFileId = CFBundleOpenBundleResourceMap (bundleRef); @@ -256,7 +256,7 @@ namespace AudioUnitFormatHelpers desc.componentSubType = types[1]; desc.componentManufacturer = types[2]; - if (AudioComponent comp = AudioComponentFindNext (0, &desc)) + if (AudioComponent comp = AudioComponentFindNext (nullptr, &desc)) getNameAndManufacturer (comp, name, manufacturer); break; @@ -506,7 +506,7 @@ public: auComponent (AudioComponentInstanceGetComponent (au)), audioUnit (au), #if JUCE_MAC - eventListenerRef (0), + eventListenerRef (nullptr), #endif midiConcatenator (2048) { @@ -529,7 +529,7 @@ public: updateSupportedLayouts(); } - ~AudioUnitPluginInstance() + ~AudioUnitPluginInstance() override { const ScopedLock sl (lock); @@ -574,10 +574,10 @@ public: void cleanup() { #if JUCE_MAC - if (eventListenerRef != 0) + if (eventListenerRef != nullptr) { AUListenerDispose (eventListenerRef); - eventListenerRef = 0; + eventListenerRef = nullptr; } #endif @@ -1292,7 +1292,7 @@ public: void getCurrentProgramStateInformation (MemoryBlock& destData) override { - CFPropertyListRef propertyList = 0; + CFPropertyListRef propertyList = nullptr; UInt32 sz = sizeof (CFPropertyListRef); if (AudioUnitGetProperty (audioUnit, @@ -1303,7 +1303,7 @@ public: CFWriteStreamRef stream = CFWriteStreamCreateWithAllocatedBuffers (kCFAllocatorDefault, kCFAllocatorDefault); CFWriteStreamOpen (stream); - CFIndex bytesWritten = CFPropertyListWriteToStream (propertyList, stream, kCFPropertyListBinaryFormat_v1_0, 0); + CFIndex bytesWritten = CFPropertyListWriteToStream (propertyList, stream, kCFPropertyListBinaryFormat_v1_0, nullptr); CFWriteStreamClose (stream); CFDataRef data = (CFDataRef) CFWriteStreamCopyProperty (stream, kCFStreamPropertyDataWritten); @@ -1330,10 +1330,10 @@ public: CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0; CFPropertyListRef propertyList = CFPropertyListCreateFromStream (kCFAllocatorDefault, stream, 0, - kCFPropertyListImmutable, &format, 0); + kCFPropertyListImmutable, &format, nullptr); CFRelease (stream); - if (propertyList != 0) + if (propertyList != nullptr) { AudioUnitSetProperty (audioUnit, kAudioUnitProperty_ClassInfo, kAudioUnitScope_Global, 0, &propertyList, sizeof (propertyList)); @@ -1443,7 +1443,7 @@ public: auto getClumpName = [this, info] { AudioUnitParameterNameInfo clumpNameInfo; - UInt32 sz = sizeof (clumpNameInfo); + UInt32 clumpSz = sizeof (clumpNameInfo); zerostruct (clumpNameInfo); clumpNameInfo.inID = info.clumpID; clumpNameInfo.inDesiredLength = (SInt32) 256; @@ -1453,7 +1453,7 @@ public: kAudioUnitScope_Global, 0, &clumpNameInfo, - &sz) == noErr) + &clumpSz) == noErr) return String::fromCFString (clumpNameInfo.outName); return String (info.clumpID); @@ -1606,11 +1606,11 @@ private: { String lowercaseText (text.toLowerCase()); - for (auto& testText : onStrings) + for (auto& testText : auOnStrings) if (lowercaseText == testText) return 1.0f; - for (auto& testText : offStrings) + for (auto& testText : auOffStrings) if (lowercaseText == testText) return 0.0f; @@ -1628,8 +1628,8 @@ private: String getLabel() const override { return {}; } AudioUnitPluginInstance& parent; - const StringArray onStrings { TRANS("on"), TRANS("yes"), TRANS("true") }; - const StringArray offStrings { TRANS("off"), TRANS("no"), TRANS("false") }; + const StringArray auOnStrings { TRANS("on"), TRANS("yes"), TRANS("true") }; + const StringArray auOffStrings { TRANS("off"), TRANS("no"), TRANS("false") }; const StringArray values { TRANS("Off"), TRANS("On") }; bool currentValue = false; @@ -2262,7 +2262,7 @@ public: createView (createGenericViewIfNeeded); } - ~AudioUnitPluginWindowCocoa() + ~AudioUnitPluginWindowCocoa() override { if (wrapper.getView() != nil) { @@ -2340,7 +2340,7 @@ private: { NSString* viewClassName = (NSString*) (info->mCocoaAUViewClass[0]); CFStringRef path = CFURLCopyPath (info->mCocoaAUViewBundleLocation); - NSString* unescapedPath = (NSString*) CFURLCreateStringByReplacingPercentEscapes (0, path, CFSTR ("")); + NSString* unescapedPath = (NSString*) CFURLCreateStringByReplacingPercentEscapes (nullptr, path, CFSTR ("")); CFRelease (path); NSBundle* viewBundle = [NSBundle bundleWithPath: [unescapedPath autorelease]]; Class viewClass = [viewBundle classNamed: viewClassName]; @@ -2662,7 +2662,7 @@ void AudioUnitPluginFormat::createPluginInstance (const PluginDescription& desc, return; } - if ((auComponent = AudioComponentFindNext (0, &componentDesc)) == nullptr) + if ((auComponent = AudioComponentFindNext (nullptr, &componentDesc)) == nullptr) { callback (userData, nullptr, errMessage); return; @@ -2761,7 +2761,7 @@ bool AudioUnitPluginFormat::requiresUnblockedMessageThreadDuringCreation (const || AudioUnitFormatHelpers::getComponentDescFromFile (desc.fileOrIdentifier, componentDesc, pluginName, version, manufacturer)) { - if (AudioComponent auComp = AudioComponentFindNext (0, &componentDesc)) + if (AudioComponent auComp = AudioComponentFindNext (nullptr, &componentDesc)) if (AudioComponentGetDescription (auComp, &componentDesc) == noErr) return ((componentDesc.componentFlags & kAudioComponentFlag_IsV3AudioUnit) != 0); } diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index fa929df30f..13a22cf3cb 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -53,6 +53,15 @@ #if __has_warning("-Wcomma") #pragma clang diagnostic ignored "-Wcomma" #endif + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif + #if __has_warning("-Winconsistent-missing-destructor-override") + #pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" + #endif + #if __has_warning("-Wcast-align") + #pragma clang diagnostic ignored "-Wcast-align" + #endif #endif #undef DEVELOPMENT diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index d583136895..dd3f711699 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -66,8 +66,17 @@ static int warnOnFailure (int result) noexcept DBG (message); return result; } + +static int warnOnFailureIfImplemented (int result) noexcept +{ + if (result != kResultOk && result != kNotImplemented) + return warnOnFailure (result); + + return result; +} #else #define warnOnFailure(x) x + #define warnOnFailureIfImplemented(x) x #endif //============================================================================== @@ -949,7 +958,7 @@ private: const File file (filePath); const char* const utf8 = file.getFullPathName().toRawUTF8(); - if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, (CFIndex) std::strlen (utf8), file.isDirectory())) + if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (nullptr, (const UInt8*) utf8, (CFIndex) std::strlen (utf8), file.isDirectory())) { bundleRef = CFBundleCreate (kCFAllocatorDefault, url); CFRelease (url); @@ -1131,7 +1140,7 @@ struct VST3PluginWindow : public AudioProcessorEditor, } } - ~VST3PluginWindow() + ~VST3PluginWindow() override { warnOnFailure (view->removed()); warnOnFailure (view->setFrame (nullptr)); @@ -1716,7 +1725,7 @@ public: holder->host->setPlugin (this); } - ~VST3PluginInstance() + ~VST3PluginInstance() override { jassert (getActiveEditor() == nullptr); // You must delete any editors before deleting the plugin instance! @@ -1886,7 +1895,7 @@ public: cachedBusLayouts = getBusesLayout(); warnOnFailure (holder->component->setActive (true)); - warnOnFailure (processor->setProcessing (true)); + warnOnFailureIfImplemented (processor->setProcessing (true)); isActive = true; } @@ -1901,7 +1910,7 @@ public: setStateForAllMidiBuses (false); if (processor != nullptr) - warnOnFailure (processor->setProcessing (false)); + warnOnFailureIfImplemented (processor->setProcessing (false)); if (holder->component != nullptr) warnOnFailure (holder->component->setActive (false)); @@ -2619,7 +2628,7 @@ private: if (holder->component->getState (&stream) == kResultTrue) if (stream.seek (0, Steinberg::IBStream::kIBSeekSet, nullptr) == kResultTrue) - warnOnFailure (editController->setComponentState (&stream)); + warnOnFailureIfImplemented (editController->setComponentState (&stream)); } void grabInformationObjects() diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index f80363ff1c..13e963adea 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -41,7 +41,7 @@ public: VST3PluginFormat(); /** Destructor */ - ~VST3PluginFormat(); + ~VST3PluginFormat() override; //============================================================================== /** Attempts to reload a VST3 plugin's state from some preset file data. diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 687d8f0bb6..5bd3a39fc0 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -36,6 +36,12 @@ #define __cdecl #endif +#if JUCE_CLANG + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif +#endif + #define VST_FORCE_DEPRECATED 0 #define JUCE_VSTINTERFACE_H_INCLUDED 1 @@ -207,7 +213,7 @@ namespace #if JUCE_MAC static bool makeFSRefFromPath (FSRef* destFSRef, const String& path) { - return FSPathMakeRef (reinterpret_cast (path.toRawUTF8()), destFSRef, 0) == noErr; + return FSPathMakeRef (reinterpret_cast (path.toRawUTF8()), destFSRef, nullptr) == noErr; } #endif } @@ -630,7 +636,7 @@ struct ModuleHandle : public ReferenceCountedObject #elif JUCE_MAC FSRef ref; makeFSRefFromPath (&ref, f.getParentDirectory().getFullPathName()); - FSGetCatalogInfo (&ref, kFSCatInfoNone, 0, 0, &parentDirFSSpec, 0); + FSGetCatalogInfo (&ref, kFSCatInfoNone, nullptr, nullptr, &parentDirFSSpec, nullptr); #endif } @@ -730,13 +736,13 @@ struct ModuleHandle : public ReferenceCountedObject { auto* utf8 = file.getFullPathName().toRawUTF8(); - if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*) utf8, + if (CFURLRef url = CFURLCreateFromFileSystemRepresentation (nullptr, (const UInt8*) utf8, (CFIndex) strlen (utf8), file.isDirectory())) { bundleRef = CFBundleCreate (kCFAllocatorDefault, url); CFRelease (url); - if (bundleRef != 0) + if (bundleRef != nullptr) { if (CFBundleLoadExecutable (bundleRef)) { @@ -785,7 +791,7 @@ struct ModuleHandle : public ReferenceCountedObject { CFBundleUnloadExecutable (bundleRef); CFRelease (bundleRef); - bundleRef = 0; + bundleRef = nullptr; } } } @@ -796,7 +802,7 @@ struct ModuleHandle : public ReferenceCountedObject void close() { - if (bundleRef != 0) + if (bundleRef != nullptr) { #if JUCE_MAC CFBundleCloseBundleResourceMap (bundleRef, resFileId); @@ -812,7 +818,7 @@ struct ModuleHandle : public ReferenceCountedObject void closeEffect (Vst2::AEffect* eff) { - eff->dispatcher (eff, Vst2::effClose, 0, 0, 0, 0); + eff->dispatcher (eff, Vst2::effClose, 0, 0, nullptr, 0); } #endif @@ -1006,7 +1012,7 @@ struct VSTPluginInstance : public AudioPluginInstance, Array shortParamNames; float defaultValue = 0; String label; - bool isAutomatable = dispatch (Vst2::effCanBeAutomated, i, 0, 0, 0) != 0; + bool isAutomatable = dispatch (Vst2::effCanBeAutomated, i, 0, nullptr, 0) != 0; bool isDiscrete = false; int numSteps = AudioProcessor::getDefaultNumParameterSteps(); bool isBoolSwitch = false; @@ -1081,7 +1087,7 @@ struct VSTPluginInstance : public AudioPluginInstance, setRateAndBufferSizeDetails (sampleRateToUse, blockSizeToUse); } - ~VSTPluginInstance() + ~VSTPluginInstance() override { if (vstEffect != nullptr && vstEffect->magic == 0x56737450 /* 'VstP' */) { @@ -1143,14 +1149,14 @@ struct VSTPluginInstance : public AudioPluginInstance, { newEffect->resvd2 = 0; - newEffect->dispatcher (newEffect, Vst2::effIdentify, 0, 0, 0, 0); + newEffect->dispatcher (newEffect, Vst2::effIdentify, 0, 0, nullptr, 0); auto blockSize = jmax (32, initialBlockSize); - newEffect->dispatcher (newEffect, Vst2::effSetSampleRate, 0, 0, 0, static_cast (initialSampleRate)); - newEffect->dispatcher (newEffect, Vst2::effSetBlockSize, 0, blockSize, 0, 0); + newEffect->dispatcher (newEffect, Vst2::effSetSampleRate, 0, 0, nullptr, static_cast (initialSampleRate)); + newEffect->dispatcher (newEffect, Vst2::effSetBlockSize, 0, blockSize, nullptr, 0); - newEffect->dispatcher (newEffect, Vst2::effOpen, 0, 0, 0, 0); + newEffect->dispatcher (newEffect, Vst2::effOpen, 0, 0, nullptr, 0); BusesProperties ioConfig = queryBusIO (newEffect); return new VSTPluginInstance (newModule, ioConfig, newEffect, initialSampleRate, blockSize); @@ -1223,25 +1229,25 @@ struct VSTPluginInstance : public AudioPluginInstance, setRateAndBufferSizeDetails (initialSampleRate, initialBlockSize); - dispatch (Vst2::effIdentify, 0, 0, 0, 0); + dispatch (Vst2::effIdentify, 0, 0, nullptr, 0); if (getSampleRate() > 0) - dispatch (Vst2::effSetSampleRate, 0, 0, 0, (float) getSampleRate()); + dispatch (Vst2::effSetSampleRate, 0, 0, nullptr, (float) getSampleRate()); if (getBlockSize() > 0) - dispatch (Vst2::effSetBlockSize, 0, jmax (32, getBlockSize()), 0, 0); + dispatch (Vst2::effSetBlockSize, 0, jmax (32, getBlockSize()), nullptr, 0); - dispatch (Vst2::effOpen, 0, 0, 0, 0); + dispatch (Vst2::effOpen, 0, 0, nullptr, 0); setRateAndBufferSizeDetails (getSampleRate(), getBlockSize()); if (getNumPrograms() > 1) setCurrentProgram (0); else - dispatch (Vst2::effSetProgram, 0, 0, 0, 0); + dispatch (Vst2::effSetProgram, 0, 0, nullptr, 0); - for (int i = vstEffect->numInputs; --i >= 0;) dispatch (Vst2::effConnectInput, i, 1, 0, 0); - for (int i = vstEffect->numOutputs; --i >= 0;) dispatch (Vst2::effConnectOutput, i, 1, 0, 0); + for (int i = vstEffect->numInputs; --i >= 0;) dispatch (Vst2::effConnectInput, i, 1, nullptr, 0); + for (int i = vstEffect->numOutputs; --i >= 0;) dispatch (Vst2::effConnectOutput, i, 1, nullptr, 0); if (getVstCategory() != Vst2::kPlugCategShell) // (workaround for Waves 5 plugins which crash during this call) updateStoredProgramNames(); @@ -1293,7 +1299,7 @@ struct VSTPluginInstance : public AudioPluginInstance, if ((vstEffect->flags & Vst2::effFlagsNoSoundInStop) != 0) return 0.0; - auto tailSize = dispatch (Vst2::effGetTailSize, 0, 0, 0, 0); + auto tailSize = dispatch (Vst2::effGetTailSize, 0, 0, nullptr, 0); auto sampleRate = getSampleRate(); // remain backward compatible with old JUCE plug-ins: anything larger @@ -1313,7 +1319,7 @@ struct VSTPluginInstance : public AudioPluginInstance, bool producesMidi() const override { return pluginCanDo ("sendVstMidiEvent") > 0; } bool supportsMPE() const override { return pluginCanDo ("MPE") > 0; } - Vst2::VstPlugCategory getVstCategory() const noexcept { return (Vst2::VstPlugCategory) dispatch (Vst2::effGetPlugCategory, 0, 0, 0, 0); } + Vst2::VstPlugCategory getVstCategory() const noexcept { return (Vst2::VstPlugCategory) dispatch (Vst2::effGetPlugCategory, 0, 0, nullptr, 0); } int pluginCanDo (const char* text) const { return (int) dispatch (Vst2::effCanDo, 0, 0, (void*) text, 0); } @@ -1355,15 +1361,15 @@ struct VSTPluginInstance : public AudioPluginInstance, incomingMidi.clear(); - dispatch (Vst2::effSetSampleRate, 0, 0, 0, (float) rate); - dispatch (Vst2::effSetBlockSize, 0, jmax (16, samplesPerBlockExpected), 0, 0); + dispatch (Vst2::effSetSampleRate, 0, 0, nullptr, (float) rate); + dispatch (Vst2::effSetBlockSize, 0, jmax (16, samplesPerBlockExpected), nullptr, 0); if (supportsDoublePrecisionProcessing()) { int32 vstPrecision = isUsingDoublePrecision() ? Vst2::kVstProcessPrecision64 : Vst2::kVstProcessPrecision32; - dispatch (Vst2::effSetProcessPrecision, 0, (pointer_sized_int) vstPrecision, 0, 0); + dispatch (Vst2::effSetProcessPrecision, 0, (pointer_sized_int) vstPrecision, nullptr, 0); } auto maxChannels = jmax (1, jmax (vstEffect->numInputs, vstEffect->numOutputs)); @@ -1390,7 +1396,7 @@ struct VSTPluginInstance : public AudioPluginInstance, } } - dispatch (Vst2::effStartProcess, 0, 0, 0, 0); + dispatch (Vst2::effStartProcess, 0, 0, nullptr, 0); setLatencySamples (vstEffect->initialDelay); } @@ -1400,7 +1406,7 @@ struct VSTPluginInstance : public AudioPluginInstance, { if (initialised) { - dispatch (Vst2::effStopProcess, 0, 0, 0, 0); + dispatch (Vst2::effStopProcess, 0, 0, nullptr, 0); setPower (false); } @@ -1544,12 +1550,12 @@ struct VSTPluginInstance : public AudioPluginInstance, int getNumPrograms() override { return vstEffect != nullptr ? jmax (0, vstEffect->numPrograms) : 0; } // NB: some plugs return negative numbers from this function. - int getCurrentProgram() override { return (int) dispatch (Vst2::effGetProgram, 0, 0, 0, 0); } + int getCurrentProgram() override { return (int) dispatch (Vst2::effGetProgram, 0, 0, nullptr, 0); } void setCurrentProgram (int newIndex) override { if (getNumPrograms() > 0 && newIndex != getCurrentProgram()) - dispatch (Vst2::effSetProgram, 0, jlimit (0, getNumPrograms() - 1, newIndex), 0, 0); + dispatch (Vst2::effSetProgram, 0, jlimit (0, getNumPrograms() - 1, newIndex), nullptr, 0); } const String getProgramName (int index) override @@ -1594,7 +1600,7 @@ struct VSTPluginInstance : public AudioPluginInstance, //============================================================================== void timerCallback() override { - if (dispatch (Vst2::effIdle, 0, 0, 0, 0) == 0) + if (dispatch (Vst2::effIdle, 0, 0, nullptr, 0) == 0) stopTimer(); } @@ -1979,8 +1985,8 @@ private: { VST2BypassParameter (VSTPluginInstance& effectToUse) : parent (effectToUse), - onStrings (TRANS("on"), TRANS("yes"), TRANS("true")), - offStrings (TRANS("off"), TRANS("no"), TRANS("false")), + vstOnStrings (TRANS("on"), TRANS("yes"), TRANS("true")), + vstOffStrings (TRANS("off"), TRANS("no"), TRANS("false")), values (TRANS("Off"), TRANS("On")) { } @@ -1997,11 +2003,11 @@ private: { String lowercaseText (text.toLowerCase()); - for (auto& testText : onStrings) + for (auto& testText : vstOnStrings) if (lowercaseText == testText) return 1.0f; - for (auto& testText : offStrings) + for (auto& testText : vstOffStrings) if (lowercaseText == testText) return 0.0f; @@ -2021,7 +2027,7 @@ private: VSTPluginInstance& parent; bool currentValue = false; - StringArray onStrings, offStrings, values; + StringArray vstOnStrings, vstOffStrings, values; }; //============================================================================== @@ -2098,7 +2104,7 @@ private: #if JUCE_MAC if (getActiveEditor() != nullptr) - dispatch (Vst2::effEditIdle, 0, 0, 0, 0); + dispatch (Vst2::effEditIdle, 0, 0, nullptr, 0); #endif Timer::callPendingTimersSynchronously(); @@ -2629,7 +2635,7 @@ private: String getVersion() const { - auto v = (unsigned int) dispatch (Vst2::effGetVendorVersion, 0, 0, 0, 0); + auto v = (unsigned int) dispatch (Vst2::effGetVendorVersion, 0, 0, nullptr, 0); String s; @@ -2702,7 +2708,7 @@ private: void setPower (const bool on) { - dispatch (Vst2::effMainsChanged, 0, on ? 1 : 0, 0, 0); + dispatch (Vst2::effMainsChanged, 0, on ? 1 : 0, nullptr, 0); isPowerOn = on; } @@ -2775,7 +2781,7 @@ public: setVisible (true); } - ~VSTPluginWindow() + ~VSTPluginWindow() override { closePluginWindow(); @@ -2958,7 +2964,7 @@ public: if (! reentrantGuard) { reentrantGuard = true; - plugin.dispatch (Vst2::effEditIdle, 0, 0, 0, 0); + plugin.dispatch (Vst2::effEditIdle, 0, 0, nullptr, 0); reentrantGuard = false; } @@ -2990,7 +2996,7 @@ public: activeVSTWindows.add (this); #if JUCE_MAC - dispatch (Vst2::effEditTop, 0, 0, 0, 0); + dispatch (Vst2::effEditTop, 0, 0, nullptr, 0); #endif } @@ -3034,7 +3040,7 @@ private: #if JUCE_MAC void openPluginWindow (void* parentWindow) { - if (isOpen || parentWindow == 0) + if (isOpen || parentWindow == nullptr) return; isOpen = true; @@ -3045,10 +3051,10 @@ private: // do this before and after like in the steinberg example dispatch (Vst2::effEditGetRect, 0, 0, &rect, 0); - dispatch (Vst2::effGetProgram, 0, 0, 0, 0); // also in steinberg code + dispatch (Vst2::effGetProgram, 0, 0, nullptr, 0); // also in steinberg code // Install keyboard hooks - pluginWantsKeys = (dispatch (Vst2::effKeysRequired, 0, 0, 0, 0) == 0); + pluginWantsKeys = (dispatch (Vst2::effKeysRequired, 0, 0, nullptr, 0) == 0); // double-check it's not too tiny int w = 250, h = 150; @@ -3224,7 +3230,7 @@ private: JUCE_VST_LOG ("Closing VST UI: " + plugin.getName()); isOpen = false; - dispatch (Vst2::effEditClose, 0, 0, 0, 0); + dispatch (Vst2::effEditClose, 0, 0, nullptr, 0); stopTimer(); #if JUCE_WINDOWS @@ -3513,7 +3519,7 @@ void VSTPluginFormat::findAllTypesForFile (OwnedArray& result // Normal plugin... results.add (new PluginDescription (desc)); - instance->dispatch (Vst2::effOpen, 0, 0, 0, 0); + instance->dispatch (Vst2::effOpen, 0, 0, nullptr, 0); } else { diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h index 2c6684c869..20f5fe20d8 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h @@ -40,7 +40,7 @@ class JUCE_API VSTPluginFormat : public AudioPluginFormat public: //============================================================================== VSTPluginFormat(); - ~VSTPluginFormat(); + ~VSTPluginFormat() override; //============================================================================== /** Attempts to retrieve the VSTXML data from a plugin. diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 8c2b863fc8..61bda3c6ac 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -133,6 +133,9 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone #if JUCE_CLANG #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #if __has_warning("-Wcast-align") + #pragma clang diagnostic ignored "-Wcast-align" + #endif #endif #include "format/juce_AudioPluginFormat.cpp" diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 797207633f..0730ba1201 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -692,7 +692,7 @@ public: DelegateClass::setState (delegate, this); } - ~URLConnectionState() + ~URLConnectionState() override { stop(); diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index e41a6b471f..9b22cfd022 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -85,7 +85,7 @@ public: nativeContext.reset(); } - ~CachedImage() + ~CachedImage() override { stop(); } @@ -671,7 +671,7 @@ public: attach(); } - ~Attachment() + ~Attachment() override { detach(); } From 1774052b61c47ee705df62d51bfa5f45e97befcb Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Mon, 11 Mar 2019 11:23:19 +0000 Subject: [PATCH 13/20] MacOS: Removed the "update to latest version" Xcode warning --- .../Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index 2a836f3bbb..dbecd1e7dc 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -3388,7 +3388,7 @@ private: { String attributes; - attributes << "{ LastUpgradeCheck = 0930; " + attributes << "{ LastUpgradeCheck = 1010; " << "ORGANIZATIONNAME = " << getProject().getCompanyNameString().quoted() <<"; "; From dc16992968d7015a1901117f91c52e12400bac3f Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Wed, 20 Mar 2019 11:46:36 +0000 Subject: [PATCH 14/20] AAX: Fixed a bug setting the number of parameter steps --- modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 8a871f33df..c4ea1a72bc 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -1475,7 +1475,7 @@ namespace AAXClasses // parameter steps. static int32_t getSafeNumberOfParameterSteps (const AudioProcessorParameter& param) { - return jmax (param.getNumSteps(), 2048); + return jmin (param.getNumSteps(), 2048); } void addAudioProcessorParameters() From ce6339f33262fb9a342d904fc66d60bb4a51e3c1 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 21 Mar 2019 17:50:11 +0000 Subject: [PATCH 15/20] Added a trailing decimal when serialising integer valued doubles --- modules/juce_core/javascript/juce_JSON.cpp | 10 ++--- modules/juce_core/text/juce_String.cpp | 42 +++++++++++-------- modules/juce_core/xml/juce_XmlElement.cpp | 10 ++--- .../values/juce_ValueTree.cpp | 10 ++--- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/modules/juce_core/javascript/juce_JSON.cpp b/modules/juce_core/javascript/juce_JSON.cpp index 020c74edc3..7e8d221f0c 100644 --- a/modules/juce_core/javascript/juce_JSON.cpp +++ b/modules/juce_core/javascript/juce_JSON.cpp @@ -660,20 +660,20 @@ public: beginTest ("Float formatting"); std::map tests; - tests[1] = "1"; + tests[1] = "1.0"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; tests[0.76378] = "0.76378"; - tests[-10] = "-10"; + tests[-10] = "-10.0"; tests[10.01] = "10.01"; tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; - tests[1e+40] = "1e40"; + tests[1e+40] = "1.0e40"; tests[-12345678901234567.0] = "-1.234567890123457e16"; - tests[192000] = "192000"; + tests[192000] = "192000.0"; tests[1234567] = "1.234567e6"; tests[0.00006] = "0.00006"; - tests[0.000006] = "6e-6"; + tests[0.000006] = "6.0e-6"; for (auto& test : tests) expectEquals (JSON::toString (test.first), test.second); diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index c334f2a93e..416c39ff1c 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -2187,7 +2187,7 @@ StringRef::StringRef (const std::string& string) : StringRef (string.c_str //============================================================================== -static String minimiseLengthOfFloatString (const String& input) +static String reduceLengthOfFloatString (const String& input) { const auto start = input.getCharPointer(); const auto end = start + (int) input.length(); @@ -2208,8 +2208,8 @@ static String minimiseLengthOfFloatString (const String& input) } else if (currentChar == '.') { - if (trimStart == c + 1) - --trimStart; + if (trimStart == c + 1 && trimStart != end && *trimStart == '0') + ++trimStart; break; } @@ -2263,12 +2263,12 @@ static String serialiseDouble (double input) auto absInput = std::abs (input); if (absInput >= 1.0e6 || absInput <= 1.0e-5) - return minimiseLengthOfFloatString ({ input, 15, true }); + return reduceLengthOfFloatString ({ input, 15, true }); int intInput = (int) input; if ((double) intInput == input) - return minimiseLengthOfFloatString ({ input, 1 }); + return { input, 1 }; auto numberOfDecimalPlaces = [absInput] { @@ -2297,7 +2297,7 @@ static String serialiseDouble (double input) return 10; }(); - return minimiseLengthOfFloatString (String (input, numberOfDecimalPlaces)); + return reduceLengthOfFloatString (String (input, numberOfDecimalPlaces)); } //============================================================================== @@ -2836,13 +2836,14 @@ public: { StringPairArray tests; tests.set ("1", "1"); + tests.set ("1.0", "1.0"); tests.set ("-1", "-1"); tests.set ("-100", "-100"); tests.set ("110", "110"); tests.set ("9090", "9090"); - tests.set ("1000.0", "1000"); - tests.set ("1.0", "1"); - tests.set ("-1.00", "-1"); + tests.set ("1000.0", "1000.0"); + tests.set ("1.0", "1.0"); + tests.set ("-1.00", "-1.0"); tests.set ("1.20", "1.2"); tests.set ("1.300", "1.3"); tests.set ("1.301", "1.301"); @@ -2857,7 +2858,7 @@ public: tests.set ("-1e-000", "-1"); tests.set ("1e100", "1e100"); tests.set ("100e100", "100e100"); - tests.set ("100.0e0100", "100e100"); + tests.set ("100.0e0100", "100.0e100"); tests.set ("-1e1", "-1e1"); tests.set ("1e10", "1e10"); tests.set ("-1e+10", "-1e10"); @@ -2865,32 +2866,32 @@ public: tests.set ("1e0010", "1e10"); tests.set ("1e-0010", "1e-10"); tests.set ("1e-1", "1e-1"); - tests.set ("-1.0e1", "-1e1"); - tests.set ("1.0e-1", "1e-1"); - tests.set ("1.00e-1", "1e-1"); + tests.set ("-1.0e1", "-1.0e1"); + tests.set ("1.0e-1", "1.0e-1"); + tests.set ("1.00e-1", "1.0e-1"); tests.set ("1.001e1", "1.001e1"); tests.set ("1.010e+1", "1.01e1"); tests.set ("-1.1000e1", "-1.1e1"); for (auto& input : tests.getAllKeys()) - expectEquals (minimiseLengthOfFloatString (input), tests[input]); + expectEquals (reduceLengthOfFloatString (input), tests[input]); } { std::map tests; - tests[1] = "1"; + tests[1] = "1.0"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; tests[0.76378] = "7.6378e-1"; - tests[-10] = "-1e1"; + tests[-10] = "-1.0e1"; tests[10.01] = "1.001e1"; tests[10691.01] = "1.069101e4"; tests[0.0123] = "1.23e-2"; tests[-3.7e-27] = "-3.7e-27"; - tests[1e+40] = "1e40"; + tests[1e+40] = "1.0e40"; for (auto& test : tests) - expectEquals (minimiseLengthOfFloatString (String (test.first, 15, true)), test.second); + expectEquals (reduceLengthOfFloatString (String (test.first, 15, true)), test.second); } } @@ -2898,6 +2899,11 @@ public: beginTest ("Serialisation"); std::map tests; + + tests[364] = "364.0"; + tests[1e7] = "1.0e7"; + tests[12345678901] = "1.2345678901e10"; + tests[1234567890123456.7] = "1.234567890123457e15"; tests[12345678.901234567] = "1.234567890123457e7"; tests[1234567.8901234567] = "1.234567890123457e6"; diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index ff46dcf8ff..91f6479c55 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -942,20 +942,20 @@ public: Identifier number ("number"); std::map tests; - tests[1] = "1"; + tests[1] = "1.0"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; tests[0.76378] = "0.76378"; - tests[-10] = "-10"; + tests[-10] = "-10.0"; tests[10.01] = "10.01"; tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; - tests[1e+40] = "1e40"; + tests[1e+40] = "1.0e40"; tests[-12345678901234567.0] = "-1.234567890123457e16"; - tests[192000] = "192000"; + tests[192000] = "192000.0"; tests[1234567] = "1.234567e6"; tests[0.00006] = "0.00006"; - tests[0.000006] = "6e-6"; + tests[0.000006] = "6.0e-6"; for (auto& test : tests) { diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 5f43a5d0a1..91c9eb5e52 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -1195,20 +1195,20 @@ public: Identifier number ("number"); std::map tests; - tests[1] = "1"; + tests[1] = "1.0"; tests[1.1] = "1.1"; tests[1.01] = "1.01"; tests[0.76378] = "0.76378"; - tests[-10] = "-10"; + tests[-10] = "-10.0"; tests[10.01] = "10.01"; tests[0.0123] = "0.0123"; tests[-3.7e-27] = "-3.7e-27"; - tests[1e+40] = "1e40"; + tests[1e+40] = "1.0e40"; tests[-12345678901234567.0] = "-1.234567890123457e16"; - tests[192000] = "192000"; + tests[192000] = "192000.0"; tests[1234567] = "1.234567e6"; tests[0.00006] = "0.00006"; - tests[0.000006] = "6e-6"; + tests[0.000006] = "6.0e-6"; for (auto& test : tests) { From 49c631e916a9f0c747348e6fcd092dc6283e0fe9 Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 26 Mar 2019 11:37:09 +0000 Subject: [PATCH 16/20] Fixed a crash in Mac Network when createConnection fails --- modules/juce_core/native/juce_mac_Network.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 0730ba1201..ebba5b88d5 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -965,6 +965,9 @@ public: createConnection(); } + if (connection == nullptr) + return false; + if (! connection->start (owner, webInputListener)) { // Workaround for deployment targets below 10.10 where HTTPS POST requests with keep-alive fail with the NSURLErrorNetworkConnectionLost error code. @@ -980,7 +983,7 @@ public: return false; } - if (connection != nullptr && connection->headers != nil) + if (connection->headers != nil) { statusCode = connection->statusCode; From cabcbde0e2ed17cb98299f04b91f7af19f86b6f5 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Tue, 21 May 2019 13:09:55 +0100 Subject: [PATCH 17/20] Fixed a bug maintaining compatibility with audio parameters using old param IDs --- .../format_types/juce_LegacyAudioParameter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp b/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp index 65500f29f0..5eb8129201 100644 --- a/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp +++ b/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp @@ -161,7 +161,7 @@ public: String getParamID (AudioProcessor& processor, int idx) const noexcept { if (usingManagedParameters && ! legacyParamIDs) - processor.getParameterID (idx); + return processor.getParameterID (idx); return String (idx); } From 7ffcd5e5f4967d2f0546dfbf7b026e466f1ca7d3 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 8 Apr 2019 09:57:12 +0100 Subject: [PATCH 18/20] Recalculate the release rate of the ADSR envelope if it was modified in ADSR::noteOff() --- modules/juce_audio_basics/utilities/juce_ADSR.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_basics/utilities/juce_ADSR.h b/modules/juce_audio_basics/utilities/juce_ADSR.h index 481782edda..2a0788b885 100644 --- a/modules/juce_audio_basics/utilities/juce_ADSR.h +++ b/modules/juce_audio_basics/utilities/juce_ADSR.h @@ -102,6 +102,12 @@ public: { envelopeVal = 0.0f; currentState = State::idle; + + if (resetReleaseRate) + { + releaseRate = static_cast (sustainLevel / (currentParameters.release * sr)); + resetReleaseRate = false; + } } /** Starts the attack phase of the envelope. */ @@ -120,7 +126,10 @@ public: if (releaseRate > 0.0f) { if (currentState != State::sustain) + { releaseRate = static_cast (envelopeVal / (currentParameters.release * sr)); + resetReleaseRate = true; + } currentState = State::release; } @@ -229,11 +238,8 @@ private: Parameters currentParameters; double sr = 0.0; - - float envelopeVal = 0.0f; - - float sustainLevel = 0.0f; - float attackRate = 0.0f, decayRate = 0.0f, releaseRate = 0.0f; + float envelopeVal = 0.0f, sustainLevel = 0.0f, attackRate = 0.0f, decayRate = 0.0f, releaseRate = 0.0f; + bool resetReleaseRate = false; }; } // namespace juce From dd9802e265fc9e90f8bd7b2bc3a7160b69111508 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 7 May 2019 10:25:41 +0100 Subject: [PATCH 19/20] ADSR: Set the envelope value to 1 when calling noteOn() with an attack rate of 0 --- modules/juce_audio_basics/utilities/juce_ADSR.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_basics/utilities/juce_ADSR.h b/modules/juce_audio_basics/utilities/juce_ADSR.h index 2a0788b885..6de3e8dae1 100644 --- a/modules/juce_audio_basics/utilities/juce_ADSR.h +++ b/modules/juce_audio_basics/utilities/juce_ADSR.h @@ -113,9 +113,19 @@ public: /** Starts the attack phase of the envelope. */ void noteOn() { - if (attackRate > 0.0f) currentState = State::attack; - else if (decayRate > 0.0f) currentState = State::decay; - else currentState = State::sustain; + if (attackRate > 0.0f) + { + currentState = State::attack; + } + else if (decayRate > 0.0f) + { + envelopeVal = 1.0f; + currentState = State::decay; + } + else + { + currentState = State::sustain; + } } /** Starts the release phase of the envelope. */ From b2289888748eee8ce00e41c92716f63e3307e6c2 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Tue, 11 Jun 2019 16:57:31 +0100 Subject: [PATCH 20/20] Added GitLab CI config --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..e91a6b175c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +include: + - project: 'juce-repos/JUCE-utils' + file: '/CI/gitlab-ci.yml' +