Browse Source

Update juce

tags/2018-04-16
falkTX 6 years ago
parent
commit
365ca740f5
69 changed files with 1031 additions and 634 deletions
  1. +13
    -0
      libs/juce/patches/fix-distrho-juceplugin-includes.patch
  2. +14
    -0
      libs/juce/patches/mingw-fixes_pt3.patch
  3. +132
    -0
      libs/juce/patches/silence-warnings.patch
  4. +8
    -8
      libs/juce/source/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp
  5. +32
    -62
      libs/juce/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp
  6. +5
    -5
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp
  7. +8
    -8
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  8. +12
    -1
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  9. +11
    -1
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h
  10. +2
    -2
      libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp
  11. +3
    -12
      libs/juce/source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp
  12. +5
    -0
      libs/juce/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
  13. +6
    -0
      libs/juce/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
  14. +1
    -1
      libs/juce/source/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  15. +2
    -5
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  16. +5
    -1
      libs/juce/source/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h
  17. +31
    -10
      libs/juce/source/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp
  18. +31
    -12
      libs/juce/source/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm
  19. +2
    -1
      libs/juce/source/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp
  20. +2
    -1
      libs/juce/source/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm
  21. +2
    -1
      libs/juce/source/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp
  22. +0
    -6
      libs/juce/source/modules/juce_core/maths/juce_BigInteger.h
  23. +15
    -22
      libs/juce/source/modules/juce_core/maths/juce_MathsFunctions.h
  24. +29
    -0
      libs/juce/source/modules/juce_core/memory/juce_WeakReference.h
  25. +18
    -0
      libs/juce/source/modules/juce_core/native/java/JuceAppActivity.java
  26. +1
    -1
      libs/juce/source/modules/juce_core/native/juce_android_SystemStats.cpp
  27. +2
    -2
      libs/juce/source/modules/juce_core/native/juce_linux_Files.cpp
  28. +71
    -0
      libs/juce/source/modules/juce_core/native/juce_osx_ObjCHelpers.h
  29. +2
    -0
      libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h
  30. +26
    -28
      libs/juce/source/modules/juce_core/network/juce_URL.cpp
  31. +12
    -24
      libs/juce/source/modules/juce_core/network/juce_URL.h
  32. +0
    -5
      libs/juce/source/modules/juce_core/system/juce_StandardHeader.h
  33. +3
    -2
      libs/juce/source/modules/juce_core/text/juce_CharacterFunctions.cpp
  34. +138
    -22
      libs/juce/source/modules/juce_core/text/juce_CharacterFunctions.h
  35. +1
    -1
      libs/juce/source/modules/juce_core/xml/juce_XmlElement.cpp
  36. +1
    -1
      libs/juce/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
  37. +6
    -1
      libs/juce/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
  38. +0
    -2
      libs/juce/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp
  39. +1
    -3
      libs/juce/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h
  40. +6
    -12
      libs/juce/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp
  41. +3
    -4
      libs/juce/source/modules/juce_events/interprocess/juce_InterprocessConnection.h
  42. +2
    -2
      libs/juce/source/modules/juce_graphics/fonts/juce_CustomTypeface.cpp
  43. +24
    -22
      libs/juce/source/modules/juce_graphics/fonts/juce_TextLayout.cpp
  44. +1
    -1
      libs/juce/source/modules/juce_graphics/geometry/juce_EdgeTable.cpp
  45. +1
    -1
      libs/juce/source/modules/juce_graphics/geometry/juce_EdgeTable.h
  46. +2
    -8
      libs/juce/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp
  47. +1
    -3
      libs/juce/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h
  48. +1
    -8
      libs/juce/source/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp
  49. +0
    -2
      libs/juce/source/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.cpp
  50. +2
    -4
      libs/juce/source/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h
  51. +2
    -0
      libs/juce/source/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  52. +1
    -1
      libs/juce/source/modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  53. +140
    -69
      libs/juce/source/modules/juce_gui_basics/native/juce_mac_MainMenu.mm
  54. +2
    -2
      libs/juce/source/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  55. +2
    -2
      libs/juce/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  56. +59
    -89
      libs/juce/source/modules/juce_gui_basics/windows/juce_AlertWindow.cpp
  57. +2
    -2
      libs/juce/source/modules/juce_gui_basics/windows/juce_AlertWindow.h
  58. +26
    -25
      libs/juce/source/modules/juce_gui_basics/windows/juce_CallOutBox.cpp
  59. +4
    -4
      libs/juce/source/modules/juce_gui_basics/windows/juce_CallOutBox.h
  60. +3
    -11
      libs/juce/source/modules/juce_gui_basics/windows/juce_DialogWindow.cpp
  61. +6
    -6
      libs/juce/source/modules/juce_gui_basics/windows/juce_DialogWindow.h
  62. +27
    -33
      libs/juce/source/modules/juce_gui_basics/windows/juce_DocumentWindow.cpp
  63. +3
    -3
      libs/juce/source/modules/juce_gui_basics/windows/juce_DocumentWindow.h
  64. +25
    -27
      libs/juce/source/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp
  65. +17
    -26
      libs/juce/source/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp
  66. +1
    -1
      libs/juce/source/modules/juce_gui_basics/windows/juce_TopLevelWindow.h
  67. +2
    -2
      libs/juce/source/modules/juce_gui_extra/code_editor/juce_CPlusPlusCodeTokeniser.cpp
  68. +6
    -6
      libs/juce/source/modules/juce_gui_extra/code_editor/juce_LuaCodeTokeniser.cpp
  69. +7
    -7
      libs/juce/source/modules/juce_gui_extra/code_editor/juce_XMLCodeTokeniser.cpp

+ 13
- 0
libs/juce/patches/fix-distrho-juceplugin-includes.patch View File

@@ -0,0 +1,13 @@
diff --git a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h
index 701c4df..0e8a324 100644
--- a/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h
+++ b/modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h
@@ -24,6 +24,8 @@
==============================================================================
*/
+#pragma once
+
#include "../juce_audio_plugin_client.h"
namespace juce

+ 14
- 0
libs/juce/patches/mingw-fixes_pt3.patch View File

@@ -0,0 +1,14 @@
diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
index 172e348..2a33c4f 100644
--- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
+++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
@@ -56,9 +56,6 @@ using namespace Vst2;
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
-
- extern "C" void _fpreset();
- extern "C" void _clearfp();
#elif ! JUCE_WINDOWS
static void _fpreset() {}
static void _clearfp() {}

+ 132
- 0
libs/juce/patches/silence-warnings.patch View File

@@ -0,0 +1,132 @@
diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
index 05c3c44..2f03506 100644
--- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
+++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp
@@ -117,6 +117,9 @@ namespace FlacNamespace
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated-register"
+ #elif JUCE_GCC && (__GNUC__ >= 7)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#if JUCE_INTEL
@@ -157,6 +160,8 @@ namespace FlacNamespace
#if JUCE_CLANG
#pragma clang diagnostic pop
+ #elif JUCE_GCC && (__GNUC__ >= 7)
+ #pragma GCC diagnostic pop
#endif
}
diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
index 0a2737b..e2ebd13 100644
--- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
+++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp
@@ -47,6 +47,12 @@ namespace OggVorbisNamespace
#elif JUCE_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
+ #if (__GNUC__ >= 6)
+ #pragma GCC diagnostic ignored "-Wmisleading-indentation"
+ #if (__GNUC__ >= 7)
+ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+ #endif
+ #endif
#endif
#include "oggvorbis/vorbisenc.h"
diff --git a/modules/juce_core/native/juce_linux_Files.cpp b/modules/juce_core/native/juce_linux_Files.cpp
index d022175..1edbfe8 100644
--- a/modules/juce_core/native/juce_linux_Files.cpp
+++ b/modules/juce_core/native/juce_linux_Files.cpp
@@ -136,14 +136,14 @@ File File::getSpecialLocation (const SpecialLocationType type)
case invokedExecutableFile:
if (juce_argv != nullptr && juce_argc > 0)
return File (CharPointer_UTF8 (juce_argv[0]));
- // deliberate fall-through...
+ // fall-through
case currentExecutableFile:
case currentApplicationFile:
#if ! JUCE_STANDALONE_APPLICATION
return juce_getExecutableFile();
#endif
- // deliberate fall-through if this is not a shared-library
+ // fall-through
case hostApplicationPath:
{
diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h
index 67c884a..100d41a 100644
--- a/modules/juce_core/native/juce_posix_SharedCode.h
+++ b/modules/juce_core/native/juce_posix_SharedCode.h
@@ -1205,6 +1205,8 @@ public:
close (pipeHandles[1]); // close the write handle
}
}
+
+ ignoreUnused (streamFlags);
}
~ActiveProcess()
diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp
index b04e307..5c86674 100644
--- a/modules/juce_core/xml/juce_XmlElement.cpp
+++ b/modules/juce_core/xml/juce_XmlElement.cpp
@@ -241,7 +241,7 @@ namespace XmlOutputFunctions
outputStream << (char) character;
break;
}
- // Note: deliberate fall-through here!
+ // fall-through
default:
outputStream << "&#" << ((int) character) << ';';
break;
diff --git a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
index df64f23..45087c6 100644
--- a/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
+++ b/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp
@@ -92,7 +92,7 @@ private:
{
case Z_STREAM_END:
finished = true;
- // Deliberate fall-through..
+ // fall-through..
case Z_OK:
{
data += dataSize - stream.avail_in;
diff --git a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
index 0bae4d3..bd33e93 100644
--- a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
+++ b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp
@@ -39,6 +39,9 @@ namespace zlibNamespace
#if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma"
#endif
+ #elif JUCE_GCC && (__GNUC__ >= 7)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#undef OS_CODE
@@ -74,6 +77,8 @@ namespace zlibNamespace
#if JUCE_CLANG
#pragma clang diagnostic pop
+ #elif JUCE_GCC && (__GNUC__ >= 7)
+ #pragma GCC diagnostic pop
#endif
#else
#include JUCE_ZLIB_INCLUDE_PATH
@@ -136,7 +141,7 @@ public:
{
case Z_STREAM_END:
finished = true;
- // deliberate fall-through
+ // fall-through
case Z_OK:
data += dataSize - stream.avail_in;
dataSize = (z_uInt) stream.avail_in;

+ 8
- 8
libs/juce/source/modules/juce_audio_basics/effects/juce_CatmullRomInterpolator.cpp View File

@@ -27,13 +27,13 @@ struct CatmullRomAlgorithm
{
static forcedinline float valueAtOffset (const float* const inputs, const float offset) noexcept
{
const float y0 = inputs[3];
const float y1 = inputs[2];
const float y2 = inputs[1];
const float y3 = inputs[0];
auto y0 = inputs[3];
auto y1 = inputs[2];
auto y2 = inputs[1];
auto y3 = inputs[0];
const float halfY0 = 0.5f * y0;
const float halfY3 = 0.5f * y3;
auto halfY0 = 0.5f * y0;
auto halfY3 = 0.5f * y3;
return y1 + offset * ((0.5f * y2 - halfY0)
+ (offset * (((y0 + 2.0f * y2) - (halfY3 + 2.5f * y1))
@@ -48,8 +48,8 @@ void CatmullRomInterpolator::reset() noexcept
{
subSamplePos = 1.0;
for (int i = 0; i < numElementsInArray (lastInputSamples); ++i)
lastInputSamples[i] = 0;
for (auto& s : lastInputSamples)
s = 0;
}
int CatmullRomInterpolator::process (double actualRatio, const float* in, float* out, int numOut) noexcept


+ 32
- 62
libs/juce/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp View File

@@ -49,97 +49,67 @@ namespace
}
template <typename InterpolatorType>
static int interpolate (float* lastInputSamples, double& subSamplePos, const double actualRatio,
const float* in, float* out, const int numOut) noexcept
static int interpolate (float* lastInputSamples, double& subSamplePos, double actualRatio,
const float* in, float* out, int numOut) noexcept
{
if (actualRatio == 1.0)
auto pos = subSamplePos;
if (actualRatio == 1.0 && pos == 1.0)
{
memcpy (out, in, (size_t) numOut * sizeof (float));
pushInterpolationSamples (lastInputSamples, in, numOut);
return numOut;
}
const float* const originalIn = in;
double pos = subSamplePos;
int numUsed = 0;
if (actualRatio < 1.0)
while (numOut > 0)
{
for (int i = numOut; --i >= 0;)
while (pos >= 1.0)
{
if (pos >= 1.0)
{
pushInterpolationSample (lastInputSamples, *in++);
pos -= 1.0;
}
*out++ = InterpolatorType::valueAtOffset (lastInputSamples, (float) pos);
pos += actualRatio;
}
}
else
{
for (int i = numOut; --i >= 0;)
{
while (pos < actualRatio)
{
pushInterpolationSample (lastInputSamples, *in++);
pos += 1.0;
}
pos -= actualRatio;
*out++ = InterpolatorType::valueAtOffset (lastInputSamples, jmax (0.0f, 1.0f - (float) pos));
pushInterpolationSample (lastInputSamples, in[numUsed++]);
pos -= 1.0;
}
*out++ = InterpolatorType::valueAtOffset (lastInputSamples, (float) pos);
pos += actualRatio;
--numOut;
}
subSamplePos = pos;
return (int) (in - originalIn);
return numUsed;
}
template <typename InterpolatorType>
static int interpolateAdding (float* lastInputSamples, double& subSamplePos, const double actualRatio,
const float* in, float* out, const int numOut, const float gain) noexcept
static int interpolateAdding (float* lastInputSamples, double& subSamplePos, double actualRatio,
const float* in, float* out, int numOut, const float gain) noexcept
{
if (actualRatio == 1.0)
auto pos = subSamplePos;
if (actualRatio == 1.0 && pos == 1.0)
{
FloatVectorOperations::addWithMultiply (out, in, gain, numOut);
pushInterpolationSamples (lastInputSamples, in, numOut);
return numOut;
}
const float* const originalIn = in;
double pos = subSamplePos;
int numUsed = 0;
if (actualRatio < 1.0)
while (numOut > 0)
{
for (int i = numOut; --i >= 0;)
while (pos >= 1.0)
{
if (pos >= 1.0)
{
pushInterpolationSample (lastInputSamples, *in++);
pos -= 1.0;
}
*out++ += gain * InterpolatorType::valueAtOffset (lastInputSamples, (float) pos);
pos += actualRatio;
}
}
else
{
for (int i = numOut; --i >= 0;)
{
while (pos < actualRatio)
{
pushInterpolationSample (lastInputSamples, *in++);
pos += 1.0;
}
pos -= actualRatio;
*out++ += gain * InterpolatorType::valueAtOffset (lastInputSamples, jmax (0.0f, 1.0f - (float) pos));
pushInterpolationSample (lastInputSamples, in[numUsed++]);
pos -= 1.0;
}
*out++ += gain * InterpolatorType::valueAtOffset (lastInputSamples, (float) pos);
pos += actualRatio;
--numOut;
}
subSamplePos = pos;
return (int) (in - originalIn);
return numUsed;
}
}
@@ -186,8 +156,8 @@ void LagrangeInterpolator::reset() noexcept
{
subSamplePos = 1.0;
for (int i = 0; i < numElementsInArray (lastInputSamples); ++i)
lastInputSamples[i] = 0;
for (auto& s : lastInputSamples)
s = 0;
}
int LagrangeInterpolator::process (double actualRatio, const float* in, float* out, int numOut) noexcept


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

@@ -44,24 +44,24 @@ bool MidiKeyboardState::isNoteOn (const int midiChannel, const int n) const noex
{
jassert (midiChannel >= 0 && midiChannel <= 16);
return isPositiveAndBelow (n, (int) 128)
return isPositiveAndBelow (n, 128)
&& (noteStates[n] & (1 << (midiChannel - 1))) != 0;
}
bool MidiKeyboardState::isNoteOnForChannels (const int midiChannelMask, const int n) const noexcept
{
return isPositiveAndBelow (n, (int) 128)
return isPositiveAndBelow (n, 128)
&& (noteStates[n] & midiChannelMask) != 0;
}
void MidiKeyboardState::noteOn (const int midiChannel, const int midiNoteNumber, const float velocity)
{
jassert (midiChannel >= 0 && midiChannel <= 16);
jassert (isPositiveAndBelow (midiNoteNumber, (int) 128));
jassert (isPositiveAndBelow (midiNoteNumber, 128));
const ScopedLock sl (lock);
if (isPositiveAndBelow (midiNoteNumber, (int) 128))
if (isPositiveAndBelow (midiNoteNumber, 128))
{
const int timeNow = (int) Time::getMillisecondCounter();
eventsToAdd.addEvent (MidiMessage::noteOn (midiChannel, midiNoteNumber, velocity), timeNow);
@@ -73,7 +73,7 @@ void MidiKeyboardState::noteOn (const int midiChannel, const int midiNoteNumber,
void MidiKeyboardState::noteOnInternal (const int midiChannel, const int midiNoteNumber, const float velocity)
{
if (isPositiveAndBelow (midiNoteNumber, (int) 128))
if (isPositiveAndBelow (midiNoteNumber, 128))
{
noteStates [midiNoteNumber] |= (1 << (midiChannel - 1));


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

@@ -452,8 +452,8 @@ MidiMessage MidiMessage::aftertouchChange (const int channel,
const int aftertouchValue) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (noteNum, (int) 128));
jassert (isPositiveAndBelow (aftertouchValue, (int) 128));
jassert (isPositiveAndBelow (noteNum, 128));
jassert (isPositiveAndBelow (aftertouchValue, 128));
return MidiMessage (MidiHelpers::initialByte (0xa0, channel),
noteNum & 0x7f,
@@ -474,7 +474,7 @@ int MidiMessage::getChannelPressureValue() const noexcept
MidiMessage MidiMessage::channelPressureChange (const int channel, const int pressure) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (pressure, (int) 128));
jassert (isPositiveAndBelow (pressure, 128));
return MidiMessage (MidiHelpers::initialByte (0xd0, channel), pressure & 0x7f);
}
@@ -522,7 +522,7 @@ int MidiMessage::getPitchWheelValue() const noexcept
MidiMessage MidiMessage::pitchWheel (const int channel, const int position) noexcept
{
jassert (channel > 0 && channel <= 16); // valid channels are numbered 1 to 16
jassert (isPositiveAndBelow (position, (int) 0x4000));
jassert (isPositiveAndBelow (position, 0x4000));
return MidiMessage (MidiHelpers::initialByte (0xe0, channel),
position & 127, (position >> 7) & 127);
@@ -563,7 +563,7 @@ MidiMessage MidiMessage::controllerEvent (const int channel, const int controlle
MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept
{
jassert (channel > 0 && channel <= 16);
jassert (isPositiveAndBelow (noteNumber, (int) 128));
jassert (isPositiveAndBelow (noteNumber, 128));
return MidiMessage (MidiHelpers::initialByte (0x90, channel),
noteNumber & 127, MidiHelpers::validVelocity (velocity));
@@ -577,7 +577,7 @@ MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const
MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept
{
jassert (channel > 0 && channel <= 16);
jassert (isPositiveAndBelow (noteNumber, (int) 128));
jassert (isPositiveAndBelow (noteNumber, 128));
return MidiMessage (MidiHelpers::initialByte (0x80, channel),
noteNumber & 127, MidiHelpers::validVelocity (velocity));
@@ -591,7 +591,7 @@ MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, float
MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber) noexcept
{
jassert (channel > 0 && channel <= 16);
jassert (isPositiveAndBelow (noteNumber, (int) 128));
jassert (isPositiveAndBelow (noteNumber, 128));
return MidiMessage (MidiHelpers::initialByte (0x80, channel), noteNumber & 127, 0);
}
@@ -983,7 +983,7 @@ String MidiMessage::getMidiNoteName (int note, bool useSharps, bool includeOctav
static const char* const sharpNoteNames[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
static const char* const flatNoteNames[] = { "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" };
if (isPositiveAndBelow (note, (int) 128))
if (isPositiveAndBelow (note, 128))
{
String s (useSharps ? sharpNoteNames [note % 12]
: flatNoteNames [note % 12]);


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

@@ -731,6 +731,9 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
const double msTaken = Time::getMillisecondCounterHiRes() - callbackStartTime;
const double filterAmount = 0.2;
cpuUsageMs += filterAmount * (msTaken - cpuUsageMs);
if (msTaken > msPerBlock)
xruns++;
}
else
{
@@ -756,13 +759,14 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
void AudioDeviceManager::audioDeviceAboutToStartInt (AudioIODevice* const device)
{
cpuUsageMs = 0;
xruns = 0;
const double sampleRate = device->getCurrentSampleRate();
const int blockSize = device->getCurrentBufferSizeSamples();
if (sampleRate > 0.0 && blockSize > 0)
{
const double msPerBlock = 1000.0 * blockSize / sampleRate;
msPerBlock = 1000.0 * blockSize / sampleRate;
timeToCpuScale = (msPerBlock > 0.0) ? (1.0 / msPerBlock) : 0.0;
}
@@ -779,6 +783,7 @@ void AudioDeviceManager::audioDeviceStoppedInt()
{
cpuUsageMs = 0;
timeToCpuScale = 0;
xruns = 0;
sendChangeMessage();
const ScopedLock sl (audioCallbackLock);
@@ -998,6 +1003,12 @@ void AudioDeviceManager::playTestSound()
}
}
int AudioDeviceManager::getXRunCount() const noexcept
{
auto deviceXRuns = (currentAudioDevice != nullptr ? currentAudioDevice->getXRunCount() : -1);
return (deviceXRuns >= 0 ? deviceXRuns : xruns);
}
double AudioDeviceManager::getCurrentInputLevel() const noexcept { return inputLevelMeter.getCurrentLevel(); }
double AudioDeviceManager::getCurrentOutputLevel() const noexcept { return outputLevelMeter.getCurrentLevel(); }


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

@@ -436,6 +436,15 @@ public:
*/
CriticalSection& getMidiCallbackLock() noexcept { return midiCallbackLock; }
//==============================================================================
/** Returns the number of under- or over runs reported.
This method will use the underlying device's native getXRunCount if it supports
it. Otherwise it will estimate the number of under-/overruns by measuring the
time it spent in the audio callback.
*/
int getXRunCount() const noexcept;
private:
//==============================================================================
OwnedArray<AudioIODeviceType> availableDeviceTypes;
@@ -468,7 +477,8 @@ private:
ScopedPointer<AudioSampleBuffer> testSound;
int testSoundPosition;
double cpuUsageMs, timeToCpuScale;
double cpuUsageMs, timeToCpuScale, msPerBlock;
int xruns;
struct LevelMeter
{


+ 2
- 2
libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp View File

@@ -347,7 +347,7 @@ MidiOutput* MidiOutput::openDevice (int index)
{
MidiOutput* mo = nullptr;
if (isPositiveAndBelow (index, (int) MIDIGetNumberOfDestinations()))
if (isPositiveAndBelow (index, MIDIGetNumberOfDestinations()))
{
MIDIEndpointRef endPoint = MIDIGetDestination ((ItemCount) index);
@@ -465,7 +465,7 @@ MidiInput* MidiInput::openDevice (int index, MidiInputCallback* callback)
using namespace CoreMidiHelpers;
MidiInput* newInput = nullptr;
if (isPositiveAndBelow (index, (int) MIDIGetNumberOfSources()))
if (isPositiveAndBelow (index, MIDIGetNumberOfSources()))
{
if (MIDIEndpointRef endPoint = MIDIGetSource ((ItemCount) index))
{


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

@@ -1444,16 +1444,7 @@ struct ASIOAudioIODevice::ASIOCallbackFunctions <sizeof(currentASIODev) / sizeof
class ASIOAudioIODeviceType : public AudioIODeviceType
{
public:
ASIOAudioIODeviceType()
: AudioIODeviceType ("ASIO"),
hasScanned (false)
{
}
~ASIOAudioIODeviceType()
{
masterReference.clear();
}
ASIOAudioIODeviceType() : AudioIODeviceType ("ASIO") {}
//==============================================================================
void scanForDevices()
@@ -1549,13 +1540,13 @@ public:
callDeviceChangeListeners();
}
WeakReference<ASIOAudioIODeviceType>::Master masterReference;
JUCE_DECLARE_WEAK_REFERENCEABLE (ASIOAudioIODeviceType)
private:
StringArray deviceNames;
Array<CLSID> classIds;
bool hasScanned;
bool hasScanned = false;
//==============================================================================
static bool checkClassIsOk (const String& classId)


+ 5
- 0
libs/juce/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp View File

@@ -117,6 +117,9 @@ namespace FlacNamespace
#pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wdeprecated-register"
#elif JUCE_GCC && (__GNUC__ >= 7)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#if JUCE_INTEL
@@ -157,6 +160,8 @@ namespace FlacNamespace
#if JUCE_CLANG
#pragma clang diagnostic pop
#elif JUCE_GCC && (__GNUC__ >= 7)
#pragma GCC diagnostic pop
#endif
}


+ 6
- 0
libs/juce/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp View File

@@ -47,6 +47,12 @@ namespace OggVorbisNamespace
#elif JUCE_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#if (__GNUC__ >= 6)
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#if (__GNUC__ >= 7)
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#endif
#endif
#include "oggvorbis/vorbisenc.h"


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

@@ -1704,7 +1704,7 @@ private:
for (MidiBuffer::Iterator i (midiEvents); i.getNextEvent (midiEventData, midiEventSize, midiEventPosition);)
{
jassert (isPositiveAndBelow (midiEventPosition, (int) nFrames));
jassert (isPositiveAndBelow (midiEventPosition, nFrames));
ignoreUnused (nFrames);
dataSize += (size_t) midiEventSize;


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

@@ -56,9 +56,6 @@ using namespace Vst2;
#ifndef WM_APPCOMMAND
#define WM_APPCOMMAND 0x0319
#endif
extern "C" void _fpreset();
extern "C" void _clearfp();
#elif ! JUCE_WINDOWS
static void _fpreset() {}
static void _clearfp() {}
@@ -943,7 +940,7 @@ struct VSTPluginInstance : public AudioPluginInstance,
float getParameter (int index) override
{
if (vstEffect != nullptr && isPositiveAndBelow (index, (int) vstEffect->numParameters))
if (vstEffect != nullptr && isPositiveAndBelow (index, vstEffect->numParameters))
{
const ScopedLock sl (lock);
return vstEffect->getParameterValueFunction (vstEffect, index);
@@ -954,7 +951,7 @@ struct VSTPluginInstance : public AudioPluginInstance,
void setParameter (int index, float newValue) override
{
if (vstEffect != nullptr && isPositiveAndBelow (index, (int) vstEffect->numParameters))
if (vstEffect != nullptr && isPositiveAndBelow (index, vstEffect->numParameters))
{
const ScopedLock sl (lock);


+ 5
- 1
libs/juce/source/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h View File

@@ -52,11 +52,15 @@ public:
@param exitCallback A callback which will be called when the modal
bluetooth dialog is closed.
@param btWindowBounds The bounds of the bluetooth window that will
be opened. The dialog itself is opened by the OS so cannot
be customised by JUCE.
@return true if the dialogue was opened, false on error.
@see ModalComponentManager::Callback
*/
static bool open (ModalComponentManager::Callback* exitCallback = nullptr);
static bool open (ModalComponentManager::Callback* exitCallback = nullptr,
Rectangle<int>* btWindowBounds = nullptr);
/** Checks if a Bluetooth MIDI pairing dialogue is available on this
platform.


+ 31
- 10
libs/juce/source/modules/juce_audio_utils/native/juce_android_BluetoothMidiDevicePairingDialogue.cpp View File

@@ -391,7 +391,9 @@ private:
class BluetoothMidiSelectorOverlay : public Component
{
public:
BluetoothMidiSelectorOverlay (ModalComponentManager::Callback* exitCallbackToUse)
BluetoothMidiSelectorOverlay (ModalComponentManager::Callback* exitCallbackToUse,
const Rectangle<int>& boundsToUse)
: bounds (boundsToUse)
{
ScopedPointer<ModalComponentManager::Callback> exitCallback (exitCallbackToUse);
@@ -400,8 +402,14 @@ public:
setAlwaysOnTop (true);
setVisible (true);
addToDesktop (ComponentPeer::windowHasDropShadow);
setBounds (0, 0, getParentWidth(), getParentHeight());
if (bounds.isEmpty())
setBounds (0, 0, getParentWidth(), getParentHeight());
else
setBounds (bounds);
toFront (true);
setOpaque (! bounds.isEmpty());
addAndMakeVisible (bluetoothDevicesList);
enterModalState (true, exitCallback.release(), true);
@@ -414,7 +422,7 @@ public:
void paint (Graphics& g) override
{
g.fillAll (Colours::black.withAlpha (0.6f));
g.fillAll (bounds.isEmpty() ? Colours::black.withAlpha (0.6f) : Colours::black);
g.setColour (Colour (0xffdfdfdf));
Rectangle<int> overlayBounds = getOverlayBounds();
@@ -441,19 +449,30 @@ public:
void parentSizeChanged() override { update(); }
private:
Rectangle<int> bounds;
void update()
{
setBounds (0, 0, getParentWidth(), getParentHeight());
if (bounds.isEmpty())
setBounds (0, 0, getParentWidth(), getParentHeight());
else
setBounds (bounds);
bluetoothDevicesList.setBounds (getOverlayBounds().withTrimmedTop (40));
}
Rectangle<int> getOverlayBounds() const noexcept
{
const int pw = getParentWidth();
const int ph = getParentHeight();
if (bounds.isEmpty())
{
const int pw = getParentWidth();
const int ph = getParentHeight();
return Rectangle<int> (pw, ph).withSizeKeepingCentre (jmin (400, pw - 14),
jmin (300, ph - 40));
}
return Rectangle<int> (pw, ph).withSizeKeepingCentre (jmin (400, pw - 14),
jmin (300, ph - 40));
return bounds.withZeroOrigin();
}
AndroidBluetoothMidiDevicesListBox bluetoothDevicesList;
@@ -462,9 +481,11 @@ private:
};
//==============================================================================
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallbackPtr)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallbackPtr,
Rectangle<int>* btBounds)
{
ScopedPointer<ModalComponentManager::Callback> exitCallback (exitCallbackPtr);
auto boundsToUse = (btBounds != nullptr ? *btBounds : Rectangle<int> {});
if (! RuntimePermissions::isGranted (RuntimePermissions::bluetoothMidi))
{
@@ -475,7 +496,7 @@ bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback*
return false;
}
new BluetoothMidiSelectorOverlay (exitCallback.release());
new BluetoothMidiSelectorOverlay (exitCallback.release(), boundsToUse);
return true;
}


+ 31
- 12
libs/juce/source/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm View File

@@ -40,15 +40,23 @@ namespace juce
class BluetoothMidiSelectorOverlay : public Component
{
public:
BluetoothMidiSelectorOverlay (ModalComponentManager::Callback* exitCallbackToUse)
BluetoothMidiSelectorOverlay (ModalComponentManager::Callback* exitCallbackToUse,
const Rectangle<int>& boundsToUse)
: bounds (boundsToUse)
{
ScopedPointer<ModalComponentManager::Callback> exitCallback (exitCallbackToUse);
setAlwaysOnTop (true);
setVisible (true);
addToDesktop (ComponentPeer::windowHasDropShadow);
setBounds (0, 0, getParentWidth(), getParentHeight());
if (bounds.isEmpty())
setBounds (0, 0, getParentWidth(), getParentHeight());
else
setBounds (bounds);
toFront (true);
setOpaque (! bounds.isEmpty());
controller = [[CABTMIDICentralViewController alloc] init];
nativeSelectorComponent.setView ([controller view]);
@@ -66,7 +74,7 @@ public:
void paint (Graphics& g) override
{
g.fillAll (Colours::black.withAlpha (0.5f));
g.fillAll (bounds.isEmpty() ? Colours::black.withAlpha (0.5f) : Colours::black);
}
void inputAttemptWhenModal() override { close(); }
@@ -78,12 +86,19 @@ public:
private:
void update()
{
const int pw = getParentWidth();
const int ph = getParentHeight();
nativeSelectorComponent.setBounds (Rectangle<int> (pw, ph)
.withSizeKeepingCentre (jmin (400, pw),
jmin (450, ph - 40)));
if (bounds.isEmpty())
{
const int pw = getParentWidth();
const int ph = getParentHeight();
nativeSelectorComponent.setBounds (Rectangle<int> (pw, ph)
.withSizeKeepingCentre (jmin (400, pw),
jmin (450, ph - 40)));
}
else
{
nativeSelectorComponent.setBounds (bounds.withZeroOrigin());
}
}
void close()
@@ -94,17 +109,20 @@ private:
CABTMIDICentralViewController* controller;
UIViewComponent nativeSelectorComponent;
Rectangle<int> bounds;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BluetoothMidiSelectorOverlay)
};
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>* btBounds)
{
ScopedPointer<ModalComponentManager::Callback> cb (exitCallback);
auto boundsToUse = (btBounds != nullptr ? *btBounds : Rectangle<int> {});
if (isAvailable())
{
new BluetoothMidiSelectorOverlay (cb.release());
new BluetoothMidiSelectorOverlay (cb.release(), boundsToUse);
return true;
}
@@ -123,7 +141,8 @@ bool BluetoothMidiDevicePairingDialogue::isAvailable()
namespace juce
{
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>*)
{
ScopedPointer<ModalComponentManager::Callback> cb (exitCallback);
return false;


+ 2
- 1
libs/juce/source/modules/juce_audio_utils/native/juce_linux_BluetoothMidiDevicePairingDialogue.cpp View File

@@ -27,7 +27,8 @@
namespace juce
{
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>*)
{
ScopedPointer<ModalComponentManager::Callback> cb (exitCallback);
// not implemented on Linux yet!


+ 2
- 1
libs/juce/source/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm View File

@@ -27,7 +27,8 @@
namespace juce
{
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>*)
{
ScopedPointer<ModalComponentManager::Callback> cb (exitCallback);
// Do not call this on OSX. Instead, you should pair Bluetooth MIDI devices


+ 2
- 1
libs/juce/source/modules/juce_audio_utils/native/juce_win_BluetoothMidiDevicePairingDialogue.cpp View File

@@ -27,7 +27,8 @@
namespace juce
{
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback)
bool BluetoothMidiDevicePairingDialogue::open (ModalComponentManager::Callback* exitCallback,
Rectangle<int>*)
{
ScopedPointer<ModalComponentManager::Callback> cb (exitCallback);
// not implemented on Windows yet!


+ 0
- 6
libs/juce/source/modules/juce_core/maths/juce_BigInteger.h View File

@@ -337,10 +337,4 @@ private:
/** Writes a BigInteger to an OutputStream as a UTF8 decimal string. */
OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const BigInteger& value);
//==============================================================================
#ifndef DOXYGEN
// For backwards compatibility, BitArray is defined as an alias for BigInteger.
typedef BigInteger BitArray;
#endif
} // namespace juce

+ 15
- 22
libs/juce/source/modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -212,9 +212,9 @@ void findMinAndMax (const Type* values, int numValues, Type& lowest, Type& highe
@see jmin, jmax, jmap
*/
template <typename Type>
Type jlimit (const Type lowerLimit,
const Type upperLimit,
const Type valueToConstrain) noexcept
Type jlimit (Type lowerLimit,
Type upperLimit,
Type valueToConstrain) noexcept
{
jassert (lowerLimit <= upperLimit); // if these are in the wrong order, results are unpredictable..
@@ -228,15 +228,15 @@ Type jlimit (const Type lowerLimit,
@code valueToTest >= 0 && valueToTest < upperLimit
@endcode
*/
template <typename Type>
bool isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept
template <typename Type1, typename Type2>
bool isPositiveAndBelow (Type1 valueToTest, Type2 upperLimit) noexcept
{
jassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero..
return Type() <= valueToTest && valueToTest < upperLimit;
jassert (Type1() <= static_cast<Type1> (upperLimit)); // makes no sense to call this if the upper limit is itself below zero..
return Type1() <= valueToTest && valueToTest < static_cast<Type1> (upperLimit);
}
template <>
inline bool isPositiveAndBelow (const int valueToTest, const int upperLimit) noexcept
template <typename Type>
bool isPositiveAndBelow (int valueToTest, Type upperLimit) noexcept
{
jassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero..
return static_cast<unsigned int> (valueToTest) < static_cast<unsigned int> (upperLimit);
@@ -247,28 +247,21 @@ inline bool isPositiveAndBelow (const int valueToTest, const int upperLimit) noe
@code valueToTest >= 0 && valueToTest <= upperLimit
@endcode
*/
template <typename Type>
bool isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noexcept
template <typename Type1, typename Type2>
bool isPositiveAndNotGreaterThan (Type1 valueToTest, Type2 upperLimit) noexcept
{
jassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero..
return Type() <= valueToTest && valueToTest <= upperLimit;
jassert (Type1() <= static_cast<Type1> (upperLimit)); // makes no sense to call this if the upper limit is itself below zero..
return Type1() <= valueToTest && valueToTest <= static_cast<Type1> (upperLimit);
}
template <>
inline bool isPositiveAndNotGreaterThan (const int valueToTest, const int upperLimit) noexcept
template <typename Type>
bool isPositiveAndNotGreaterThan (int valueToTest, Type upperLimit) noexcept
{
jassert (upperLimit >= 0); // makes no sense to call this if the upper limit is itself below zero..
return static_cast<unsigned int> (valueToTest) <= static_cast<unsigned int> (upperLimit);
}
//==============================================================================
/** Handy function to swap two values. */
template <typename Type>
void swapVariables (Type& variable1, Type& variable2)
{
std::swap (variable1, variable2);
}
/** Handy function for avoiding unused variables warning. */
template <typename Type1>
void ignoreUnused (const Type1&) noexcept {}


+ 29
- 0
libs/juce/source/modules/juce_core/memory/juce_WeakReference.h View File

@@ -59,6 +59,8 @@ namespace juce
friend class WeakReference<MyObject>;
};
OR: just use the handy JUCE_DECLARE_WEAK_REFERENCEABLE macro to do all this for you.
// Here's an example of using a pointer..
MyObject* n = new MyObject();
@@ -202,4 +204,31 @@ private:
}
};
//==============================================================================
/**
Macro to easily allow a class to be made weak-referenceable.
This can be inserted in a class definition to add the requisite weak-ref boilerplate to that class.
e.g.
@code
class MyObject
{
public:
MyObject();
~MyObject();
private:
JUCE_DECLARE_WEAK_REFERENCEABLE (MyObject)
};
@endcode
@see WeakReference, WeakReference::Master
*/
#define JUCE_DECLARE_WEAK_REFERENCEABLE(Class) \
struct WeakRefMaster : public WeakReference<Class>::Master { ~WeakRefMaster() { this->clear(); } }; \
WeakRefMaster masterReference; \
friend class WeakReference<Class>; \
} // namespace juce

+ 18
- 0
libs/juce/source/modules/juce_core/native/java/JuceAppActivity.java View File

@@ -566,6 +566,9 @@ public class JuceAppActivity extends Activity
@Override
public void onDraw (Canvas canvas)
{
if (host == 0)
return;
handlePaint (host, canvas, paint);
}
@@ -657,6 +660,9 @@ public class JuceAppActivity extends Activity
@Override
public boolean onKeyDown (int keyCode, KeyEvent event)
{
if (host == 0)
return false;
switch (keyCode)
{
case KeyEvent.KEYCODE_VOLUME_UP:
@@ -679,6 +685,9 @@ public class JuceAppActivity extends Activity
@Override
public boolean onKeyUp (int keyCode, KeyEvent event)
{
if (host == 0)
return false;
handleKeyUp (host, keyCode, event.getUnicodeChar());
return true;
}
@@ -686,6 +695,9 @@ public class JuceAppActivity extends Activity
@Override
public boolean onKeyMultiple (int keyCode, int count, KeyEvent event)
{
if (host == 0)
return false;
if (keyCode != KeyEvent.KEYCODE_UNKNOWN || event.getAction() != KeyEvent.ACTION_MULTIPLE)
return super.onKeyMultiple (keyCode, count, event);
@@ -718,6 +730,9 @@ public class JuceAppActivity extends Activity
@Override
protected void onSizeChanged (int w, int h, int oldw, int oldh)
{
if (host == 0)
return;
super.onSizeChanged (w, h, oldw, oldh);
viewSizeChanged (host);
}
@@ -734,6 +749,9 @@ public class JuceAppActivity extends Activity
@Override
public void onFocusChange (View v, boolean hasFocus)
{
if (host == 0)
return;
if (v == this)
focusChanged (host, hasFocus);
}


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

@@ -407,7 +407,7 @@ int SystemStats::getMemorySizeInMegabytes()
struct sysinfo sysi;
if (sysinfo (&sysi) == 0)
return (static_cast<int> (sysi.totalram * sysi.mem_unit) / (1024 * 1024));
return static_cast<int> ((sysi.totalram * sysi.mem_unit) / (1024 * 1024));
#endif
return 0;


+ 2
- 2
libs/juce/source/modules/juce_core/native/juce_linux_Files.cpp View File

@@ -136,14 +136,14 @@ File File::getSpecialLocation (const SpecialLocationType type)
case invokedExecutableFile:
if (juce_argv != nullptr && juce_argc > 0)
return File (CharPointer_UTF8 (juce_argv[0]));
// deliberate fall-through...
// fall-through
case currentExecutableFile:
case currentApplicationFile:
#if ! JUCE_STANDALONE_APPLICATION
return juce_getExecutableFile();
#endif
// deliberate fall-through if this is not a shared-library
// fall-through
case hostApplicationPath:
{


+ 71
- 0
libs/juce/source/modules/juce_core/native/juce_osx_ObjCHelpers.h View File

@@ -202,6 +202,77 @@ private:
JUCE_DECLARE_NON_COPYABLE (ObjCClass)
};
//==============================================================================
#ifndef DOXYGEN
template <class JuceClass>
struct ObjCLifetimeManagedClass : public ObjCClass<NSObject>
{
ObjCLifetimeManagedClass()
: ObjCClass<NSObject> ("ObjCLifetimeManagedClass_")
{
addIvar<JuceClass*> ("cppObject");
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
addMethod (@selector (initWithJuceObject:), initWithJuceObject, "@@:@");
#pragma clang diagnostic pop
addMethod (@selector (dealloc), dealloc, "v@:");
registerClass();
}
static id initWithJuceObject (id _self, SEL, JuceClass* obj)
{
NSObject* self = _self;
objc_super s = { self, [NSObject class] };
self = ObjCMsgSendSuper<NSObject*> (&s, @selector(init));
object_setInstanceVariable (self, "cppObject", obj);
return self;
}
static void dealloc (id _self, SEL)
{
if (auto* obj = getIvar<JuceClass*> (_self, "cppObject"))
{
delete obj;
object_setInstanceVariable (_self, "cppObject", nullptr);
}
objc_super s = { _self, [NSObject class] };
ObjCMsgSendSuper<void> (&s, @selector(dealloc));
}
static ObjCLifetimeManagedClass objCLifetimeManagedClass;
};
template <typename Class>
ObjCLifetimeManagedClass<Class> ObjCLifetimeManagedClass<Class>::objCLifetimeManagedClass;
#endif
// this will return an NSObject which takes ownership of the JUCE instance passed-in
// This is useful to tie the life-time of a juce instance to the life-time of an NSObject
template <typename Class>
NSObject* createNSObjectFromJuceClass (Class* obj)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-method-access"
return [ObjCLifetimeManagedClass<Class>::objCLifetimeManagedClass.createInstance() initWithJuceObject:obj];
#pragma clang diagnostic pop
}
// Get the JUCE class instance that was tied to the life-time of an NSObject with the
// function above
template <typename Class>
Class* getJuceClassFromNSObject (NSObject* obj)
{
return obj != nullptr ? ObjCLifetimeManagedClass<Class>:: template getIvar<Class*> (obj, "cppObject") : nullptr;
}
#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES
template <typename ReturnT, class Class, typename... Params>


+ 2
- 0
libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -1205,6 +1205,8 @@ public:
close (pipeHandles[1]); // close the write handle
}
}
ignoreUnused (streamFlags);
}
~ActiveProcess()


+ 26
- 28
libs/juce/source/modules/juce_core/network/juce_URL.cpp View File

@@ -130,7 +130,7 @@ URL::DownloadTask* URL::DownloadTask::createFallbackDownloader (const URL& urlTo
return nullptr;
}
URL::DownloadTask::DownloadTask() : contentLength (-1), downloaded (0), finished (false), error (false), httpCode (-1) {}
URL::DownloadTask::DownloadTask() {}
URL::DownloadTask::~DownloadTask() {}
//==============================================================================
@@ -250,6 +250,7 @@ namespace URLHelpers
static int findStartOfNetLocation (const String& url)
{
int start = findEndOfScheme (url);
while (url[start] == '/')
++start;
@@ -305,8 +306,8 @@ String URL::getDomain() const
const int end2 = url.indexOfChar (start, ':');
const int end = (end1 < 0 && end2 < 0) ? std::numeric_limits<int>::max()
: ((end1 < 0 || end2 < 0) ? jmax (end1, end2)
: jmin (end1, end2));
: ((end1 < 0 || end2 < 0) ? jmax (end1, end2)
: jmin (end1, end2));
return url.substring (start, end);
}
@@ -325,7 +326,7 @@ String URL::getScheme() const
int URL::getPort() const
{
const int colonPos = url.indexOfChar (URLHelpers::findStartOfNetLocation (url), ':');
auto colonPos = url.indexOfChar (URLHelpers::findStartOfNetLocation (url), ':');
return colonPos > 0 ? url.substring (colonPos + 1).getIntValue() : 0;
}
@@ -366,7 +367,7 @@ void URL::createHeadersAndPostData (String& headers, MemoryBlock& postDataToWrit
// (this doesn't currently support mixing custom post-data with uploads..)
jassert (postData.getSize() == 0);
const String boundary (String::toHexString (Random::getSystemRandom().nextInt64()));
auto boundary = String::toHexString (Random::getSystemRandom().nextInt64());
headers << "Content-Type: multipart/form-data; boundary=" << boundary << "\r\n";
@@ -379,22 +380,20 @@ void URL::createHeadersAndPostData (String& headers, MemoryBlock& postDataToWrit
<< "\r\n--" << boundary;
}
for (int i = 0; i < filesToUpload.size(); ++i)
for (auto* f : filesToUpload)
{
const Upload& f = *filesToUpload.getObjectPointerUnchecked(i);
data << "\r\nContent-Disposition: form-data; name=\"" << f.parameterName
<< "\"; filename=\"" << f.filename << "\"\r\n";
data << "\r\nContent-Disposition: form-data; name=\"" << f->parameterName
<< "\"; filename=\"" << f->filename << "\"\r\n";
if (f.mimeType.isNotEmpty())
data << "Content-Type: " << f.mimeType << "\r\n";
if (f->mimeType.isNotEmpty())
data << "Content-Type: " << f->mimeType << "\r\n";
data << "Content-Transfer-Encoding: binary\r\n\r\n";
if (f.data != nullptr)
data << *f.data;
if (f->data != nullptr)
data << *f->data;
else
data << f.file;
data << f->file;
data << "\r\n--" << boundary;
}
@@ -419,8 +418,8 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL)
{
static const char* validProtocols[] = { "http:", "ftp:", "https:" };
for (int i = 0; i < numElementsInArray (validProtocols); ++i)
if (possibleURL.startsWithIgnoreCase (validProtocols[i]))
for (auto* protocol : validProtocols)
if (possibleURL.startsWithIgnoreCase (protocol))
return true;
if (possibleURL.containsChar ('@')
@@ -435,7 +434,7 @@ bool URL::isProbablyAWebsiteURL (const String& possibleURL)
bool URL::isProbablyAnEmailAddress (const String& possibleEmailAddress)
{
const int atSign = possibleEmailAddress.indexOfChar ('@');
auto atSign = possibleEmailAddress.indexOfChar ('@');
return atSign > 0
&& possibleEmailAddress.lastIndexOfChar ('.') > (atSign + 1)
@@ -504,8 +503,7 @@ WebInputStream* URL::createInputStream (const bool usePostCommand,
}
//==============================================================================
bool URL::readEntireBinaryStream (MemoryBlock& destData,
const bool usePostCommand) const
bool URL::readEntireBinaryStream (MemoryBlock& destData, bool usePostCommand) const
{
const ScopedPointer<InputStream> in (createInputStream (usePostCommand));
@@ -518,7 +516,7 @@ bool URL::readEntireBinaryStream (MemoryBlock& destData,
return false;
}
String URL::readEntireTextStream (const bool usePostCommand) const
String URL::readEntireTextStream (bool usePostCommand) const
{
const ScopedPointer<InputStream> in (createInputStream (usePostCommand));
@@ -528,7 +526,7 @@ String URL::readEntireTextStream (const bool usePostCommand) const
return {};
}
XmlElement* URL::readEntireXmlStream (const bool usePostCommand) const
XmlElement* URL::readEntireXmlStream (bool usePostCommand) const
{
return XmlDocument::parse (readEntireTextStream (usePostCommand));
}
@@ -601,7 +599,7 @@ URL URL::withDataToUpload (const String& parameterName, const String& filename,
//==============================================================================
String URL::removeEscapeChars (const String& s)
{
String result (s.replaceCharacter ('+', ' '));
auto result = s.replaceCharacter ('+', ' ');
if (! result.containsChar ('%'))
return result;
@@ -628,9 +626,9 @@ String URL::removeEscapeChars (const String& s)
return String::fromUTF8 (utf8.getRawDataPointer(), utf8.size());
}
String URL::addEscapeChars (const String& s, const bool isParameter, bool roundBracketsAreLegal)
String URL::addEscapeChars (const String& s, bool isParameter, bool roundBracketsAreLegal)
{
String legalChars (isParameter ? "_-.*!'"
String legalChars (isParameter ? "_-.~"
: ",$_-.*!'");
if (roundBracketsAreLegal)
@@ -640,7 +638,7 @@ String URL::addEscapeChars (const String& s, const bool isParameter, bool roundB
for (int i = 0; i < utf8.size(); ++i)
{
const char c = utf8.getUnchecked(i);
auto c = utf8.getUnchecked(i);
if (! (CharacterFunctions::isLetterOrDigit (c)
|| legalChars.containsChar ((juce_wchar) c)))
@@ -657,12 +655,12 @@ String URL::addEscapeChars (const String& s, const bool isParameter, bool roundB
//==============================================================================
bool URL::launchInDefaultBrowser() const
{
String u (toString (true));
auto u = toString (true);
if (u.containsChar ('@') && ! u.containsChar (':'))
u = "mailto:" + u;
return Process::openDocument (u, String());
return Process::openDocument (u, {});
}
} // namespace juce

+ 12
- 24
libs/juce/source/modules/juce_core/network/juce_URL.h View File

@@ -47,13 +47,13 @@ public:
URL (const String& url);
/** Creates a copy of another URL. */
URL (const URL& other);
URL (const URL&);
/** Destructor. */
~URL();
/** Copies this URL from another one. */
URL& operator= (const URL& other);
URL& operator= (const URL&);
/** Compares two URLs.
All aspects of the URLs must be identical for them to match, including any parameters,
@@ -78,19 +78,16 @@ public:
bool isWellFormed() const;
/** Returns just the domain part of the URL.
E.g. for "http://www.xyz.com/foobar", this will return "www.xyz.com".
*/
String getDomain() const;
/** Returns the path part of the URL.
E.g. for "http://www.xyz.com/foo/bar?x=1", this will return "foo/bar".
*/
String getSubPath() const;
/** Returns the scheme of the URL.
E.g. for "http://www.xyz.com/foobar", this will return "http". (It won't
include the colon).
*/
@@ -102,7 +99,6 @@ public:
int getPort() const;
/** Returns a new version of this URL with a different domain and path.
E.g. if the URL is "http://www.xyz.com/foo?x=1" and you call this with
"abc.com/zzz", it'll return "http://abc.com/zzz?x=1".
@see withNewSubPath
@@ -110,7 +106,6 @@ public:
URL withNewDomainAndPath (const String& newFullPath) const;
/** Returns a new version of this URL with a different sub-path.
E.g. if the URL is "http://www.xyz.com/foo?x=1" and you call this with
"bar", it'll return "http://www.xyz.com/bar?x=1".
@see withNewDomainAndPath
@@ -118,7 +113,6 @@ public:
URL withNewSubPath (const String& newPath) const;
/** Returns a new URL that refers to a sub-path relative to this one.
E.g. if the URL is "http://www.xyz.com/foo" and you call this with
"bar", it'll return "http://www.xyz.com/foo/bar". Note that there's no way for
this method to know whether the original URL is a file or directory, so it's
@@ -134,7 +128,6 @@ public:
/** Returns a copy of this URL, with a GET or POST parameter added to the end.
Any control characters in the value will be encoded.
e.g. calling "withParameter ("amount", "some fish") for the url "www.fish.com"
would produce a new url whose toString(true) method would return
"www.fish.com?amount=some+fish".
@@ -241,20 +234,17 @@ public:
//==============================================================================
/** Tries to launch the system's default browser to open the URL.
Returns true if this seems to have worked.
*/
bool launchInDefaultBrowser() const;
//==============================================================================
/** Takes a guess as to whether a string might be a valid website address.
This isn't foolproof!
*/
static bool isProbablyAWebsiteURL (const String& possibleURL);
/** Takes a guess as to whether a string might be a valid email address.
This isn't foolproof!
*/
static bool isProbablyAnEmailAddress (const String& possibleEmailAddress);
@@ -319,7 +309,6 @@ public:
//==============================================================================
/** Represents a download task.
Returned by downloadToFile to allow querying and controling the download task.
*/
class DownloadTask
@@ -346,34 +335,32 @@ public:
/** Returns the total length of the download task. This may return -1 if the length
was not returned by the server. */
inline int64 getTotalLength() const { return contentLength; }
int64 getTotalLength() const { return contentLength; }
/** Returns the number of bytes that have been downloaded so far. */
inline int64 getLengthDownloaded() const { return downloaded; }
int64 getLengthDownloaded() const { return downloaded; }
/** Returns true if the download finished or there was an error. */
inline bool isFinished() const { return finished; }
/** Returns the status code of the server's response. This will only be valid
after the download has finished.
bool isFinished() const { return finished; }
/** Returns the status code of the server's response.
This will only be valid after the download has finished.
@see isFinished
*/
inline int statusCode() const { return httpCode; }
int statusCode() const { return httpCode; }
/** Returns true if there was an error. */
inline bool hadError() const { return error; }
protected:
int64 contentLength, downloaded;
bool finished, error;
int httpCode;
int64 contentLength = -1, downloaded = 0;
bool finished = false, error = false;
int httpCode = -1;
DownloadTask();
private:
friend class URL;
static DownloadTask* createFallbackDownloader (const URL&, const File&, const String&, Listener*, bool);
public:
@@ -381,6 +368,7 @@ public:
/** internal **/
static void juce_iosURLSessionNotify (const String&);
#endif
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DownloadTask)
};


+ 0
- 5
libs/juce/source/modules/juce_core/system/juce_StandardHeader.h View File

@@ -114,11 +114,6 @@
#include "../misc/juce_StdFunctionCompat.h"
#endif
// The live build fails to compile std::stringstream
#if ! JUCE_PROJUCER_LIVE_BUILD
#include <sstream>
#endif
// Include std::atomic if it's supported by the compiler
#if JUCE_ATOMIC_AVAILABLE
#include <atomic>


+ 3
- 2
libs/juce/source/modules/juce_core/text/juce_CharacterFunctions.cpp View File

@@ -241,12 +241,13 @@ public:
STRING_DOUBLE_PAIR_COMBOS (2087.3087e+00006),
STRING_DOUBLE_PAIR_COMBOS (6.0872e-00006),
// Too many sig figs
// Too many sig figs. The parsing routine on MinGW gets the last
// significant figure wrong.
STRING_DOUBLE_PAIR_COMBOS (1.23456789012345678901234567890),
STRING_DOUBLE_PAIR_COMBOS (1.23456789012345678901234567890e-111)
// Limits. DBL_MAX may not exist on Linux.
#if ! JUCE_LINUX
// Limits
, STRING_DOUBLE_PAIR (DBL_MAX),
STRING_DOUBLE_PAIR (-DBL_MAX),
STRING_DOUBLE_PAIR (DBL_MIN)


+ 138
- 22
libs/juce/source/modules/juce_core/text/juce_CharacterFunctions.h View File

@@ -61,7 +61,7 @@ namespace juce
#endif
//==============================================================================
/** GNU libstdc++ does not have std::make_unsigned */
// GNU libstdc++ does not have std::make_unsigned
namespace internal
{
template <typename Type> struct make_unsigned { typedef Type type; };
@@ -140,20 +140,29 @@ public:
template <typename CharPointerType>
static double readDoubleValue (CharPointerType& text) noexcept
{
const int maxSignificantDigits = 17 + 1; // An additional digit for rounding
const int bufferSize = maxSignificantDigits + 7 + 1; // -.E-XXX and a trailing null-terminator
#if JUCE_MINGW
bool isNegative = false;
#else
JUCE_CONSTEXPR const int maxSignificantDigits = 17 + 1; // An additional digit for rounding
JUCE_CONSTEXPR const int bufferSize = maxSignificantDigits + 7 + 1; // -.E-XXX and a trailing null-terminator
char buffer[bufferSize] = {};
char* currentCharacter = &(buffer[0]);
int numSigFigs = 0;
bool decimalPointFound = false;
#endif
text = text.findEndOfWhitespace();
auto c = *text;
switch (c)
{
case '-': *currentCharacter++ = '-'; // Fall-through..
case '+': c = *++text;
case '-':
#if JUCE_MINGW
isNegative = true;
#else
*currentCharacter++ = '-';
#endif
// Fall-through..
case '+':
c = *++text;
}
switch (c)
@@ -171,11 +180,121 @@ public:
break;
}
#if JUCE_MINGW
// MinGW does not have access to the locale functions required for strtold, so we parse the doubles
// ourselves. There are some edge cases where the least significant digit will be wrong!
double result[3] = { 0 }, accumulator[2] = { 0 };
int exponentAdjustment[2] = { 0 }, exponentAccumulator[2] = { -1, -1 };
int exponent = 0, decPointIndex = 0, digit = 0;
int lastDigit = 0, numSignificantDigits = 0;
bool digitsFound = false;
JUCE_CONSTEXPR const int maxSignificantDigits = 17 + 1;
for (;;)
{
if (text.isDigit())
{
lastDigit = digit;
digit = (int) text.getAndAdvance() - '0';
digitsFound = true;
if (decPointIndex != 0)
exponentAdjustment[1]++;
if (numSignificantDigits == 0 && digit == 0)
continue;
if (++numSignificantDigits > maxSignificantDigits)
{
if (digit > 5)
++accumulator [decPointIndex];
else if (digit == 5 && (lastDigit & 1) != 0)
++accumulator [decPointIndex];
if (decPointIndex > 0)
exponentAdjustment[1]--;
else
exponentAdjustment[0]++;
while (text.isDigit())
{
++text;
if (decPointIndex == 0)
exponentAdjustment[0]++;
}
}
else
{
const auto maxAccumulatorValue = (double) ((std::numeric_limits<unsigned int>::max() - 9) / 10);
if (accumulator [decPointIndex] > maxAccumulatorValue)
{
result [decPointIndex] = mulexp10 (result [decPointIndex], exponentAccumulator [decPointIndex])
+ accumulator [decPointIndex];
accumulator [decPointIndex] = 0;
exponentAccumulator [decPointIndex] = 0;
}
accumulator [decPointIndex] = accumulator[decPointIndex] * 10 + digit;
exponentAccumulator [decPointIndex]++;
}
}
else if (decPointIndex == 0 && *text == '.')
{
++text;
decPointIndex = 1;
if (numSignificantDigits > maxSignificantDigits)
{
while (text.isDigit())
++text;
break;
}
}
else
{
break;
}
}
result[0] = mulexp10 (result[0], exponentAccumulator[0]) + accumulator[0];
if (decPointIndex != 0)
result[1] = mulexp10 (result[1], exponentAccumulator[1]) + accumulator[1];
c = *text;
if ((c == 'e' || c == 'E') && digitsFound)
{
auto negativeExponent = false;
switch (*++text)
{
case '-': negativeExponent = true; // fall-through..
case '+': ++text;
}
while (text.isDigit())
exponent = (exponent * 10) + ((int) text.getAndAdvance() - '0');
if (negativeExponent)
exponent = -exponent;
}
auto r = mulexp10 (result[0], exponent + exponentAdjustment[0]);
if (decPointIndex != 0)
r += mulexp10 (result[1], exponent - exponentAdjustment[1]);
return isNegative ? -r : r;
#else // ! JUCE_MINGW
int numSigFigs = 0;
bool decimalPointFound = false;
for (;;)
{
if (text.isDigit())
{
int digit = (int) text.getAndAdvance() - '0';
auto digit = (int) text.getAndAdvance() - '0';
if (numSigFigs >= maxSignificantDigits
|| ((numSigFigs == 0 && (! decimalPointFound)) && digit == 0))
@@ -231,22 +350,19 @@ public:
*currentCharacter++ = '0';
}
#if JUCE_PROJUCER_LIVE_BUILD
// This will change with locale!
return strtod (&buffer[0], nullptr);
#if JUCE_WINDOWS
static _locale_t locale = _create_locale (LC_ALL, "C");
return _strtod_l (&buffer[0], nullptr, locale);
#else
double result = 0;
const size_t stringSize = (size_t) (currentCharacter - &buffer[0]) + 1;
if (stringSize > 1)
{
std::istringstream is (std::string (&buffer[0], stringSize));
is.imbue (std::locale ("C"));
is >> result;
}
return result;
static locale_t locale = newlocale (LC_ALL_MASK, "C", nullptr);
#if JUCE_ANDROID
return (double) strtold_l (&buffer[0], nullptr, locale);
#else
return strtod_l (&buffer[0], nullptr, locale);
#endif
#endif
#endif // JUCE_MINGW
}
/** Parses a character string, to read a floating-point value. */


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

@@ -241,7 +241,7 @@ namespace XmlOutputFunctions
outputStream << (char) character;
break;
}
// Note: deliberate fall-through here!
// fall-through
default:
outputStream << "&#" << ((int) character) << ';';
break;


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

@@ -92,7 +92,7 @@ private:
{
case Z_STREAM_END:
finished = true;
// Deliberate fall-through..
// fall-through..
case Z_OK:
{
data += dataSize - stream.avail_in;


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

@@ -39,6 +39,9 @@ namespace zlibNamespace
#if __has_warning("-Wcomma")
#pragma clang diagnostic ignored "-Wcomma"
#endif
#elif JUCE_GCC && (__GNUC__ >= 7)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
#undef OS_CODE
@@ -74,6 +77,8 @@ namespace zlibNamespace
#if JUCE_CLANG
#pragma clang diagnostic pop
#elif JUCE_GCC && (__GNUC__ >= 7)
#pragma GCC diagnostic pop
#endif
#else
#include JUCE_ZLIB_INCLUDE_PATH
@@ -136,7 +141,7 @@ public:
{
case Z_STREAM_END:
finished = true;
// deliberate fall-through
// fall-through
case Z_OK:
data += dataSize - stream.avail_in;
dataSize = (z_uInt) stream.avail_in;


+ 0
- 2
libs/juce/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp View File

@@ -59,8 +59,6 @@ ActionBroadcaster::~ActionBroadcaster()
{
// all event-based objects must be deleted BEFORE juce is shut down!
jassert (MessageManager::getInstanceWithoutCreating() != nullptr);
masterReference.clear();
}
void ActionBroadcaster::addActionListener (ActionListener* const listener)


+ 1
- 3
libs/juce/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h