diff --git a/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp b/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp index a78b3956b..196d50b22 100644 --- a/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp +++ b/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -579,7 +579,7 @@ public: } }; - void runTest() + void runTest() override { Random r = getRandom(); beginTest ("Round-trip conversion: Int8"); diff --git a/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index 17cc48c0a..e11c6c166 100644 --- a/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/source/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp b/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp index 8fa04655a..e9fd6e002 100644 --- a/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp +++ b/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 8b9a72c1f..12e2de807 100644 --- a/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/source/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp b/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp index eacf0f218..20fc28301 100644 --- a/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp +++ b/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -1146,7 +1146,7 @@ public: } }; - void runTest() + void runTest() override { beginTest ("FloatVectorOperations"); diff --git a/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h b/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h index 114d51662..0c85e60f4 100644 --- a/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h +++ b/source/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_Decibels.h b/source/modules/juce_audio_basics/effects/juce_Decibels.h index c63746ce0..6e039e3be 100644 --- a/source/modules/juce_audio_basics/effects/juce_Decibels.h +++ b/source/modules/juce_audio_basics/effects/juce_Decibels.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_FFT.cpp b/source/modules/juce_audio_basics/effects/juce_FFT.cpp index c230792c5..dd3e7cc30 100644 --- a/source/modules/juce_audio_basics/effects/juce_FFT.cpp +++ b/source/modules/juce_audio_basics/effects/juce_FFT.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -225,13 +225,43 @@ void FFT::perform (const Complex* const input, Complex* const output) const noex config->perform (input, output); } +const size_t maxFFTScratchSpaceToAlloca = 256 * 1024; + void FFT::performRealOnlyForwardTransform (float* d) const noexcept +{ + const size_t scratchSize = 16 + sizeof (FFT::Complex) * (size_t) size; + + if (scratchSize < maxFFTScratchSpaceToAlloca) + { + performRealOnlyForwardTransform (static_cast (alloca (scratchSize)), d); + } + else + { + HeapBlock heapSpace (scratchSize); + performRealOnlyForwardTransform (reinterpret_cast (heapSpace.getData()), d); + } +} + +void FFT::performRealOnlyInverseTransform (float* d) const noexcept +{ + const size_t scratchSize = 16 + sizeof (FFT::Complex) * (size_t) size; + + if (scratchSize < maxFFTScratchSpaceToAlloca) + { + performRealOnlyForwardTransform (static_cast (alloca (scratchSize)), d); + } + else + { + HeapBlock heapSpace (scratchSize); + performRealOnlyInverseTransform (reinterpret_cast (heapSpace.getData()), d); + } +} + +void FFT::performRealOnlyForwardTransform (Complex* scratch, float* d) const noexcept { // This can only be called on an FFT object that was created to do forward transforms. jassert (! config->inverse); - Complex* const scratch = static_cast (alloca (16 + sizeof (Complex) * (size_t) size)); - for (int i = 0; i < size; ++i) { scratch[i].r = d[i]; @@ -241,13 +271,11 @@ void FFT::performRealOnlyForwardTransform (float* d) const noexcept perform (scratch, reinterpret_cast (d)); } -void FFT::performRealOnlyInverseTransform (float* d) const noexcept +void FFT::performRealOnlyInverseTransform (Complex* scratch, float* d) const noexcept { // This can only be called on an FFT object that was created to do inverse transforms. jassert (config->inverse); - Complex* const scratch = static_cast (alloca (16 + sizeof (Complex) * (size_t) size)); - perform (reinterpret_cast (d), scratch); const float scaleFactor = 1.0f / size; diff --git a/source/modules/juce_audio_basics/effects/juce_FFT.h b/source/modules/juce_audio_basics/effects/juce_FFT.h index e61e80969..7ac839307 100644 --- a/source/modules/juce_audio_basics/effects/juce_FFT.h +++ b/source/modules/juce_audio_basics/effects/juce_FFT.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -84,9 +84,12 @@ public: int getSize() const noexcept { return size; } private: - struct FFTConfig; + JUCE_PUBLIC_IN_DLL_BUILD (struct FFTConfig) ScopedPointer config; const int size; + void performRealOnlyForwardTransform (Complex*, float*) const noexcept; + void performRealOnlyInverseTransform (Complex*, float*) const noexcept; + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FFT) }; diff --git a/source/modules/juce_audio_basics/effects/juce_IIRFilter.cpp b/source/modules/juce_audio_basics/effects/juce_IIRFilter.cpp index b961a6a98..836c0f6f9 100644 --- a/source/modules/juce_audio_basics/effects/juce_IIRFilter.cpp +++ b/source/modules/juce_audio_basics/effects/juce_IIRFilter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_IIRFilter.h b/source/modules/juce_audio_basics/effects/juce_IIRFilter.h index 8269cf582..03deee723 100644 --- a/source/modules/juce_audio_basics/effects/juce_IIRFilter.h +++ b/source/modules/juce_audio_basics/effects/juce_IIRFilter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp b/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp index 6d26cc46f..aa4eccc0d 100644 --- a/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp +++ b/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h b/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h index caa4802ec..c3f7fd298 100644 --- a/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h +++ b/source/modules/juce_audio_basics/effects/juce_LagrangeInterpolator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/effects/juce_Reverb.h b/source/modules/juce_audio_basics/effects/juce_Reverb.h index 6af4acc2a..4dcc0fc34 100644 --- a/source/modules/juce_audio_basics/effects/juce_Reverb.h +++ b/source/modules/juce_audio_basics/effects/juce_Reverb.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/juce_audio_basics.cpp b/source/modules/juce_audio_basics/juce_audio_basics.cpp index 76763056a..ca5aa9e16 100644 --- a/source/modules/juce_audio_basics/juce_audio_basics.cpp +++ b/source/modules/juce_audio_basics/juce_audio_basics.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -40,6 +40,10 @@ #define JUCE_USE_SSE_INTRINSICS 0 #endif +#if JUCE_MINGW + #define alloca __builtin_alloca +#endif + #ifndef JUCE_USE_SSE_INTRINSICS #define JUCE_USE_SSE_INTRINSICS 1 #endif diff --git a/source/modules/juce_audio_basics/juce_audio_basics.h b/source/modules/juce_audio_basics/juce_audio_basics.h index 65541263f..2d7c12027 100644 --- a/source/modules/juce_audio_basics/juce_audio_basics.h +++ b/source/modules/juce_audio_basics/juce_audio_basics.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp b/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp index 9319ab92e..4fc1eb762 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp +++ b/source/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiBuffer.h b/source/modules/juce_audio_basics/midi/juce_MidiBuffer.h index ecbc56a21..d93ab5248 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiBuffer.h +++ b/source/modules/juce_audio_basics/midi/juce_MidiBuffer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp b/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp index e798cc0c6..e24443b5a 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp +++ b/source/modules/juce_audio_basics/midi/juce_MidiFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiFile.h b/source/modules/juce_audio_basics/midi/juce_MidiFile.h index 2a6993714..7f98fc321 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiFile.h +++ b/source/modules/juce_audio_basics/midi/juce_MidiFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp b/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp index 6c4e794fa..ef6e97e56 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp +++ b/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -81,7 +81,7 @@ void MidiKeyboardState::noteOnInternal (const int midiChannel, const int midiNo } } -void MidiKeyboardState::noteOff (const int midiChannel, const int midiNoteNumber) +void MidiKeyboardState::noteOff (const int midiChannel, const int midiNoteNumber, const float velocity) { const ScopedLock sl (lock); @@ -91,18 +91,18 @@ void MidiKeyboardState::noteOff (const int midiChannel, const int midiNoteNumber eventsToAdd.addEvent (MidiMessage::noteOff (midiChannel, midiNoteNumber), timeNow); eventsToAdd.clear (0, timeNow - 500); - noteOffInternal (midiChannel, midiNoteNumber); + noteOffInternal (midiChannel, midiNoteNumber, velocity); } } -void MidiKeyboardState::noteOffInternal (const int midiChannel, const int midiNoteNumber) +void MidiKeyboardState::noteOffInternal (const int midiChannel, const int midiNoteNumber, const float velocity) { if (isNoteOn (midiChannel, midiNoteNumber)) { noteStates [midiNoteNumber] &= ~(1 << (midiChannel - 1)); for (int i = listeners.size(); --i >= 0;) - listeners.getUnchecked(i)->handleNoteOff (this, midiChannel, midiNoteNumber); + listeners.getUnchecked(i)->handleNoteOff (this, midiChannel, midiNoteNumber, velocity); } } @@ -118,7 +118,7 @@ void MidiKeyboardState::allNotesOff (const int midiChannel) else { for (int i = 0; i < 128; ++i) - noteOff (midiChannel, i); + noteOff (midiChannel, i, 0.0f); } } @@ -130,12 +130,12 @@ void MidiKeyboardState::processNextMidiEvent (const MidiMessage& message) } else if (message.isNoteOff()) { - noteOffInternal (message.getChannel(), message.getNoteNumber()); + noteOffInternal (message.getChannel(), message.getNoteNumber(), message.getFloatVelocity()); } else if (message.isAllNotesOff()) { for (int i = 0; i < 128; ++i) - noteOffInternal (message.getChannel(), i); + noteOffInternal (message.getChannel(), i, 0.0f); } } diff --git a/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h b/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h index 885b7d88f..8ac030ce1 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h +++ b/source/modules/juce_audio_basics/midi/juce_MidiKeyboardState.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -64,7 +64,7 @@ public: careful not to block, and avoid any UI activity in the callback. */ virtual void handleNoteOff (MidiKeyboardState* source, - int midiChannel, int midiNoteNumber) = 0; + int midiChannel, int midiNoteNumber, float velocity) = 0; }; @@ -135,7 +135,7 @@ public: But if the note isn't acutally down for the given channel, this method will in fact do nothing. */ - void noteOff (int midiChannel, int midiNoteNumber); + void noteOff (int midiChannel, int midiNoteNumber, float velocity); /** This will turn off any currently-down notes for the given midi channel. @@ -196,7 +196,7 @@ private: Array listeners; void noteOnInternal (int midiChannel, int midiNoteNumber, float velocity); - void noteOffInternal (int midiChannel, int midiNoteNumber); + void noteOffInternal (int midiChannel, int midiNoteNumber, float velocity); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardState) }; diff --git a/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp b/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp index 07e2ccd27..e8adb9a80 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp +++ b/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -33,6 +33,11 @@ namespace MidiHelpers { return (uint8) jlimit (0, 127, v); } + + inline uint8 floatVelocityToByte (const float v) noexcept + { + return validVelocity (roundToInt (v * 127.0f)); + } } //============================================================================== @@ -386,7 +391,7 @@ float MidiMessage::getFloatVelocity() const noexcept void MidiMessage::setVelocity (const float newVelocity) noexcept { if (isNoteOnOrOff()) - getData()[2] = MidiHelpers::validVelocity (roundToInt (newVelocity * 127.0f)); + getData()[2] = MidiHelpers::floatVelocityToByte (newVelocity); } void MidiMessage::multiplyVelocity (const float scaleFactor) noexcept @@ -522,11 +527,6 @@ MidiMessage MidiMessage::controllerEvent (const int channel, const int controlle controllerType & 127, value & 127); } -MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) noexcept -{ - return noteOn (channel, noteNumber, (uint8) (velocity * 127.0f + 0.5f)); -} - MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const uint8 velocity) noexcept { jassert (channel > 0 && channel <= 16); @@ -536,6 +536,11 @@ MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const noteNumber & 127, MidiHelpers::validVelocity (velocity)); } +MidiMessage MidiMessage::noteOn (const int channel, const int noteNumber, const float velocity) noexcept +{ + return noteOn (channel, noteNumber, MidiHelpers::floatVelocityToByte (velocity)); +} + MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 velocity) noexcept { jassert (channel > 0 && channel <= 16); @@ -545,6 +550,19 @@ MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, uint8 noteNumber & 127, MidiHelpers::validVelocity (velocity)); } +MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber, float velocity) noexcept +{ + return noteOff (channel, noteNumber, MidiHelpers::floatVelocityToByte (velocity)); +} + +MidiMessage MidiMessage::noteOff (const int channel, const int noteNumber) noexcept +{ + jassert (channel > 0 && channel <= 16); + jassert (isPositiveAndBelow (noteNumber, (int) 128)); + + return MidiMessage (MidiHelpers::initialByte (0x80, channel), noteNumber & 127, 0); +} + MidiMessage MidiMessage::allNotesOff (const int channel) noexcept { return controllerEvent (channel, 123, 0); diff --git a/source/modules/juce_audio_basics/midi/juce_MidiMessage.h b/source/modules/juce_audio_basics/midi/juce_MidiMessage.h index 9002aa033..61e084b73 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiMessage.h +++ b/source/modules/juce_audio_basics/midi/juce_MidiMessage.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -234,6 +234,15 @@ public: */ bool isNoteOff (bool returnTrueForNoteOnVelocity0 = true) const noexcept; + /** Creates a key-up message. + + @param channel the midi channel, in the range 1 to 16 + @param noteNumber the key number, 0 to 127 + @param velocity in the range 0 to 1.0 + @see isNoteOff + */ + static MidiMessage noteOff (int channel, int noteNumber, float velocity) noexcept; + /** Creates a key-up message. @param channel the midi channel, in the range 1 to 16 @@ -241,7 +250,15 @@ public: @param velocity in the range 0 to 127 @see isNoteOff */ - static MidiMessage noteOff (int channel, int noteNumber, uint8 velocity = 0) noexcept; + static MidiMessage noteOff (int channel, int noteNumber, uint8 velocity) noexcept; + + /** Creates a key-up message. + + @param channel the midi channel, in the range 1 to 16 + @param noteNumber the key number, 0 to 127 + @see isNoteOff + */ + static MidiMessage noteOff (int channel, int noteNumber) noexcept; /** Returns true if this message is a 'key-down' or 'key-up' event. diff --git a/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp b/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp index 51efd7f1f..dcac30e77 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp +++ b/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h b/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h index fe11dd1ba..5d2f977a5 100644 --- a/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h +++ b/source/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_AudioSource.h b/source/modules/juce_audio_basics/sources/juce_AudioSource.h index cfbd59fe9..9708530d2 100644 --- a/source/modules/juce_audio_basics/sources/juce_AudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_AudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp index 21dc173a6..c47cc5e55 100644 --- a/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h b/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h index b0ab4d2f7..4d507d713 100644 --- a/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_BufferingAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp index 7e0a58cb4..ac06074c0 100644 --- a/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h b/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h index 483fe99de..1c44aa43c 100644 --- a/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_ChannelRemappingAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp index 08e87f0c1..4305a393c 100644 --- a/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h b/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h index 40844c568..ef3da9352 100644 --- a/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_IIRFilterAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp index 60ae1919f..14a3f8757 100644 --- a/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.h b/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.h index f581ac31e..98269c532 100644 --- a/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_MixerAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h b/source/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h index 2213722bd..2084f0be9 100644 --- a/source/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_PositionableAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp index 0ff01211a..d4b68e3c2 100644 --- a/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h b/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h index 09d27a875..09491cb1f 100644 --- a/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp index d63007537..470185552 100644 --- a/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h b/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h index 6b90e184a..547a44e8a 100644 --- a/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_ReverbAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp b/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp index a0e04eff2..05ec2559c 100644 --- a/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp +++ b/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h b/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h index 5d09ad8ee..c45143da4 100644 --- a/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h +++ b/source/modules/juce_audio_basics/sources/juce_ToneGeneratorAudioSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp b/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp index c77df9065..16ef359ac 100644 --- a/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp +++ b/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index 8756c3e65..f255fa360 100644 --- a/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/source/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -571,7 +571,6 @@ protected: int midiNoteNumber) const; /** Starts a specified voice playing a particular sound. - You'll probably never need to call this, it's used internally by noteOn(), but may be needed by subclasses for custom behaviours. */ @@ -581,6 +580,13 @@ protected: int midiNoteNumber, float velocity); + /** Stops a given voice. + You should never need to call this, it's used internally by noteOff, but is protected + in case it's useful for some custom subclasses. It basically just calls through to + SynthesiserVoice::stopNote(), and has some assertions to sanity-check a few things. + */ + void stopVoice (SynthesiserVoice*, float velocity, bool allowTailOff); + /** Can be overridden to do custom handling of incoming midi events. */ virtual void handleMidiEvent (const MidiMessage&); @@ -592,8 +598,6 @@ private: bool shouldStealNotes; BigInteger sustainPedalsDown; - void stopVoice (SynthesiserVoice*, float velocity, bool allowTailOff); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE // Note the new parameters for these methods. virtual int findFreeVoice (const bool) const { return 0; } diff --git a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDBurner.h b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDBurner.h index 88b1ef267..fae2cd06c 100644 --- a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDBurner.h +++ b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDBurner.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.cpp b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.cpp index ca9c5b0f2..b9d798789 100644 --- a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.cpp +++ b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.h b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.h index 0e868dba6..bcf0f4808 100644 --- a/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.h +++ b/source/modules/juce_audio_devices/audio_cd/juce_AudioCDReader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp index f129775aa..9d03ac08e 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h b/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h index 639489b71..978ed3508 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp b/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp index 95221ba03..990550e87 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h b/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h index 8ce41d091..921c57dad 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioIODevice.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp b/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp index bdce8f45d..0df87ebad 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h b/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h index debfdb22e..73b8afcf6 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h +++ b/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h b/source/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h index 689e1f291..50889767d 100644 --- a/source/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h +++ b/source/modules/juce_audio_devices/audio_io/juce_SystemAudioVolume.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/juce_audio_devices.cpp b/source/modules/juce_audio_devices/juce_audio_devices.cpp index d35e6608e..2bc3c6a09 100644 --- a/source/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/source/modules/juce_audio_devices/juce_audio_devices.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/juce_audio_devices.h b/source/modules/juce_audio_devices/juce_audio_devices.h index fd63c6ff7..249f6b2d3 100644 --- a/source/modules/juce_audio_devices/juce_audio_devices.h +++ b/source/modules/juce_audio_devices/juce_audio_devices.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/midi_io/juce_MidiInput.h b/source/modules/juce_audio_devices/midi_io/juce_MidiInput.h index 9b238b369..0c5a5b62e 100644 --- a/source/modules/juce_audio_devices/midi_io/juce_MidiInput.h +++ b/source/modules/juce_audio_devices/midi_io/juce_MidiInput.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp b/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp index 28e81c0eb..11b4dd94a 100644 --- a/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp +++ b/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -33,12 +33,12 @@ MidiMessageCollector::~MidiMessageCollector() } //============================================================================== -void MidiMessageCollector::reset (const double sampleRate_) +void MidiMessageCollector::reset (const double newSampleRate) { - jassert (sampleRate_ > 0); + jassert (newSampleRate > 0); const ScopedLock sl (midiCallbackLock); - sampleRate = sampleRate_; + sampleRate = newSampleRate; incomingMessages.clear(); lastCallbackTime = Time::getMillisecondCounterHiRes(); } @@ -139,9 +139,9 @@ void MidiMessageCollector::handleNoteOn (MidiKeyboardState*, int midiChannel, in addMessageToQueue (m); } -void MidiMessageCollector::handleNoteOff (MidiKeyboardState*, int midiChannel, int midiNoteNumber) +void MidiMessageCollector::handleNoteOff (MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) { - MidiMessage m (MidiMessage::noteOff (midiChannel, midiNoteNumber)); + MidiMessage m (MidiMessage::noteOff (midiChannel, midiNoteNumber, velocity)); m.setTimeStamp (Time::getMillisecondCounterHiRes() * 0.001); addMessageToQueue (m); diff --git a/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h b/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h index 5b1673779..75bcc81ff 100644 --- a/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h +++ b/source/modules/juce_audio_devices/midi_io/juce_MidiMessageCollector.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -86,7 +86,7 @@ public: /** @internal */ void handleNoteOn (MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) override; /** @internal */ - void handleNoteOff (MidiKeyboardState*, int midiChannel, int midiNoteNumber) override; + void handleNoteOff (MidiKeyboardState*, int midiChannel, int midiNoteNumber, float velocity) override; /** @internal */ void handleIncomingMidiMessage (MidiInput*, const MidiMessage&) override; diff --git a/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp b/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp index 0af7d1b7c..4881afbdd 100644 --- a/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp +++ b/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -32,10 +32,11 @@ struct MidiOutput::PendingMessage PendingMessage* next; }; -MidiOutput::MidiOutput() +MidiOutput::MidiOutput(const String& midiName) : Thread ("midi out"), internal (nullptr), - firstMessage (nullptr) + firstMessage (nullptr), + name (midiName) { } diff --git a/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.h b/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.h index ff23d68b0..d22926992 100644 --- a/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.h +++ b/source/modules/juce_audio_devices/midi_io/juce_MidiOutput.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -84,6 +84,9 @@ public: /** Destructor. */ ~MidiOutput(); + /** Returns the name of this device. */ + const String& getName() const noexcept { return name; } + /** Makes this device output a midi message. @see MidiMessage */ @@ -131,8 +134,9 @@ private: CriticalSection lock; struct PendingMessage; PendingMessage* firstMessage; + String name; - MidiOutput(); // These objects are created with the openDevice() method. + MidiOutput(const String& midiName); // These objects are created with the openDevice() method. void run() override; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiOutput) diff --git a/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h b/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h index 4dc70b9bb..0cefb83b1 100644 --- a/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h +++ b/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_android_Audio.cpp b/source/modules/juce_audio_devices/native/juce_android_Audio.cpp index 80711da9e..d32f5cf70 100644 --- a/source/modules/juce_audio_devices/native/juce_android_Audio.cpp +++ b/source/modules/juce_audio_devices/native/juce_android_Audio.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_android_Midi.cpp b/source/modules/juce_audio_devices/native/juce_android_Midi.cpp index 88eeae6ed..59ddf3edb 100644 --- a/source/modules/juce_audio_devices/native/juce_android_Midi.cpp +++ b/source/modules/juce_audio_devices/native/juce_android_Midi.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp b/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp index 123ab6dc0..f4c09bb71 100644 --- a/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp +++ b/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_ios_Audio.cpp b/source/modules/juce_audio_devices/native/juce_ios_Audio.cpp index 70490aa54..16dba0c36 100644 --- a/source/modules/juce_audio_devices/native/juce_ios_Audio.cpp +++ b/source/modules/juce_audio_devices/native/juce_ios_Audio.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/source/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index dbde72ed4..85fb8c514 100644 --- a/source/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/source/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_linux_AudioCDReader.cpp b/source/modules/juce_audio_devices/native/juce_linux_AudioCDReader.cpp index a64533301..938486b61 100644 --- a/source/modules/juce_audio_devices/native/juce_linux_AudioCDReader.cpp +++ b/source/modules/juce_audio_devices/native/juce_linux_AudioCDReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp b/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp index 38ad64df9..ac9846f13 100644 --- a/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp +++ b/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_linux_Midi.cpp b/source/modules/juce_audio_devices/native/juce_linux_Midi.cpp index 87aba6d69..801a3b1c5 100644 --- a/source/modules/juce_audio_devices/native/juce_linux_Midi.cpp +++ b/source/modules/juce_audio_devices/native/juce_linux_Midi.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -497,7 +497,7 @@ MidiOutput* MidiOutput::openDevice (int deviceIndex) if (port.isValid()) { - newDevice = new MidiOutput(); + newDevice = new MidiOutput (devices [deviceIndex]); newDevice->internal = new MidiOutputDevice (newDevice, port); } @@ -512,7 +512,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) if (port.isValid()) { - newDevice = new MidiOutput(); + newDevice = new MidiOutput (deviceName); newDevice->internal = new MidiOutputDevice (newDevice, port); } diff --git a/source/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm b/source/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm index 8dd7bfad1..3489a8040 100644 --- a/source/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm +++ b/source/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm b/source/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm index 447c98b88..8d87fac11 100644 --- a/source/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm +++ b/source/modules/juce_audio_devices/native/juce_mac_AudioCDReader.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index a9e3ddde0..f0b217d34 100644 --- a/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -28,10 +28,15 @@ #define JUCE_COREAUDIOLOG(a) #endif +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wnonnull" // aovid some spurious 10.11 SDK warnings +#endif + //============================================================================== struct SystemVol { - SystemVol (AudioObjectPropertySelector selector) + SystemVol (AudioObjectPropertySelector selector) noexcept : outputDeviceID (kAudioObjectUnknown) { addr.mScope = kAudioObjectPropertyScopeGlobal; @@ -56,7 +61,7 @@ struct SystemVol } } - float getGain() + float getGain() const noexcept { Float32 gain = 0; @@ -70,7 +75,7 @@ struct SystemVol return (float) gain; } - bool setGain (float gain) + bool setGain (float gain) const noexcept { if (outputDeviceID != kAudioObjectUnknown && canSetVolume()) { @@ -84,7 +89,7 @@ struct SystemVol return false; } - bool isMuted() + bool isMuted() const noexcept { UInt32 muted = 0; @@ -98,7 +103,7 @@ struct SystemVol return muted != 0; } - bool setMuted (bool mute) + bool setMuted (bool mute) const noexcept { if (outputDeviceID != kAudioObjectUnknown && canSetVolume()) { @@ -116,7 +121,7 @@ private: AudioDeviceID outputDeviceID; AudioObjectPropertyAddress addr; - bool canSetVolume() + bool canSetVolume() const noexcept { Boolean isSettable = NO; return AudioHardwareServiceIsPropertySettable (outputDeviceID, &addr, &isSettable) == noErr @@ -124,6 +129,10 @@ private: } }; +#ifdef __clang__ + #pragma clang diagnostic pop +#endif + #define JUCE_SYSTEMAUDIOVOL_IMPLEMENTED 1 float JUCE_CALLTYPE SystemAudioVolume::getGain() { return SystemVol (kAudioHardwareServiceDeviceProperty_VirtualMasterVolume).getGain(); } bool JUCE_CALLTYPE SystemAudioVolume::setGain (float gain) { return SystemVol (kAudioHardwareServiceDeviceProperty_VirtualMasterVolume).setGain (gain); } diff --git a/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp b/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp index dee763316..d1ad9370e 100644 --- a/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp +++ b/source/modules/juce_audio_devices/native/juce_mac_CoreMidi.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -332,10 +332,11 @@ MidiOutput* MidiOutput::openDevice (int index) { MIDIClientRef client = CoreMidiHelpers::getGlobalMidiClient(); MIDIPortRef port; + String deviceName = CoreMidiHelpers::getConnectedEndpointName (endPoint); if (client != 0 && CHECK_ERROR (MIDIOutputPortCreate (client, pname.cfString, &port))) { - mo = new MidiOutput(); + mo = new MidiOutput (deviceName); mo->internal = new CoreMidiHelpers::MidiPortAndEndpoint (port, endPoint); } } @@ -354,7 +355,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) if (client != 0 && CHECK_ERROR (MIDISourceCreate (client, name.cfString, &endPoint))) { - MidiOutput* mo = new MidiOutput(); + MidiOutput* mo = new MidiOutput (deviceName); mo->internal = new CoreMidiHelpers::MidiPortAndEndpoint (0, endPoint); return mo; } diff --git a/source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index 44bab4273..321abdc44 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_win32_AudioCDBurner.cpp b/source/modules/juce_audio_devices/native/juce_win32_AudioCDBurner.cpp index 3c3befb80..03a3c326b 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_AudioCDBurner.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_AudioCDBurner.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_win32_AudioCDReader.cpp b/source/modules/juce_audio_devices/native/juce_win32_AudioCDReader.cpp index 064ca9148..fe9076a7a 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_AudioCDReader.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_AudioCDReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp b/source/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp index 88a5960fe..1491ab290 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -640,7 +640,7 @@ public: DWORD dwsize1 = 0; DWORD dwsize2 = 0; - HRESULT hr = pInputBuffer->Lock ((DWORD) readOffset, (DWORD) bytesPerBuffer, + hr = pInputBuffer->Lock ((DWORD) readOffset, (DWORD) bytesPerBuffer, (void**) &buf1, &dwsize1, (void**) &buf2, &dwsize2, 0); @@ -753,9 +753,9 @@ public: String open (const BigInteger& inputChannels, const BigInteger& outputChannels, - double sampleRate, int bufferSizeSamples) override + double newSampleRate, int newBufferSize) override { - lastError = openDevice (inputChannels, outputChannels, sampleRate, bufferSizeSamples); + lastError = openDevice (inputChannels, outputChannels, newSampleRate, newBufferSize); isOpen_ = lastError.isEmpty(); return lastError; diff --git a/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp b/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp index 2737b1e66..042c98d01 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -143,37 +143,37 @@ private: public: MidiHeader() {} - void prepare (HMIDIIN deviceHandle) + void prepare (HMIDIIN device) { zerostruct (hdr); hdr.lpData = data; hdr.dwBufferLength = (DWORD) numElementsInArray (data); - midiInPrepareHeader (deviceHandle, &hdr, sizeof (hdr)); + midiInPrepareHeader (device, &hdr, sizeof (hdr)); } - void unprepare (HMIDIIN deviceHandle) + void unprepare (HMIDIIN device) { if ((hdr.dwFlags & WHDR_DONE) != 0) { int c = 10; - while (--c >= 0 && midiInUnprepareHeader (deviceHandle, &hdr, sizeof (hdr)) == MIDIERR_STILLPLAYING) + while (--c >= 0 && midiInUnprepareHeader (device, &hdr, sizeof (hdr)) == MIDIERR_STILLPLAYING) Thread::sleep (20); jassert (c >= 0); } } - void write (HMIDIIN deviceHandle) + void write (HMIDIIN device) { hdr.dwBytesRecorded = 0; - midiInAddBuffer (deviceHandle, &hdr, sizeof (hdr)); + midiInAddBuffer (device, &hdr, sizeof (hdr)); } - void writeIfFinished (HMIDIIN deviceHandle) + void writeIfFinished (HMIDIIN device) { if ((hdr.dwFlags & WHDR_DONE) != 0) - write (deviceHandle); + write (device); } private: @@ -362,6 +362,7 @@ MidiOutput* MidiOutput::openDevice (int index) UINT deviceId = MIDI_MAPPER; const UINT num = midiOutGetNumDevs(); int n = 0; + String deviceName; for (UINT i = 0; i < num; ++i) { @@ -369,13 +370,16 @@ MidiOutput* MidiOutput::openDevice (int index) if (midiOutGetDevCaps (i, &mc, sizeof (mc)) == MMSYSERR_NOERROR) { + String name = String (mc.szPname, sizeof (mc.szPname)); + // use the microsoft sw synth as a default - best not to allow deviceId // to be MIDI_MAPPER, or else device sharing breaks - if (String (mc.szPname, sizeof (mc.szPname)).containsIgnoreCase ("microsoft")) + if (name.containsIgnoreCase ("microsoft")) deviceId = i; if (index == n) { + deviceName = name; deviceId = i; break; } @@ -392,7 +396,7 @@ MidiOutput* MidiOutput::openDevice (int index) { han->refCount++; - MidiOutput* const out = new MidiOutput(); + MidiOutput* const out = new MidiOutput (deviceName); out->internal = han; return out; } @@ -411,7 +415,7 @@ MidiOutput* MidiOutput::openDevice (int index) han->handle = h; MidiOutHandle::activeHandles.add (han); - MidiOutput* const out = new MidiOutput(); + MidiOutput* const out = new MidiOutput (deviceName); out->internal = han; return out; } diff --git a/source/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp b/source/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp index 875ce6192..1b2a4ad49 100644 --- a/source/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp +++ b/source/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -547,13 +547,13 @@ private: //============================================================================== ComSmartPtr createClient() { - ComSmartPtr client; + ComSmartPtr newClient; if (device != nullptr) logFailure (device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, - nullptr, (void**) client.resetAndGetPointerAddress())); + nullptr, (void**) newClient.resetAndGetPointerAddress())); - return client; + return newClient; } struct AudioSampleFormat @@ -563,8 +563,8 @@ private: int bytesPerSampleContainer; }; - bool tryFormat (const AudioSampleFormat sampleFormat, IAudioClient* clientToUse, double sampleRate, - DWORD mixFormatChannelMask, WAVEFORMATEXTENSIBLE& format) const + bool tryFormat (const AudioSampleFormat sampleFormat, IAudioClient* clientToUse, double newSampleRate, + DWORD newMixFormatChannelMask, WAVEFORMATEXTENSIBLE& format) const { zerostruct (format); @@ -578,14 +578,14 @@ private: format.Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); } - format.Format.nSamplesPerSec = (DWORD) sampleRate; + format.Format.nSamplesPerSec = (DWORD) newSampleRate; format.Format.nChannels = (WORD) numChannels; format.Format.wBitsPerSample = (WORD) (8 * sampleFormat.bytesPerSampleContainer); format.Samples.wValidBitsPerSample = (WORD) (sampleFormat.bitsPerSampleToTry); format.Format.nBlockAlign = (WORD) (format.Format.nChannels * format.Format.wBitsPerSample / 8); format.Format.nAvgBytesPerSec = (DWORD) (format.Format.nSamplesPerSec * format.Format.nBlockAlign); format.SubFormat = sampleFormat.useFloat ? KSDATAFORMAT_SUBTYPE_IEEE_FLOAT : KSDATAFORMAT_SUBTYPE_PCM; - format.dwChannelMask = mixFormatChannelMask; + format.dwChannelMask = newMixFormatChannelMask; WAVEFORMATEXTENSIBLE* nearestFormat = nullptr; @@ -605,8 +605,8 @@ private: return check (hr); } - bool findSupportedFormat (IAudioClient* clientToUse, double sampleRate, - DWORD mixFormatChannelMask, WAVEFORMATEXTENSIBLE& format) const + bool findSupportedFormat (IAudioClient* clientToUse, double newSampleRate, + DWORD newMixFormatChannelMask, WAVEFORMATEXTENSIBLE& format) const { static const AudioSampleFormat formats[] = { @@ -620,7 +620,7 @@ private: }; for (int i = 0; i < numElementsInArray (formats); ++i) - if (tryFormat (formats[i], clientToUse, sampleRate, mixFormatChannelMask, format)) + if (tryFormat (formats[i], clientToUse, newSampleRate, newMixFormatChannelMask, format)) return true; return false; @@ -1523,10 +1523,10 @@ private: } //============================================================================== - void scan (StringArray& outputDeviceNames, - StringArray& inputDeviceNames, - StringArray& outputDeviceIds, - StringArray& inputDeviceIds) + void scan (StringArray& outDeviceNames, + StringArray& inDeviceNames, + StringArray& outDeviceIds, + StringArray& inDeviceIds) { if (enumerator == nullptr) { @@ -1582,19 +1582,19 @@ private: if (flow == eRender) { const int index = (deviceId == defaultRenderer) ? 0 : -1; - outputDeviceIds.insert (index, deviceId); - outputDeviceNames.insert (index, name); + outDeviceIds.insert (index, deviceId); + outDeviceNames.insert (index, name); } else if (flow == eCapture) { const int index = (deviceId == defaultCapture) ? 0 : -1; - inputDeviceIds.insert (index, deviceId); - inputDeviceNames.insert (index, name); + inDeviceIds.insert (index, deviceId); + inDeviceNames.insert (index, name); } } - inputDeviceNames.appendNumbersToDuplicates (false, false); - outputDeviceNames.appendNumbersToDuplicates (false, false); + inDeviceNames.appendNumbersToDuplicates (false, false); + outDeviceNames.appendNumbersToDuplicates (false, false); } //============================================================================== diff --git a/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp b/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp index c35179533..2e231d7c5 100644 --- a/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp +++ b/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h b/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h index 0a3751c51..02e444949 100644 --- a/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h +++ b/source/modules/juce_audio_devices/sources/juce_AudioSourcePlayer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp b/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp index feb58a983..9e013ef56 100644 --- a/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp +++ b/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.h b/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.h index e60dee013..d964d9200 100644 --- a/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.h +++ b/source/modules/juce_audio_devices/sources/juce_AudioTransportSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c b/source/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c index 46db9e3a5..4eac42e95 100644 --- a/source/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c +++ b/source/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c @@ -244,7 +244,11 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) struct sigaction sigill_save; struct sigaction sigill_sse; sigill_sse.sa_sigaction = sigill_handler_sse_os; + #ifdef __ANDROID__ + sigemptyset (&sigill_sse.sa_mask); + #else __sigemptyset(&sigill_sse.sa_mask); + #endif sigill_sse.sa_flags = SA_SIGINFO | SA_RESETHAND; /* SA_RESETHAND just in case our SIGILL return jump breaks, so we don't get stuck in a loop */ if(0 == sigaction(SIGILL, &sigill_sse, &sigill_save)) { diff --git a/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp index 9fb45ad22..563a15edb 100644 --- a/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h index 01d1484b4..fe475e31e 100644 --- a/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp index 6d3aafa1c..9b4d556d0 100644 --- a/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h index 60bace485..8ae56fc6e 100644 --- a/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_CoreAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp index 58fdd8fbc..34e6a3bb0 100644 --- a/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h index 20bf094f9..68f1628ea 100644 --- a/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp index 105e0a6cf..c7468fbeb 100644 --- a/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h index 92e581b08..77e6be61f 100644 --- a/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp index 524ecf351..cf6fad623 100644 --- a/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -25,8 +25,8 @@ /* IMPORTANT DISCLAIMER: By choosing to enable the JUCE_USE_MP3AUDIOFORMAT flag and to compile this MP3 code into your software, you do so AT YOUR OWN RISK! By doing so, - you are agreeing that Raw Material Software is in no way responsible for any patent, - copyright, or other legal issues that you may suffer as a result. + you are agreeing that ROLI Ltd. is in no way responsible for any patent, copyright, + or other legal issues that you may suffer as a result. The code in juce_MP3AudioFormat.cpp is NOT guaranteed to be free from infringements of 3rd-party intellectual property. If you wish to use it, please seek your own independent advice about the diff --git a/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h index e89c05db3..d3cd792ea 100644 --- a/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -30,8 +30,8 @@ IMPORTANT DISCLAIMER: By choosing to enable the JUCE_USE_MP3AUDIOFORMAT flag and to compile the MP3 code into your software, you do so AT YOUR OWN RISK! By doing so, - you are agreeing that Raw Material Software is in no way responsible for any patent, - copyright, or other legal issues that you may suffer as a result. + you are agreeing that ROLI Ltd. is in no way responsible for any patent, copyright, + or other legal issues that you may suffer as a result. The code in juce_MP3AudioFormat.cpp is NOT guaranteed to be free from infringements of 3rd-party intellectual property. If you wish to use it, please seek your own independent advice about the diff --git a/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp index 7cc12a489..6d1f92af2 100644 --- a/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -33,7 +33,7 @@ namespace OggVorbisNamespace #if JUCE_INCLUDE_OGGVORBIS_CODE || ! defined (JUCE_INCLUDE_OGGVORBIS_CODE) #if JUCE_MSVC #pragma warning (push) - #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706 4995 4365) + #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706 4995 4365 4456 4457 4459) #endif #if JUCE_CLANG diff --git a/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h index 03bc3fb6d..9d575e074 100644 --- a/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.cpp index 59c2253c6..b87c05d6f 100644 --- a/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.h index 6ef6a4edb..a7cd60b7c 100644 --- a/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_QuickTimeAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp index a926521e6..24ad58c52 100644 --- a/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h index 62de05a89..ff0ca946d 100644 --- a/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_WavAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp b/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp index f5f566483..746ce640b 100644 --- a/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp +++ b/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h b/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h index 8c10ee12d..88cd4380a 100644 --- a/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h +++ b/source/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/codecs/oggvorbis/bitwise.c b/source/modules/juce_audio_formats/codecs/oggvorbis/bitwise.c index 710a5604c..3f5244f44 100644 --- a/source/modules/juce_audio_formats/codecs/oggvorbis/bitwise.c +++ b/source/modules/juce_audio_formats/codecs/oggvorbis/bitwise.c @@ -15,6 +15,10 @@ ********************************************************************/ +#ifdef JUCE_MSVC + #pragma warning (disable: 4456 4457 4459) +#endif + /* We're 'LSb' endian; if we write a word but read individual bits, then we'll read the lsb first */ diff --git a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/floor1.c b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/floor1.c index 644b852c8..68967f4bb 100644 --- a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/floor1.c +++ b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/floor1.c @@ -15,6 +15,10 @@ ********************************************************************/ +#ifdef JUCE_MSVC + #pragma warning (disable: 4456 4457 4459) +#endif + #include #include #include diff --git a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c index 2f27b8609..2b5e76e23 100644 --- a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c +++ b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/sharedbook.c @@ -15,6 +15,10 @@ ********************************************************************/ +#ifdef JUCE_MSVC + #pragma warning (disable: 4456 4457 4459) +#endif + #include #include #include diff --git a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/vorbisfile.c b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/vorbisfile.c index 79b668855..83af2e887 100644 --- a/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/vorbisfile.c +++ b/source/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/vorbisfile.c @@ -15,6 +15,10 @@ ********************************************************************/ +#ifdef JUCE_MSVC + #pragma warning (disable: 4456 4457 4459) +#endif + #include #include #include diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormat.cpp b/source/modules/juce_audio_formats/format/juce_AudioFormat.cpp index ad871765a..fc3f9ff17 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormat.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormat.h b/source/modules/juce_audio_formats/format/juce_AudioFormat.h index 39bcbae14..fee1e0679 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormat.h +++ b/source/modules/juce_audio_formats/format/juce_AudioFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp b/source/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp index f0196c863..c51ebcb27 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatManager.h b/source/modules/juce_audio_formats/format/juce_AudioFormatManager.h index f560347d6..3ad92131a 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatManager.h +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp b/source/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp index fd0a7e6cc..498c79e1e 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatReader.h b/source/modules/juce_audio_formats/format/juce_AudioFormatReader.h index 9d63f03d4..9a972cf27 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatReader.h +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatReader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp b/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp index fb086ef8e..35ddeeb64 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h b/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h index 1569ede86..c7f74bbb8 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatReaderSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp b/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp index 065f36afa..508207010 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.h b/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.h index 9098c75fb..dac12af37 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.h +++ b/source/modules/juce_audio_formats/format/juce_AudioFormatWriter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -76,7 +76,7 @@ public: /** Writes a set of samples to the audio stream. Note that if you're trying to write the contents of an AudioSampleBuffer, you - can use AudioSampleBuffer::writeToAudioWriter(). + can use writeFromAudioSampleBuffer(). @param samplesToWrite an array of arrays containing the sample data for each channel to write. This is a zero-terminated diff --git a/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp b/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp index 296f55f86..9ca17249b 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp +++ b/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h b/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h index a666f4f0e..4293c45dc 100644 --- a/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h +++ b/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp b/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp index 38fc70435..ca1e6d8ed 100644 --- a/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp +++ b/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h b/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h index 8f950be63..a8f595540 100644 --- a/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h +++ b/source/modules/juce_audio_formats/format/juce_BufferingAudioFormatReader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h b/source/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h index f245a02ce..a63869bdd 100644 --- a/source/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h +++ b/source/modules/juce_audio_formats/format/juce_MemoryMappedAudioFormatReader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/juce_audio_formats.cpp b/source/modules/juce_audio_formats/juce_audio_formats.cpp index b68042ff6..8a157b6a9 100644 --- a/source/modules/juce_audio_formats/juce_audio_formats.cpp +++ b/source/modules/juce_audio_formats/juce_audio_formats.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/juce_audio_formats.h b/source/modules/juce_audio_formats/juce_audio_formats.h index c15194e46..13cc25f7a 100644 --- a/source/modules/juce_audio_formats/juce_audio_formats.h +++ b/source/modules/juce_audio_formats/juce_audio_formats.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -50,8 +50,8 @@ Enables the software-based MP3AudioFormat class. IMPORTANT DISCLAIMER: By choosing to enable the JUCE_USE_MP3AUDIOFORMAT flag and to compile this MP3 code into your software, you do so AT YOUR OWN RISK! By doing so, you are agreeing - that Raw Material Software is in no way responsible for any patent, copyright, or other - legal issues that you may suffer as a result. + that ROLI Ltd. is in no way responsible for any patent, copyright, or other legal issues + that you may suffer as a result. The code in juce_MP3AudioFormat.cpp is NOT guaranteed to be free from infringements of 3rd-party intellectual property. If you wish to use it, please seek your own independent advice about the diff --git a/source/modules/juce_audio_formats/sampler/juce_Sampler.cpp b/source/modules/juce_audio_formats/sampler/juce_Sampler.cpp index d2f1ace73..7440c16f3 100644 --- a/source/modules/juce_audio_formats/sampler/juce_Sampler.cpp +++ b/source/modules/juce_audio_formats/sampler/juce_Sampler.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_formats/sampler/juce_Sampler.h b/source/modules/juce_audio_formats/sampler/juce_Sampler.h index cf1c5e2fc..74a8afc5f 100644 --- a/source/modules/juce_audio_formats/sampler/juce_Sampler.h +++ b/source/modules/juce_audio_formats/sampler/juce_Sampler.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp b/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp index cbd25424a..9b534a8b7 100644 --- a/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp +++ b/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.h b/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.h index d0af2013c..8f299a881 100644 --- a/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.h +++ b/source/modules/juce_audio_processors/format/juce_AudioPluginFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index 0afa7c793..e27f128ea 100644 --- a/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h b/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h index a6f1607d1..f810f32f8 100644 --- a/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h +++ b/source/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index 46c2b10ee..b0738edb8 100644 --- a/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index dc39bd1bc..035220d91 100644 --- a/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index 8479bc3b3..71d99b596 100644 --- a/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h b/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h index 21d316772..15c10957f 100644 --- a/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h +++ b/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_VST3Common.h b/source/modules/juce_audio_processors/format_types/juce_VST3Common.h index 7875daaac..e4769807c 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/source/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -60,12 +60,17 @@ static bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexc } //============================================================================== -static juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); } -static juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); } +inline juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); } +inline juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); } // NB: The casts are handled by a Steinberg::UString operator -static juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast (string)); } -static juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast (string)); } +inline juce::String toString (const Steinberg::UString128& string) noexcept { return toString (static_cast (string)); } +inline juce::String toString (const Steinberg::UString256& string) noexcept { return toString (static_cast (string)); } + +static void toString128 (Steinberg::Vst::String128 result, const char* source) +{ + Steinberg::UString (result, 128).fromAscii (source); +} static void toString128 (Steinberg::Vst::String128 result, const juce::String& source) { @@ -391,7 +396,7 @@ namespace VST3BufferExchange channelIndexOffset += numChansForBus; } - static void mapBufferToBusses (Array& result, BusMap& busMapToUse, + inline void mapBufferToBusses (Array& result, BusMap& busMapToUse, const Array& arrangements, AudioSampleBuffer& source) { @@ -402,7 +407,7 @@ namespace VST3BufferExchange arrangements.getUnchecked (i), source); } - static void mapBufferToBusses (Array& result, + inline void mapBufferToBusses (Array& result, Steinberg::Vst::IAudioProcessor& processor, BusMap& busMapToUse, bool isInput, int numBusses, AudioSampleBuffer& source) diff --git a/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h index ffb90e866..51a5649ed 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/source/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -44,6 +44,7 @@ #pragma clang diagnostic ignored "-Woverloaded-virtual" #pragma clang diagnostic ignored "-Wshadow" #pragma clang diagnostic ignored "-Wdeprecated-register" + #pragma clang diagnostic ignored "-Wunused-function" #endif /* These files come with the Steinberg VST3 SDK - to get them, you'll need to @@ -75,6 +76,7 @@ #include #include #include + #include #include #else #include @@ -92,6 +94,7 @@ #include #include #include + #include #include #include #include @@ -110,7 +113,6 @@ namespace Steinberg DEF_CLASS_IID (IPlugView) DEF_CLASS_IID (IPlugFrame) DEF_CLASS_IID (IBStream) - DEF_CLASS_IID (ISizeableStream) DEF_CLASS_IID (IPluginFactory) DEF_CLASS_IID (IPluginFactory2) DEF_CLASS_IID (IPluginFactory3) diff --git a/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index cb4d88424..ff1cff425 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -1691,11 +1691,11 @@ public: outputArrangements.add (getArrangementForBus (processor, false, i)); } - void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock) override + void prepareToPlay (double newSampleRate, int estimatedSamplesPerBlock) override { // Avoid redundantly calling things like setActive, which can be a heavy-duty call for some plugins: if (isActive - && getSampleRate() == sampleRate + && getSampleRate() == newSampleRate && getBlockSize() == estimatedSamplesPerBlock) return; @@ -1704,7 +1704,7 @@ public: ProcessSetup setup; setup.symbolicSampleSize = kSample32; setup.maxSamplesPerBlock = estimatedSamplesPerBlock; - setup.sampleRate = sampleRate; + setup.sampleRate = newSampleRate; setup.processMode = isNonRealtime() ? kOffline : kRealtime; warnOnFailure (processor->setupProcessing (setup)); @@ -1737,7 +1737,7 @@ public: // Needed for having the same sample rate in processBlock(); some plugins need this! setPlayConfigDetails (getNumSingleDirectionChannelsFor (component, true, true), getNumSingleDirectionChannelsFor (component, false, true), - sampleRate, estimatedSamplesPerBlock); + newSampleRate, estimatedSamplesPerBlock); setStateForAllBusses (true); @@ -1859,10 +1859,10 @@ public: { if (processor != nullptr) { - const double sampleRate = getSampleRate(); + const double currentSampleRate = getSampleRate(); - if (sampleRate > 0.0) - return jlimit (0, 0x7fffffff, (int) processor->getTailSamples()) / sampleRate; + if (currentSampleRate > 0.0) + return jlimit (0, 0x7fffffff, (int) processor->getTailSamples()) / currentSampleRate; } return 0.0; diff --git a/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index 308ff5ab1..ceabcbc59 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h b/source/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h index f442eab85..bf7bc4b53 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h +++ b/source/modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -184,4 +184,4 @@ private: }; #endif // JUCE_VSTMIDIEVENTLIST_H_INCLUDED -#endif +#endif // JUCE_VSTMIDIEVENTLIST_H_INCLUDED diff --git a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 1820e4696..b2a8179ec 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -895,13 +895,13 @@ public: if (effect == nullptr) return 0.0; - const double sampleRate = getSampleRate(); + const double currentSampleRate = getSampleRate(); - if (sampleRate <= 0) + if (currentSampleRate <= 0) return 0.0; VstIntPtr samples = dispatch (effGetTailSize, 0, 0, 0, 0); - return samples / sampleRate; + return samples / currentSampleRate; } bool acceptsMidi() const override { return wantsMidiMessages; } @@ -986,10 +986,10 @@ public: if (initialised) { - if (AudioPlayHead* const playHead = getPlayHead()) + if (AudioPlayHead* const currentPlayHead = getPlayHead()) { AudioPlayHead::CurrentPositionInfo position; - if (playHead->getCurrentPosition (position)) + if (currentPlayHead->getCurrentPosition (position)) { vstHostTime.samplePos = (double) position.timeInSamples; @@ -2089,13 +2089,13 @@ public: } #endif - static bool reentrant = false; + static bool reentrantGuard = false; - if (! reentrant) + if (! reentrantGuard) { - reentrant = true; + reentrantGuard = true; plugin.dispatch (effEditIdle, 0, 0, 0, 0); - reentrant = false; + reentrantGuard = false; } #if JUCE_LINUX diff --git a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h index 4e4b74417..400d75de5 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h +++ b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/juce_audio_processors.cpp b/source/modules/juce_audio_processors/juce_audio_processors.cpp index 2957e0dad..ca91cd6b6 100644 --- a/source/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/source/modules/juce_audio_processors/juce_audio_processors.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/juce_audio_processors.h b/source/modules/juce_audio_processors/juce_audio_processors.h index 281165680..5ccfe2b83 100644 --- a/source/modules/juce_audio_processors/juce_audio_processors.h +++ b/source/modules/juce_audio_processors/juce_audio_processors.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioPlayHead.h b/source/modules/juce_audio_processors/processors/juce_AudioPlayHead.h index e83a76a93..c54e7c35d 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioPlayHead.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioPlayHead.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h b/source/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h index b7c7b7dc3..675cab452 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/source/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp index 2df116350..4c78894d4 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -312,6 +312,10 @@ void AudioProcessor::addParameter (AudioProcessorParameter* p) p->processor = this; p->parameterIndex = managedParameters.size(); managedParameters.add (p); + + // if you're using parameter objects, then you must not override the + // deprecated getNumParameters() method! + jassert (getNumParameters() == AudioProcessor::getNumParameters()); } void AudioProcessor::suspendProcessing (const bool shouldBeSuspended) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h index 4b6ea8582..62fc0c7da 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -106,6 +106,9 @@ public: Your code must be able to cope with variable-sized blocks, or you're going to get clicks and crashes! + Also note that some hosts will occasionally decide to pass a buffer containing + zero samples, so make sure that your algorithm can deal with that! + If the filter is receiving a midi input, then the midiMessages array will be filled with the midi messages for this block. Each message's timestamp will indicate the message's time, as a number of samples from the start of the block. diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp b/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp index a62541111..07f865e82 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h b/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h index 1755497c3..e043c37be 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp index a3787105a..28abea5dc 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -860,7 +860,7 @@ AudioProcessorGraph::Node::Node (const uint32 nodeID, AudioProcessor* const p) n jassert (processor != nullptr); } -void AudioProcessorGraph::Node::prepare (const double sampleRate, const int blockSize, +void AudioProcessorGraph::Node::prepare (const double newSampleRate, const int newBlockSize, AudioProcessorGraph* const graph) { if (! isPrepared) @@ -870,9 +870,9 @@ void AudioProcessorGraph::Node::prepare (const double sampleRate, const int bloc processor->setPlayConfigDetails (processor->getNumInputChannels(), processor->getNumOutputChannels(), - sampleRate, blockSize); + newSampleRate, newBlockSize); - processor->prepareToPlay (sampleRate, blockSize); + processor->prepareToPlay (newSampleRate, newBlockSize); } } @@ -1362,7 +1362,7 @@ void AudioProcessorGraph::AudioGraphIOProcessor::fillInPluginDescription (Plugin d.uid = d.name.hashCode(); d.category = "I/O devices"; d.pluginFormatName = "Internal"; - d.manufacturerName = "Raw Material Software"; + d.manufacturerName = "ROLI Ltd."; d.version = "1.0"; d.isInstrument = false; diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h b/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h index f6d1a6301..680b86e1f 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -92,7 +92,7 @@ public: Node (uint32 nodeId, AudioProcessor*) noexcept; void setParentGraph (AudioProcessorGraph*) const; - void prepare (double sampleRate, int blockSize, AudioProcessorGraph*); + void prepare (double newSampleRate, int newBlockSize, AudioProcessorGraph*); void unprepare(); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Node) @@ -306,7 +306,7 @@ public: const String getName() const override; void fillInPluginDescription (PluginDescription&) const override; - void prepareToPlay (double sampleRate, int estimatedSamplesPerBlock) override; + void prepareToPlay (double newSampleRate, int estimatedSamplesPerBlock) override; void releaseResources() override; void processBlock (AudioSampleBuffer&, MidiBuffer&) override; diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h b/source/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h index d8ea93c99..a2fe16e14 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorListener.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h b/source/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h index d9d0e6bcd..0140faf57 100644 --- a/source/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h +++ b/source/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp b/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp index 196e9ac9c..e1ba865af 100644 --- a/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp +++ b/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h b/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h index 1189f8802..dc5d8fae5 100644 --- a/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h +++ b/source/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp b/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp index 5eafc07ce..2e647ecd6 100644 --- a/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp +++ b/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/processors/juce_PluginDescription.h b/source/modules/juce_audio_processors/processors/juce_PluginDescription.h index 24b17e5bf..83effceac 100644 --- a/source/modules/juce_audio_processors/processors/juce_PluginDescription.h +++ b/source/modules/juce_audio_processors/processors/juce_PluginDescription.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp b/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp index 081ba11a8..ad37837ce 100644 --- a/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp +++ b/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h b/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h index 3c8df25fd..d04dd894f 100644 --- a/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h +++ b/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp b/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp index a7beea733..805f80930 100644 --- a/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp +++ b/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h b/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h index 762e74259..8087c1ccb 100644 --- a/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h +++ b/source/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index 42c94a38a..8ff304ddf 100644 --- a/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.h b/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.h index e0b2a6de7..a1d6f1d75 100644 --- a/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.h +++ b/source/modules/juce_audio_processors/scanning/juce_PluginListComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_core/containers/juce_AbstractFifo.cpp b/source/modules/juce_core/containers/juce_AbstractFifo.cpp index 65b1615c5..d608fcd1f 100644 --- a/source/modules/juce_core/containers/juce_AbstractFifo.cpp +++ b/source/modules/juce_core/containers/juce_AbstractFifo.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -183,7 +183,7 @@ public: Random random; }; - void runTest() + void runTest() override { beginTest ("AbstractFifo"); diff --git a/source/modules/juce_core/containers/juce_AbstractFifo.h b/source/modules/juce_core/containers/juce_AbstractFifo.h index 5b81a21eb..251a8c2ea 100644 --- a/source/modules/juce_core/containers/juce_AbstractFifo.h +++ b/source/modules/juce_core/containers/juce_AbstractFifo.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_Array.h b/source/modules/juce_core/containers/juce_Array.h index 53584f419..c34b74383 100644 --- a/source/modules/juce_core/containers/juce_Array.h +++ b/source/modules/juce_core/containers/juce_Array.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_ArrayAllocationBase.h b/source/modules/juce_core/containers/juce_ArrayAllocationBase.h index cfbe46467..1a673c988 100644 --- a/source/modules/juce_core/containers/juce_ArrayAllocationBase.h +++ b/source/modules/juce_core/containers/juce_ArrayAllocationBase.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_DynamicObject.cpp b/source/modules/juce_core/containers/juce_DynamicObject.cpp index 3351f19b8..5a4cae7b8 100644 --- a/source/modules/juce_core/containers/juce_DynamicObject.cpp +++ b/source/modules/juce_core/containers/juce_DynamicObject.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_DynamicObject.h b/source/modules/juce_core/containers/juce_DynamicObject.h index 598df6ed6..01336765c 100644 --- a/source/modules/juce_core/containers/juce_DynamicObject.h +++ b/source/modules/juce_core/containers/juce_DynamicObject.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_ElementComparator.h b/source/modules/juce_core/containers/juce_ElementComparator.h index 01dc5b703..41f63ca88 100644 --- a/source/modules/juce_core/containers/juce_ElementComparator.h +++ b/source/modules/juce_core/containers/juce_ElementComparator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_HashMap.h b/source/modules/juce_core/containers/juce_HashMap.h index 07d02b401..c1c098876 100644 --- a/source/modules/juce_core/containers/juce_HashMap.h +++ b/source/modules/juce_core/containers/juce_HashMap.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -46,6 +46,8 @@ struct DefaultHashFunctions int generateHash (const String& key, const int upperLimit) const noexcept { return (int) (((uint32) key.hashCode()) % (uint32) upperLimit); } /** Generates a simple hash from a variant. */ int generateHash (const var& key, const int upperLimit) const noexcept { return generateHash (key.toString(), upperLimit); } + /** Generates a simple hash from a void ptr. */ + int generateHash (const void* key, const int upperLimit) const noexcept { return (int)(((pointer_sized_uint) key) % ((pointer_sized_uint) upperLimit)); } }; diff --git a/source/modules/juce_core/containers/juce_LinkedListPointer.h b/source/modules/juce_core/containers/juce_LinkedListPointer.h index a27e52183..53b89b5d7 100644 --- a/source/modules/juce_core/containers/juce_LinkedListPointer.h +++ b/source/modules/juce_core/containers/juce_LinkedListPointer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_NamedValueSet.cpp b/source/modules/juce_core/containers/juce_NamedValueSet.cpp index 8955b126d..68ba5f88a 100644 --- a/source/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/source/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_NamedValueSet.h b/source/modules/juce_core/containers/juce_NamedValueSet.h index 09ad68ee7..21b75b0e3 100644 --- a/source/modules/juce_core/containers/juce_NamedValueSet.h +++ b/source/modules/juce_core/containers/juce_NamedValueSet.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_OwnedArray.h b/source/modules/juce_core/containers/juce_OwnedArray.h index be7448c8d..aa2f2fbaa 100644 --- a/source/modules/juce_core/containers/juce_OwnedArray.h +++ b/source/modules/juce_core/containers/juce_OwnedArray.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_PropertySet.cpp b/source/modules/juce_core/containers/juce_PropertySet.cpp index 6b02bafb4..057ae872a 100644 --- a/source/modules/juce_core/containers/juce_PropertySet.cpp +++ b/source/modules/juce_core/containers/juce_PropertySet.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_PropertySet.h b/source/modules/juce_core/containers/juce_PropertySet.h index 2a4ecb121..88284e6d6 100644 --- a/source/modules/juce_core/containers/juce_PropertySet.h +++ b/source/modules/juce_core/containers/juce_PropertySet.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_ReferenceCountedArray.h b/source/modules/juce_core/containers/juce_ReferenceCountedArray.h index 1930074b7..12a8925ce 100644 --- a/source/modules/juce_core/containers/juce_ReferenceCountedArray.h +++ b/source/modules/juce_core/containers/juce_ReferenceCountedArray.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_ScopedValueSetter.h b/source/modules/juce_core/containers/juce_ScopedValueSetter.h index 13b871ef2..840ca91b3 100644 --- a/source/modules/juce_core/containers/juce_ScopedValueSetter.h +++ b/source/modules/juce_core/containers/juce_ScopedValueSetter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_SortedSet.h b/source/modules/juce_core/containers/juce_SortedSet.h index 62fd9233d..90a239639 100644 --- a/source/modules/juce_core/containers/juce_SortedSet.h +++ b/source/modules/juce_core/containers/juce_SortedSet.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_SparseSet.h b/source/modules/juce_core/containers/juce_SparseSet.h index 86366fce5..573975ab4 100644 --- a/source/modules/juce_core/containers/juce_SparseSet.h +++ b/source/modules/juce_core/containers/juce_SparseSet.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_Variant.cpp b/source/modules/juce_core/containers/juce_Variant.cpp index 0cad68592..849bd8f69 100644 --- a/source/modules/juce_core/containers/juce_Variant.cpp +++ b/source/modules/juce_core/containers/juce_Variant.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/containers/juce_Variant.h b/source/modules/juce_core/containers/juce_Variant.h index ed624f4d9..25d0dcd70 100644 --- a/source/modules/juce_core/containers/juce_Variant.h +++ b/source/modules/juce_core/containers/juce_Variant.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_DirectoryIterator.cpp b/source/modules/juce_core/files/juce_DirectoryIterator.cpp index f2e09a61b..76b503b05 100644 --- a/source/modules/juce_core/files/juce_DirectoryIterator.cpp +++ b/source/modules/juce_core/files/juce_DirectoryIterator.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_DirectoryIterator.h b/source/modules/juce_core/files/juce_DirectoryIterator.h index 3ca2265f1..bd71697cb 100644 --- a/source/modules/juce_core/files/juce_DirectoryIterator.h +++ b/source/modules/juce_core/files/juce_DirectoryIterator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_File.cpp b/source/modules/juce_core/files/juce_File.cpp index 4a3b0d4ce..87b9fb46f 100644 --- a/source/modules/juce_core/files/juce_File.cpp +++ b/source/modules/juce_core/files/juce_File.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -908,7 +908,7 @@ class FileTests : public UnitTest public: FileTests() : UnitTest ("Files") {} - void runTest() + void runTest() override { beginTest ("Reading"); diff --git a/source/modules/juce_core/files/juce_File.h b/source/modules/juce_core/files/juce_File.h index 5c9a1cd18..8a28d51c3 100644 --- a/source/modules/juce_core/files/juce_File.h +++ b/source/modules/juce_core/files/juce_File.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileFilter.cpp b/source/modules/juce_core/files/juce_FileFilter.cpp index bd0bdf861..118c321b6 100644 --- a/source/modules/juce_core/files/juce_FileFilter.cpp +++ b/source/modules/juce_core/files/juce_FileFilter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileFilter.h b/source/modules/juce_core/files/juce_FileFilter.h index 4c02415c4..9dae801ea 100644 --- a/source/modules/juce_core/files/juce_FileFilter.h +++ b/source/modules/juce_core/files/juce_FileFilter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileInputStream.cpp b/source/modules/juce_core/files/juce_FileInputStream.cpp index 58f53b84d..c6ed3d65d 100644 --- a/source/modules/juce_core/files/juce_FileInputStream.cpp +++ b/source/modules/juce_core/files/juce_FileInputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileInputStream.h b/source/modules/juce_core/files/juce_FileInputStream.h index 35963baae..7c31568c0 100644 --- a/source/modules/juce_core/files/juce_FileInputStream.h +++ b/source/modules/juce_core/files/juce_FileInputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileOutputStream.cpp b/source/modules/juce_core/files/juce_FileOutputStream.cpp index 3ffc3bd83..d5c25e70e 100644 --- a/source/modules/juce_core/files/juce_FileOutputStream.cpp +++ b/source/modules/juce_core/files/juce_FileOutputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileOutputStream.h b/source/modules/juce_core/files/juce_FileOutputStream.h index f80705f23..7d1520cf5 100644 --- a/source/modules/juce_core/files/juce_FileOutputStream.h +++ b/source/modules/juce_core/files/juce_FileOutputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileSearchPath.cpp b/source/modules/juce_core/files/juce_FileSearchPath.cpp index ce0af7eda..5531c62a8 100644 --- a/source/modules/juce_core/files/juce_FileSearchPath.cpp +++ b/source/modules/juce_core/files/juce_FileSearchPath.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_FileSearchPath.h b/source/modules/juce_core/files/juce_FileSearchPath.h index 51baf2e77..3744a49b3 100644 --- a/source/modules/juce_core/files/juce_FileSearchPath.h +++ b/source/modules/juce_core/files/juce_FileSearchPath.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_MemoryMappedFile.h b/source/modules/juce_core/files/juce_MemoryMappedFile.h index 8a79185f4..48e0eb6a0 100644 --- a/source/modules/juce_core/files/juce_MemoryMappedFile.h +++ b/source/modules/juce_core/files/juce_MemoryMappedFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_TemporaryFile.cpp b/source/modules/juce_core/files/juce_TemporaryFile.cpp index 50475d58f..acb1af0c9 100644 --- a/source/modules/juce_core/files/juce_TemporaryFile.cpp +++ b/source/modules/juce_core/files/juce_TemporaryFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_TemporaryFile.h b/source/modules/juce_core/files/juce_TemporaryFile.h index 04561a74b..0aad9c90b 100644 --- a/source/modules/juce_core/files/juce_TemporaryFile.h +++ b/source/modules/juce_core/files/juce_TemporaryFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_WildcardFileFilter.cpp b/source/modules/juce_core/files/juce_WildcardFileFilter.cpp index f18a2eb9a..8e51da77d 100644 --- a/source/modules/juce_core/files/juce_WildcardFileFilter.cpp +++ b/source/modules/juce_core/files/juce_WildcardFileFilter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/files/juce_WildcardFileFilter.h b/source/modules/juce_core/files/juce_WildcardFileFilter.h index fb398ce63..af9a757b7 100644 --- a/source/modules/juce_core/files/juce_WildcardFileFilter.h +++ b/source/modules/juce_core/files/juce_WildcardFileFilter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/javascript/juce_JSON.cpp b/source/modules/juce_core/javascript/juce_JSON.cpp index fe48da0e0..9f7eca708 100644 --- a/source/modules/juce_core/javascript/juce_JSON.cpp +++ b/source/modules/juce_core/javascript/juce_JSON.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -607,7 +607,7 @@ public: } } - void runTest() + void runTest() override { beginTest ("JSON"); Random r = getRandom(); diff --git a/source/modules/juce_core/javascript/juce_JSON.h b/source/modules/juce_core/javascript/juce_JSON.h index 7fb17ee20..31a2ff593 100644 --- a/source/modules/juce_core/javascript/juce_JSON.h +++ b/source/modules/juce_core/javascript/juce_JSON.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/javascript/juce_Javascript.cpp b/source/modules/juce_core/javascript/juce_Javascript.cpp index f9a2585ef..761cbbe2f 100644 --- a/source/modules/juce_core/javascript/juce_Javascript.cpp +++ b/source/modules/juce_core/javascript/juce_Javascript.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/javascript/juce_Javascript.h b/source/modules/juce_core/javascript/juce_Javascript.h index 62eadbb11..0de35aeff 100644 --- a/source/modules/juce_core/javascript/juce_Javascript.h +++ b/source/modules/juce_core/javascript/juce_Javascript.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/juce_core.cpp b/source/modules/juce_core/juce_core.cpp index 1c16a9969..38f03dbf5 100644 --- a/source/modules/juce_core/juce_core.cpp +++ b/source/modules/juce_core/juce_core.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -59,7 +59,10 @@ #include #if ! JUCE_MINGW + #pragma warning (push) + #pragma warning (disable: 4091) #include + #pragma warning (pop) #if ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment (lib, "DbgHelp.lib") @@ -162,6 +165,7 @@ namespace juce #include "text/juce_StringPairArray.cpp" #include "text/juce_StringPool.cpp" #include "text/juce_TextDiff.cpp" +#include "text/juce_Base64.cpp" #include "threads/juce_ReadWriteLock.cpp" #include "threads/juce_Thread.cpp" #include "threads/juce_ThreadPool.cpp" @@ -235,4 +239,21 @@ namespace juce #include "threads/juce_HighResolutionTimer.cpp" #include "network/juce_URL.cpp" +//============================================================================== +/* + As the very long class names here try to explain, the purpose of this code is to cause + a linker error if not all of your compile units are consistent in the options that they + enable before including JUCE headers. The reason this is important is that if you have + two cpp files, and one includes the juce headers with debug enabled, and the other doesn't, + then each will be generating code with different memory layouts for the classes, and + you'll get subtle and hard-to-track-down memory corruption bugs! +*/ +#if JUCE_DEBUG + this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode + ::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode() noexcept {} +#else + this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode + ::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode() noexcept {} +#endif + } diff --git a/source/modules/juce_core/juce_core.h b/source/modules/juce_core/juce_core.h index 39538b708..9f30f12f4 100644 --- a/source/modules/juce_core/juce_core.h +++ b/source/modules/juce_core/juce_core.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -224,6 +224,7 @@ extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noe #include "text/juce_StringPairArray.h" #include "text/juce_TextDiff.h" #include "text/juce_LocalisedStrings.h" +#include "text/juce_Base64.h" #include "misc/juce_Result.h" #include "containers/juce_Variant.h" #include "containers/juce_NamedValueSet.h" @@ -286,6 +287,26 @@ extern JUCE_API void JUCE_CALLTYPE logAssertion (const char* file, int line) noe #include "containers/juce_PropertySet.h" #include "memory/juce_SharedResourcePointer.h" +#ifndef DOXYGEN + /* + As the very long class names here try to explain, the purpose of this code is to cause + a linker error if not all of your compile units are consistent in the options that they + enable before including JUCE headers. The reason this is important is that if you have + two cpp files, and one includes the juce headers with debug enabled, and another does so + without that, then each will be generating code with different class layouts, and you'll + get subtle and hard-to-track-down memory corruption! + */ + #if JUCE_DEBUG + struct JUCE_API this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode + { this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode() noexcept; }; + static this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode compileUnitMismatchSentinel; + #else + struct JUCE_API this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode + { this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode() noexcept; }; + static this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode compileUnitMismatchSentinel; + #endif +#endif + } #if JUCE_MSVC diff --git a/source/modules/juce_core/logging/juce_FileLogger.cpp b/source/modules/juce_core/logging/juce_FileLogger.cpp index 1b8f302f2..55db2afb8 100644 --- a/source/modules/juce_core/logging/juce_FileLogger.cpp +++ b/source/modules/juce_core/logging/juce_FileLogger.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/logging/juce_FileLogger.h b/source/modules/juce_core/logging/juce_FileLogger.h index 09301b863..7f8236041 100644 --- a/source/modules/juce_core/logging/juce_FileLogger.h +++ b/source/modules/juce_core/logging/juce_FileLogger.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/logging/juce_Logger.cpp b/source/modules/juce_core/logging/juce_Logger.cpp index 0b1c8d6be..00dec72a1 100644 --- a/source/modules/juce_core/logging/juce_Logger.cpp +++ b/source/modules/juce_core/logging/juce_Logger.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/logging/juce_Logger.h b/source/modules/juce_core/logging/juce_Logger.h index d0d3af57f..1af9eb588 100644 --- a/source/modules/juce_core/logging/juce_Logger.h +++ b/source/modules/juce_core/logging/juce_Logger.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/maths/juce_BigInteger.cpp b/source/modules/juce_core/maths/juce_BigInteger.cpp index dd0961635..84eabe3fd 100644 --- a/source/modules/juce_core/maths/juce_BigInteger.cpp +++ b/source/modules/juce_core/maths/juce_BigInteger.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -1000,15 +1000,83 @@ MemoryBlock BigInteger::toMemoryBlock() const MemoryBlock mb ((size_t) numBytes); for (int i = 0; i < numBytes; ++i) - mb[i] = (char) getBitRangeAsInt (i << 3, 8); + mb[i] = (char) ((values[i / 4] >> ((i & 3) * 8)) & 0xff); return mb; } void BigInteger::loadFromMemoryBlock (const MemoryBlock& data) { - clear(); + const size_t numBytes = data.getSize(); + numValues = 1 + (numBytes / sizeof (uint32)); + values.malloc (numValues + 1); + + for (int i = 0; i < (int) numValues - 1; ++i) + values[i] = (uint32) ByteOrder::littleEndianInt (addBytesToPointer (data.getData(), sizeof (uint32) * (size_t) i)); + + values[numValues - 1] = 0; + values[numValues] = 0; - for (int i = (int) data.getSize(); --i >= 0;) + for (int i = (int) (numBytes & ~3u); i < (int) numBytes; ++i) this->setBitRangeAsInt (i << 3, 8, (uint32) data [i]); + + highestBit = (int) numBytes * 8; + highestBit = getHighestBit(); } + + +//============================================================================== +//============================================================================== +#if JUCE_UNIT_TESTS + +class BigIntegerTests : public UnitTest +{ +public: + BigIntegerTests() : UnitTest ("BigInteger") {} + + static BigInteger getBigRandom (Random& r) + { + BigInteger b; + + while (b < 2) + r.fillBitsRandomly (b, 0, r.nextInt (150) + 1); + + return b; + } + + void runTest() override + { + beginTest ("BigInteger"); + + Random r = getRandom(); + + expect (BigInteger().isZero()); + expect (BigInteger(1).isOne()); + + for (int j = 10000; --j >= 0;) + { + BigInteger b1 (getBigRandom(r)), + b2 (getBigRandom(r)); + + BigInteger b3 = b1 + b2; + expect (b3 > b1 && b3 > b2); + expect (b3 - b1 == b2); + expect (b3 - b2 == b1); + + BigInteger b4 = b1 * b2; + expect (b4 > b1 && b4 > b2); + expect (b4 / b1 == b2); + expect (b4 / b2 == b1); + + // TODO: should add tests for other ops (although they also get pretty well tested in the RSA unit test) + + BigInteger b5; + b5.loadFromMemoryBlock (b3.toMemoryBlock()); + expect (b3 == b5); + } + } +}; + +static BigIntegerTests bigIntegerTests; + +#endif diff --git a/source/modules/juce_core/maths/juce_BigInteger.h b/source/modules/juce_core/maths/juce_BigInteger.h index 4c6c25c56..2f99424a3 100644 --- a/source/modules/juce_core/maths/juce_BigInteger.h +++ b/source/modules/juce_core/maths/juce_BigInteger.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/maths/juce_Expression.cpp b/source/modules/juce_core/maths/juce_Expression.cpp index 632b90a78..442cd39c6 100644 --- a/source/modules/juce_core/maths/juce_Expression.cpp +++ b/source/modules/juce_core/maths/juce_Expression.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -656,8 +656,7 @@ struct Expression::Helpers { public: //============================================================================== - Parser (String::CharPointerType& stringToParse) - : text (stringToParse) + Parser (String::CharPointerType& stringToParse) : text (stringToParse) { } @@ -669,14 +668,24 @@ struct Expression::Helpers const TermPtr e (readExpression()); if (e == nullptr || ((! readOperator (",")) && ! text.isEmpty())) - throw ParseError ("Syntax error: \"" + String (text) + "\""); + return parseError ("Syntax error: \"" + String (text) + "\""); return e; } + String error; + private: String::CharPointerType& text; + Term* parseError (const String& message) + { + if (error.isEmpty()) + error = message; + + return nullptr; + } + //============================================================================== static inline bool isDecimalDigit (const juce_wchar c) noexcept { @@ -777,7 +786,7 @@ struct Expression::Helpers TermPtr rhs (readMultiplyOrDivideExpression()); if (rhs == nullptr) - throw ParseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); + return parseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); if (opType == '+') lhs = new Add (lhs, rhs); @@ -798,7 +807,7 @@ struct Expression::Helpers TermPtr rhs (readUnaryExpression()); if (rhs == nullptr) - throw ParseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); + return parseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); if (opType == '*') lhs = new Multiply (lhs, rhs); @@ -817,7 +826,7 @@ struct Expression::Helpers TermPtr e (readUnaryExpression()); if (e == nullptr) - throw ParseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); + return parseError ("Expected expression after \"" + String::charToString ((juce_wchar) (uint8) opType) + "\""); if (opType == '-') e = e->negated(); @@ -858,7 +867,7 @@ struct Expression::Helpers if (readOperator (")")) return func.release(); - throw ParseError ("Expected parameters after \"" + identifier + " (\""); + return parseError ("Expected parameters after \"" + identifier + " (\""); } f->parameters.add (Expression (param)); @@ -868,7 +877,7 @@ struct Expression::Helpers param = readExpression(); if (param == nullptr) - throw ParseError ("Expected expression after \",\""); + return parseError ("Expected expression after \",\""); f->parameters.add (Expression (param)); } @@ -876,7 +885,7 @@ struct Expression::Helpers if (readOperator (")")) return func.release(); - throw ParseError ("Expected \")\""); + return parseError ("Expected \")\""); } if (readOperator (".")) @@ -884,7 +893,7 @@ struct Expression::Helpers TermPtr rhs (readSymbolOrFunction()); if (rhs == nullptr) - throw ParseError ("Expected symbol or function after \".\""); + return parseError ("Expected symbol or function after \".\""); if (identifier == "this") return rhs; @@ -926,8 +935,7 @@ Expression::~Expression() { } -Expression::Expression (Term* const term_) - : term (term_) +Expression::Expression (Term* t) : term (t) { jassert (term != nullptr); } @@ -961,17 +969,20 @@ Expression& Expression::operator= (Expression&& other) noexcept } #endif -Expression::Expression (const String& stringToParse) +Expression::Expression (const String& stringToParse, String& parseError) { String::CharPointerType text (stringToParse.getCharPointer()); Helpers::Parser parser (text); term = parser.readUpToComma(); + parseError = parser.error; } -Expression Expression::parse (String::CharPointerType& stringToParse) +Expression Expression::parse (String::CharPointerType& stringToParse, String& parseError) { Helpers::Parser parser (stringToParse); - return Expression (parser.readUpToComma()); + Expression e (parser.readUpToComma()); + parseError = parser.error; + return e; } double Expression::evaluate() const @@ -981,14 +992,7 @@ double Expression::evaluate() const double Expression::evaluate (const Expression::Scope& scope) const { - try - { - return term->resolve (scope, 0)->toDouble(); - } - catch (Helpers::EvaluationError&) - {} - - return 0; + return term->resolve (scope, 0)->toDouble(); } double Expression::evaluate (const Scope& scope, String& evaluationError) const @@ -1104,15 +1108,8 @@ ReferenceCountedObjectPtr Expression::Term::negated() } //============================================================================== -Expression::ParseError::ParseError (const String& message) - : description (message) -{ - DBG ("Expression::ParseError: " + message); -} - -//============================================================================== -Expression::Symbol::Symbol (const String& scopeUID_, const String& symbolName_) - : scopeUID (scopeUID_), symbolName (symbolName_) +Expression::Symbol::Symbol (const String& scope, const String& symbol) + : scopeUID (scope), symbolName (symbol) { } diff --git a/source/modules/juce_core/maths/juce_Expression.h b/source/modules/juce_core/maths/juce_Expression.h index 893912909..208e543f8 100644 --- a/source/modules/juce_core/maths/juce_Expression.h +++ b/source/modules/juce_core/maths/juce_Expression.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -55,9 +55,6 @@ public: /** Destructor. */ ~Expression(); - /** Creates a simple expression with a specified constant value. */ - explicit Expression (double constant); - /** Creates a copy of an expression. */ Expression (const Expression&); @@ -69,11 +66,13 @@ public: Expression& operator= (Expression&&) noexcept; #endif - /** Creates an expression by parsing a string. - If there's a syntax error in the string, this will throw a ParseError exception. - @throws ParseError + /** Creates a simple expression with a specified constant value. */ + explicit Expression (double constant); + + /** Attempts to create an expression by parsing a string. + Any errors are returned in the parseError argument provided. */ - explicit Expression (const String& stringToParse); + Expression (const String& stringToParse, String& parseError); /** Returns a string version of the expression. */ String toString() const; @@ -101,10 +100,10 @@ public: The pointer is incremented so that on return, it indicates the character that follows the end of the expression that was parsed. - If there's a syntax error in the string, this will throw a ParseError exception. - @throws ParseError + If there's a syntax error in parsing, the parseError argument will be set + to a description of the problem. */ - static Expression parse (String::CharPointerType& stringToParse); + static Expression parse (String::CharPointerType& stringToParse, String& parseError); //============================================================================== /** When evaluating an Expression object, this class is used to resolve symbols and @@ -216,16 +215,6 @@ public: /** Returns a list of all symbols that may be needed to resolve this expression in the given scope. */ void findReferencedSymbols (Array& results, const Scope& scope) const; - //============================================================================== - /** An exception that can be thrown by Expression::parse(). */ - class ParseError : public std::exception - { - public: - ParseError (const String& message); - - String description; - }; - //============================================================================== /** Expression type. @see Expression::getType() diff --git a/source/modules/juce_core/maths/juce_MathsFunctions.h b/source/modules/juce_core/maths/juce_MathsFunctions.h index 67097d906..faa85e024 100644 --- a/source/modules/juce_core/maths/juce_MathsFunctions.h +++ b/source/modules/juce_core/maths/juce_MathsFunctions.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -88,7 +88,7 @@ typedef unsigned int uint32; typedef unsigned int pointer_sized_uint; #endif -#if JUCE_MSVC +#if JUCE_WINDOWS && ! JUCE_MINGW typedef pointer_sized_int ssize_t; #endif @@ -97,47 +97,48 @@ typedef unsigned int uint32; /** Returns the larger of two values. */ template -inline Type jmax (const Type a, const Type b) { return (a < b) ? b : a; } +Type jmax (const Type a, const Type b) { return (a < b) ? b : a; } /** Returns the larger of three values. */ template -inline Type jmax (const Type a, const Type b, const Type c) { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); } +Type jmax (const Type a, const Type b, const Type c) { return (a < b) ? ((b < c) ? c : b) : ((a < c) ? c : a); } /** Returns the larger of four values. */ template -inline Type jmax (const Type a, const Type b, const Type c, const Type d) { return jmax (a, jmax (b, c, d)); } +Type jmax (const Type a, const Type b, const Type c, const Type d) { return jmax (a, jmax (b, c, d)); } /** Returns the smaller of two values. */ template -inline Type jmin (const Type a, const Type b) { return (b < a) ? b : a; } +Type jmin (const Type a, const Type b) { return (b < a) ? b : a; } /** Returns the smaller of three values. */ template -inline Type jmin (const Type a, const Type b, const Type c) { return (b < a) ? ((c < b) ? c : b) : ((c < a) ? c : a); } +Type jmin (const Type a, const Type b, const Type c) { return (b < a) ? ((c < b) ? c : b) : ((c < a) ? c : a); } /** Returns the smaller of four values. */ template -inline Type jmin (const Type a, const Type b, const Type c, const Type d) { return jmin (a, jmin (b, c, d)); } +Type jmin (const Type a, const Type b, const Type c, const Type d) { return jmin (a, jmin (b, c, d)); } /** Remaps a normalised value (between 0 and 1) to a target range. - This effectively returns (targetRangeMin + value0To1 * (targetRangeMax - targetRangeMin)) + This effectively returns (targetRangeMin + value0To1 * (targetRangeMax - targetRangeMin)). */ -template -static Type jmap (Type value0To1, Type targetRangeMin, Type targetRangeMax) +template +Type jmap (Type value0To1, Type targetRangeMin, Type targetRangeMax) { return targetRangeMin + value0To1 * (targetRangeMax - targetRangeMin); } /** Remaps a value from a source range to a target range. */ -template -static Type jmap (Type sourceValue, Type sourceRangeMin, Type sourceRangeMax, Type targetRangeMin, Type targetRangeMax) +template +Type jmap (Type sourceValue, Type sourceRangeMin, Type sourceRangeMax, Type targetRangeMin, Type targetRangeMax) { + jassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN! return targetRangeMin + ((targetRangeMax - targetRangeMin) * (sourceValue - sourceRangeMin)) / (sourceRangeMax - sourceRangeMin); } /** Scans an array of values, returning the minimum value that it contains. */ template -const Type findMinimum (const Type* data, int numValues) +Type findMinimum (const Type* data, int numValues) { if (numValues <= 0) return Type(); @@ -155,7 +156,7 @@ const Type findMinimum (const Type* data, int numValues) /** Scans an array of values, returning the maximum value that it contains. */ template -const Type findMaximum (const Type* values, int numValues) +Type findMaximum (const Type* values, int numValues) { if (numValues <= 0) return Type(); @@ -217,9 +218,9 @@ void findMinAndMax (const Type* values, int numValues, Type& lowest, Type& highe @see jlimit0To, jmin, jmax */ template -inline Type jlimit (const Type lowerLimit, - const Type upperLimit, - const Type valueToConstrain) noexcept +Type jlimit (const Type lowerLimit, + const Type upperLimit, + const Type valueToConstrain) noexcept { jassert (lowerLimit <= upperLimit); // if these are in the wrong order, results are unpredictable.. @@ -234,7 +235,7 @@ inline Type jlimit (const Type lowerLimit, @endcode */ template -inline bool isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept +bool isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept { jassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero.. return Type() <= valueToTest && valueToTest < upperLimit; @@ -253,7 +254,7 @@ inline bool isPositiveAndBelow (const int valueToTest, const int upperLimit) noe @endcode */ template -inline bool isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noexcept +bool isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noexcept { jassert (Type() <= upperLimit); // makes no sense to call this if the upper limit is itself below zero.. return Type() <= valueToTest && valueToTest <= upperLimit; @@ -269,7 +270,7 @@ inline bool isPositiveAndNotGreaterThan (const int valueToTest, const int upperL //============================================================================== /** Handy function to swap two values. */ template -inline void swapVariables (Type& variable1, Type& variable2) +void swapVariables (Type& variable1, Type& variable2) { std::swap (variable1, variable2); } @@ -296,7 +297,7 @@ void ignoreUnused (const Type1&, const Type2&, const Type3&, const Type4&) noexc @endcode */ template -inline int numElementsInArray (Type (&array)[N]) +int numElementsInArray (Type (&array)[N]) { (void) array; // (required to avoid a spurious warning in MS compilers) (void) sizeof (0[array]); // This line should cause an error if you pass an object with a user-defined subscript operator @@ -309,7 +310,7 @@ inline int numElementsInArray (Type (&array)[N]) /** Using juce_hypot is easier than dealing with the different types of hypot function that are provided by the various platforms and compilers. */ template -inline Type juce_hypot (Type a, Type b) noexcept +Type juce_hypot (Type a, Type b) noexcept { #if JUCE_MSVC return static_cast (_hypot (a, b)); @@ -337,9 +338,9 @@ inline int64 abs64 (const int64 n) noexcept } #if JUCE_MSVC && ! defined (DOXYGEN) // The MSVC libraries omit these functions for some reason... - template Type asinh (Type x) noexcept { return std::log (x + std::sqrt (x * x + (Type) 1)); } - template Type acosh (Type x) noexcept { return std::log (x + std::sqrt (x * x - (Type) 1)); } - template Type atanh (Type x) noexcept { return (std::log (x + (Type) 1) - std::log (((Type) 1) - x)) / (Type) 2; } + template Type asinh (Type x) { return std::log (x + std::sqrt (x * x + (Type) 1)); } + template Type acosh (Type x) { return std::log (x + std::sqrt (x * x - (Type) 1)); } + template Type atanh (Type x) { return (std::log (x + (Type) 1) - std::log (((Type) 1) - x)) / (Type) 2; } #endif //============================================================================== @@ -356,11 +357,11 @@ const float float_Pi = 3.14159265358979323846f; /** Converts an angle in degrees to radians. */ template -inline FloatType degreesToRadians (FloatType degrees) noexcept { return degrees * static_cast (double_Pi / 180.0); } +FloatType degreesToRadians (FloatType degrees) noexcept { return degrees * static_cast (double_Pi / 180.0); } /** Converts an angle in radians to degrees. */ template -inline FloatType radiansToDegrees (FloatType radians) noexcept { return radians * static_cast (180.0 / double_Pi); } +FloatType radiansToDegrees (FloatType radians) noexcept { return radians * static_cast (180.0 / double_Pi); } //============================================================================== @@ -368,7 +369,7 @@ inline FloatType radiansToDegrees (FloatType radians) noexcept { return radians platform-independent function for it. */ template -inline bool juce_isfinite (NumericType) noexcept +bool juce_isfinite (NumericType) noexcept { return true; // Integer types are always finite } @@ -376,7 +377,7 @@ inline bool juce_isfinite (NumericType) noexcept template <> inline bool juce_isfinite (float value) noexcept { - #if JUCE_MSVC + #if JUCE_WINDOWS && ! JUCE_MINGW return _finite (value) != 0; #else return std::isfinite (value); @@ -386,7 +387,7 @@ inline bool juce_isfinite (float value) noexcept template <> inline bool juce_isfinite (double value) noexcept { - #if JUCE_MSVC + #if JUCE_WINDOWS && ! JUCE_MINGW return _finite (value) != 0; #else return std::isfinite (value); @@ -412,7 +413,7 @@ inline bool juce_isfinite (double value) noexcept even numbers will be rounded up or down differently. */ template -inline int roundToInt (const FloatType value) noexcept +int roundToInt (const FloatType value) noexcept { #ifdef __INTEL_COMPILER #pragma float_control (precise, on, push) diff --git a/source/modules/juce_core/maths/juce_NormalisableRange.h b/source/modules/juce_core/maths/juce_NormalisableRange.h index 56424a2a2..f8a9bc850 100644 --- a/source/modules/juce_core/maths/juce_NormalisableRange.h +++ b/source/modules/juce_core/maths/juce_NormalisableRange.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/maths/juce_Random.cpp b/source/modules/juce_core/maths/juce_Random.cpp index a19625683..cb1156283 100644 --- a/source/modules/juce_core/maths/juce_Random.cpp +++ b/source/modules/juce_core/maths/juce_Random.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -162,7 +162,7 @@ class RandomTests : public UnitTest public: RandomTests() : UnitTest ("Random") {} - void runTest() + void runTest() override { beginTest ("Random"); diff --git a/source/modules/juce_core/maths/juce_Random.h b/source/modules/juce_core/maths/juce_Random.h index 19e6d6ef8..9db453413 100644 --- a/source/modules/juce_core/maths/juce_Random.h +++ b/source/modules/juce_core/maths/juce_Random.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/maths/juce_Range.h b/source/modules/juce_core/maths/juce_Range.h index 6add15234..d1b1e45bd 100644 --- a/source/modules/juce_core/maths/juce_Range.h +++ b/source/modules/juce_core/maths/juce_Range.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_Atomic.h b/source/modules/juce_core/memory/juce_Atomic.h index 5e9d30c13..9421652d4 100644 --- a/source/modules/juce_core/memory/juce_Atomic.h +++ b/source/modules/juce_core/memory/juce_Atomic.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -207,7 +207,7 @@ private: #endif //============================================================================== -#elif JUCE_GCC || JUCE_CLANG +#elif (JUCE_GCC || JUCE_CLANG) && ! JUCE_WINDOWS #define JUCE_ATOMICS_GCC 1 // GCC with intrinsics #if JUCE_IOS || JUCE_ANDROID // (64-bit ops will compile but not link on these mobile OSes) @@ -256,6 +256,77 @@ private: template static Type juce_InterlockedDecrement64 (volatile Type* a) noexcept { jassertfalse; return --*a; } #define JUCE_64BIT_ATOMICS_UNAVAILABLE 1 #endif + + template + struct WindowsInterlockedHelpersBase + {}; + + template + struct WindowsInterlockedHelpersBase + { + static inline Type exchange(volatile Type* value, Type other) noexcept + { + return castFrom (juce_InterlockedExchange (reinterpret_cast (value), castTo (other))); + } + + static inline Type add(volatile Type* value, Type other) noexcept + { + return castFrom (juce_InterlockedExchangeAdd (reinterpret_cast (value), castTo (other)) + castTo (other)); + } + + static inline Type inc(volatile Type* value) noexcept + { + return castFrom (juce_InterlockedIncrement (reinterpret_cast (value))); + } + + static inline Type dec(volatile Type* value) noexcept + { + return castFrom (juce_InterlockedDecrement (reinterpret_cast (value))); + } + + static inline Type cmp(volatile Type* value, Type other, Type comparand) noexcept + { + return castFrom (juce_InterlockedCompareExchange (reinterpret_cast (value), castTo (other), castTo (comparand))); + } + + static inline Type castFrom (long value) { union { long in; Type out; } u; u.in = value; return u.out; } + static inline long castTo (Type value) { union { Type in; long out; } u; u.in = value; return u.out; } + }; + + template + struct WindowsInterlockedHelpersBase + { + static inline Type exchange(volatile Type* value, Type other) noexcept + { + return castFrom (juce_InterlockedExchange64 (reinterpret_cast (value), castTo (other))); + } + + static inline Type add(volatile Type* value, Type other) noexcept + { + return castFrom (juce_InterlockedExchangeAdd64 (reinterpret_cast (value), castTo (other)) + castTo (other)); + } + + static inline Type inc(volatile Type* value) noexcept + { + return castFrom (juce_InterlockedIncrement64 (reinterpret_cast (value))); + } + + static inline Type dec(volatile Type* value) noexcept + { + return castFrom (juce_InterlockedDecrement64 (reinterpret_cast (value))); + } + + static inline Type cmp(volatile Type* value, Type other, Type comparand) noexcept + { + return castFrom (juce_InterlockedCompareExchange64 (reinterpret_cast (value), castTo (other), castTo (comparand))); + } + + static inline Type castFrom (__int64 value) { union { __int64 in; Type out; } u; u.in = value; return u.out; } + static inline __int64 castTo (Type value) { union { Type in; __int64 out; } u; u.in = value; return u.out; } + }; + + template + struct WindowsInterlockedHelpers : WindowsInterlockedHelpersBase {}; #endif @@ -272,8 +343,7 @@ inline Type Atomic::get() const noexcept return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier ((int32_t) 0, (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value)) : castFrom64Bit ((int64) OSAtomicAdd64Barrier ((int64_t) 0, (JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value)); #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchangeAdd ((volatile long*) &value, (long) 0)) - : castFrom64Bit ((int64) juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0)); + return WindowsInterlockedHelpers::add (const_cast (&value), (Type) 0); #elif JUCE_ATOMICS_GCC return sizeof (Type) == 4 ? castFrom32Bit ((int32) __sync_add_and_fetch ((volatile int32*) &value, 0)) : castFrom64Bit ((int64) __sync_add_and_fetch ((volatile int64*) &value, 0)); @@ -288,8 +358,7 @@ inline Type Atomic::exchange (const Type newValue) noexcept while (! compareAndSetBool (newValue, currentVal)) { currentVal = value; } return currentVal; #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedExchange ((volatile long*) &value, (long) castTo32Bit (newValue))) - : castFrom64Bit ((int64) juce_InterlockedExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue))); + return WindowsInterlockedHelpers::exchange (&value, newValue); #endif } @@ -300,8 +369,7 @@ inline Type Atomic::operator+= (const Type amountToAdd) noexcept return sizeof (Type) == 4 ? (Type) OSAtomicAdd32Barrier ((int32_t) castTo32Bit (amountToAdd), (JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) : (Type) OSAtomicAdd64Barrier ((int64_t) amountToAdd, (JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value); #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? (Type) (juce_InterlockedExchangeAdd ((volatile long*) &value, (long) amountToAdd) + (long) amountToAdd) - : (Type) (juce_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) amountToAdd) + (__int64) amountToAdd); + return WindowsInterlockedHelpers::add (&value, amountToAdd); #elif JUCE_ATOMICS_GCC return (Type) __sync_add_and_fetch (&value, amountToAdd); #endif @@ -320,8 +388,7 @@ inline Type Atomic::operator++() noexcept return sizeof (Type) == 4 ? (Type) OSAtomicIncrement32Barrier ((JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) : (Type) OSAtomicIncrement64Barrier ((JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value); #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? (Type) juce_InterlockedIncrement ((volatile long*) &value) - : (Type) juce_InterlockedIncrement64 ((volatile __int64*) &value); + return WindowsInterlockedHelpers::inc (&value); #elif JUCE_ATOMICS_GCC return sizeof (Type) == 4 ? (Type) __sync_add_and_fetch (&value, (Type) 1) : (Type) __sync_add_and_fetch ((int64_t*) &value, 1); @@ -335,8 +402,7 @@ inline Type Atomic::operator--() noexcept return sizeof (Type) == 4 ? (Type) OSAtomicDecrement32Barrier ((JUCE_MAC_ATOMICS_VOLATILE int32_t*) &value) : (Type) OSAtomicDecrement64Barrier ((JUCE_MAC_ATOMICS_VOLATILE int64_t*) &value); #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? (Type) juce_InterlockedDecrement ((volatile long*) &value) - : (Type) juce_InterlockedDecrement64 ((volatile __int64*) &value); + return WindowsInterlockedHelpers::dec (&value); #elif JUCE_ATOMICS_GCC return sizeof (Type) == 4 ? (Type) __sync_add_and_fetch (&value, (Type) -1) : (Type) __sync_add_and_fetch ((int64_t*) &value, -1); @@ -372,8 +438,7 @@ inline Type Atomic::compareAndSetValue (const Type newValue, const Type va } #elif JUCE_ATOMICS_WINDOWS - return sizeof (Type) == 4 ? castFrom32Bit ((int32) juce_InterlockedCompareExchange ((volatile long*) &value, (long) castTo32Bit (newValue), (long) castTo32Bit (valueToCompare))) - : castFrom64Bit ((int64) juce_InterlockedCompareExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue), (__int64) castTo64Bit (valueToCompare))); + return WindowsInterlockedHelpers::cmp (&value, newValue, valueToCompare); #elif JUCE_ATOMICS_GCC return sizeof (Type) == 4 ? castFrom32Bit ((int32) __sync_val_compare_and_swap ((volatile int32*) &value, castTo32Bit (valueToCompare), castTo32Bit (newValue))) : castFrom64Bit ((int64) __sync_val_compare_and_swap ((volatile int64*) &value, castTo64Bit (valueToCompare), castTo64Bit (newValue))); diff --git a/source/modules/juce_core/memory/juce_ByteOrder.h b/source/modules/juce_core/memory/juce_ByteOrder.h index cd17927b7..b4f7df64b 100644 --- a/source/modules/juce_core/memory/juce_ByteOrder.h +++ b/source/modules/juce_core/memory/juce_ByteOrder.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_ContainerDeletePolicy.h b/source/modules/juce_core/memory/juce_ContainerDeletePolicy.h index 94a352c66..7ea28844c 100644 --- a/source/modules/juce_core/memory/juce_ContainerDeletePolicy.h +++ b/source/modules/juce_core/memory/juce_ContainerDeletePolicy.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_HeapBlock.h b/source/modules/juce_core/memory/juce_HeapBlock.h index 402b6173a..bf0ff83b8 100644 --- a/source/modules/juce_core/memory/juce_HeapBlock.h +++ b/source/modules/juce_core/memory/juce_HeapBlock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -29,7 +29,7 @@ #ifndef JUCE_HEAPBLOCK_H_INCLUDED #define JUCE_HEAPBLOCK_H_INCLUDED -#ifndef DOXYGEN +#if ! (defined (DOXYGEN) || JUCE_EXCEPTIONS_DISABLED) namespace HeapBlockHelper { template @@ -295,7 +295,11 @@ private: void throwOnAllocationFailure() const { + #if JUCE_EXCEPTIONS_DISABLED + jassert (data != nullptr); // without exceptions, you'll need to find a better way to handle this failure case. + #else HeapBlockHelper::ThrowOnFail::check (data); + #endif } #if ! (defined (JUCE_DLL) || defined (JUCE_DLL_BUILD)) diff --git a/source/modules/juce_core/memory/juce_LeakedObjectDetector.h b/source/modules/juce_core/memory/juce_LeakedObjectDetector.h index 74b777932..ac6803052 100644 --- a/source/modules/juce_core/memory/juce_LeakedObjectDetector.h +++ b/source/modules/juce_core/memory/juce_LeakedObjectDetector.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_Memory.h b/source/modules/juce_core/memory/juce_Memory.h index fd58ebb60..61c77310b 100644 --- a/source/modules/juce_core/memory/juce_Memory.h +++ b/source/modules/juce_core/memory/juce_Memory.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_MemoryBlock.cpp b/source/modules/juce_core/memory/juce_MemoryBlock.cpp index b258c3129..0efd21bcf 100644 --- a/source/modules/juce_core/memory/juce_MemoryBlock.cpp +++ b/source/modules/juce_core/memory/juce_MemoryBlock.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_MemoryBlock.h b/source/modules/juce_core/memory/juce_MemoryBlock.h index 30bb3cab2..cbe025cc8 100644 --- a/source/modules/juce_core/memory/juce_MemoryBlock.h +++ b/source/modules/juce_core/memory/juce_MemoryBlock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_OptionalScopedPointer.h b/source/modules/juce_core/memory/juce_OptionalScopedPointer.h index a633dca1b..fd0d5f6a5 100644 --- a/source/modules/juce_core/memory/juce_OptionalScopedPointer.h +++ b/source/modules/juce_core/memory/juce_OptionalScopedPointer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_ReferenceCountedObject.h b/source/modules/juce_core/memory/juce_ReferenceCountedObject.h index 36ac5c3a7..3dac3c46c 100644 --- a/source/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/source/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_ScopedPointer.h b/source/modules/juce_core/memory/juce_ScopedPointer.h index 1aa8031e1..557104eeb 100644 --- a/source/modules/juce_core/memory/juce_ScopedPointer.h +++ b/source/modules/juce_core/memory/juce_ScopedPointer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_SharedResourcePointer.h b/source/modules/juce_core/memory/juce_SharedResourcePointer.h index c8a7f44d5..307b55951 100644 --- a/source/modules/juce_core/memory/juce_SharedResourcePointer.h +++ b/source/modules/juce_core/memory/juce_SharedResourcePointer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_Singleton.h b/source/modules/juce_core/memory/juce_Singleton.h index ce1406e97..d424784e0 100644 --- a/source/modules/juce_core/memory/juce_Singleton.h +++ b/source/modules/juce_core/memory/juce_Singleton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/memory/juce_WeakReference.h b/source/modules/juce_core/memory/juce_WeakReference.h index c11b19f85..ff23d994c 100644 --- a/source/modules/juce_core/memory/juce_WeakReference.h +++ b/source/modules/juce_core/memory/juce_WeakReference.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/misc/juce_Result.cpp b/source/modules/juce_core/misc/juce_Result.cpp index 1734907f5..0999531a9 100644 --- a/source/modules/juce_core/misc/juce_Result.cpp +++ b/source/modules/juce_core/misc/juce_Result.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/misc/juce_Result.h b/source/modules/juce_core/misc/juce_Result.h index 7c320ac33..218ffb65f 100644 --- a/source/modules/juce_core/misc/juce_Result.h +++ b/source/modules/juce_core/misc/juce_Result.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/misc/juce_Uuid.cpp b/source/modules/juce_core/misc/juce_Uuid.cpp index eb749643f..e0d0c1550 100644 --- a/source/modules/juce_core/misc/juce_Uuid.cpp +++ b/source/modules/juce_core/misc/juce_Uuid.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/misc/juce_Uuid.h b/source/modules/juce_core/misc/juce_Uuid.h index cd7af0dbc..2a0ff054a 100644 --- a/source/modules/juce_core/misc/juce_Uuid.h +++ b/source/modules/juce_core/misc/juce_Uuid.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/misc/juce_WindowsRegistry.h b/source/modules/juce_core/misc/juce_WindowsRegistry.h index a1fb2a25c..987d87c7b 100644 --- a/source/modules/juce_core/misc/juce_WindowsRegistry.h +++ b/source/modules/juce_core/misc/juce_WindowsRegistry.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/java/JuceAppActivity.java b/source/modules/juce_core/native/java/JuceAppActivity.java index c936ccdf7..ea5f18577 100644 --- a/source/modules/juce_core/native/java/JuceAppActivity.java +++ b/source/modules/juce_core/native/java/JuceAppActivity.java @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -66,6 +66,7 @@ public class JuceAppActivity extends Activity { super.onCreate (savedInstanceState); + isScreenSaverEnabled = true; viewHolder = new ViewHolder (this); setContentView (viewHolder); @@ -141,6 +142,7 @@ public class JuceAppActivity extends Activity //============================================================================== private ViewHolder viewHolder; + private boolean isScreenSaverEnabled; public final ComponentPeerView createNewView (boolean opaque, long host) { @@ -222,6 +224,24 @@ public class JuceAppActivity extends Activity canvas.clipRect (left, top, right, bottom, android.graphics.Region.Op.DIFFERENCE); } + //============================================================================== + public final void setScreenSaver (boolean enabled) + { + if (isScreenSaverEnabled != enabled) + { + isScreenSaverEnabled = enabled; + if (enabled) + getWindow().clearFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + else + getWindow().addFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + } + } + + public final boolean getScreenSaver () + { + return isScreenSaverEnabled; + } + //============================================================================== public final String getClipboardContent() { @@ -641,7 +661,7 @@ public class JuceAppActivity extends Activity } catch (IOException e) { - if (connection.getResponseCode() < org.apache.http.HttpStatus.SC_BAD_REQUEST) + if (connection.getResponseCode() < 400) throw e; } finally @@ -649,7 +669,7 @@ public class JuceAppActivity extends Activity statusCode[0] = connection.getResponseCode(); } - if (statusCode[0] >= org.apache.http.HttpStatus.SC_BAD_REQUEST) + if (statusCode[0] >= 400) inputStream = connection.getErrorStream(); else inputStream = connection.getInputStream(); @@ -699,11 +719,10 @@ public class JuceAppActivity extends Activity private long position; } - public static final HTTPStream createHTTPStream (String address, - boolean isPost, byte[] postData, String headers, - int timeOutMs, int[] statusCode, - StringBuffer responseHeaders, - int numRedirectsToFollow) + public static final HTTPStream createHTTPStream (String address, boolean isPost, byte[] postData, + String headers, int timeOutMs, int[] statusCode, + StringBuffer responseHeaders, int numRedirectsToFollow, + String httpRequestCmd) { // timeout parameter of zero for HttpUrlConnection is a blocking connect (negative value for juce::URL) if (timeOutMs < 0) @@ -744,9 +763,9 @@ public class JuceAppActivity extends Activity } } + connection.setRequestMethod (httpRequestCmd); if (isPost) { - connection.setRequestMethod ("POST"); connection.setDoOutput (true); if (postData != null) diff --git a/source/modules/juce_core/native/juce_BasicNativeHeaders.h b/source/modules/juce_core/native/juce_BasicNativeHeaders.h index 55c0c8c30..933285a24 100644 --- a/source/modules/juce_core/native/juce_BasicNativeHeaders.h +++ b/source/modules/juce_core/native/juce_BasicNativeHeaders.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -80,8 +80,7 @@ #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!" #endif - #pragma warning (push) - #pragma warning (disable : 4100 4201 4514 4312 4995) + #pragma warning (push, 0) // disable all warnings whilst including system headers #endif #define STRICT 1 @@ -114,6 +113,8 @@ #if JUCE_MINGW #include + #include + #define alloca __builtin_alloca #else #include #include diff --git a/source/modules/juce_core/native/juce_android_Files.cpp b/source/modules/juce_core/native/juce_android_Files.cpp index 45903b15c..591c4dc19 100644 --- a/source/modules/juce_core/native/juce_android_Files.cpp +++ b/source/modules/juce_core/native/juce_android_Files.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_android_JNIHelpers.h b/source/modules/juce_core/native/juce_android_JNIHelpers.h index 704012f0b..49c5aa178 100644 --- a/source/modules/juce_core/native/juce_android_JNIHelpers.h +++ b/source/modules/juce_core/native/juce_android_JNIHelpers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -395,7 +395,7 @@ struct AndroidThreadScope METHOD (setClipboardContent, "setClipboardContent", "(Ljava/lang/String;)V") \ METHOD (excludeClipRegion, "excludeClipRegion", "(Landroid/graphics/Canvas;FFFF)V") \ METHOD (renderGlyph, "renderGlyph", "(CLandroid/graphics/Paint;Landroid/graphics/Matrix;Landroid/graphics/Rect;)[I") \ - STATICMETHOD (createHTTPStream, "createHTTPStream", "(Ljava/lang/String;Z[BLjava/lang/String;I[ILjava/lang/StringBuffer;I)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream;") \ + STATICMETHOD (createHTTPStream, "createHTTPStream", "(Ljava/lang/String;Z[BLjava/lang/String;I[ILjava/lang/StringBuffer;ILjava/lang/String;)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream;") \ METHOD (launchURL, "launchURL", "(Ljava/lang/String;)V") \ METHOD (showMessageBox, "showMessageBox", "(Ljava/lang/String;Ljava/lang/String;J)V") \ METHOD (showOkCancelBox, "showOkCancelBox", "(Ljava/lang/String;Ljava/lang/String;J)V") \ @@ -403,7 +403,9 @@ struct AndroidThreadScope STATICMETHOD (getLocaleValue, "getLocaleValue", "(Z)Ljava/lang/String;") \ METHOD (scanFile, "scanFile", "(Ljava/lang/String;)V") \ METHOD (getTypeFaceFromAsset, "getTypeFaceFromAsset", "(Ljava/lang/String;)Landroid/graphics/Typeface;") \ - METHOD (getTypeFaceFromByteArray,"getTypeFaceFromByteArray","([B)Landroid/graphics/Typeface;") + METHOD (getTypeFaceFromByteArray,"getTypeFaceFromByteArray","([B)Landroid/graphics/Typeface;") \ + METHOD (setScreenSaver, "setScreenSaver", "(Z)V") \ + METHOD (getScreenSaver, "getScreenSaver", "()Z") DECLARE_JNI_CLASS (JuceAppActivity, JUCE_ANDROID_ACTIVITY_CLASSPATH); #undef JNI_CLASS_MEMBERS diff --git a/source/modules/juce_core/native/juce_android_Misc.cpp b/source/modules/juce_core/native/juce_android_Misc.cpp index d26adc185..3333112eb 100644 --- a/source/modules/juce_core/native/juce_android_Misc.cpp +++ b/source/modules/juce_core/native/juce_android_Misc.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_android_Network.cpp b/source/modules/juce_core/native/juce_android_Network.cpp index 46d13fe10..ef7a3c75d 100644 --- a/source/modules/juce_core/native/juce_android_Network.cpp +++ b/source/modules/juce_core/native/juce_android_Network.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -70,7 +70,8 @@ class WebInputStream : public InputStream public: WebInputStream (String address, bool isPost, const MemoryBlock& postData, URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, - const String& headers, int timeOutMs, StringPairArray* responseHeaders, const int numRedirectsToFollow) + const String& headers, int timeOutMs, StringPairArray* responseHeaders, + const int numRedirectsToFollow, const String& httpRequest) : statusCode (0) { if (! address.contains ("://")) @@ -104,7 +105,8 @@ public: (jint) timeOutMs, statusCodeArray, responseHeaderBuffer.get(), - (jint) numRedirectsToFollow)); + (jint) numRedirectsToFollow, + javaString (httpRequest).get())); jint* const statusCodeElements = env->GetIntArrayElements (statusCodeArray, 0); statusCode = statusCodeElements[0]; diff --git a/source/modules/juce_core/native/juce_android_SystemStats.cpp b/source/modules/juce_core/native/juce_android_SystemStats.cpp index 47ac03aa4..07facfc56 100644 --- a/source/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/source/modules/juce_core/native/juce_android_SystemStats.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_android_Threads.cpp b/source/modules/juce_core/native/juce_android_Threads.cpp index 981be9ae4..b601e9792 100644 --- a/source/modules/juce_core/native/juce_android_Threads.cpp +++ b/source/modules/juce_core/native/juce_android_Threads.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_curl_Network.cpp b/source/modules/juce_core/native/juce_curl_Network.cpp index 769965673..f3a63832c 100644 --- a/source/modules/juce_core/native/juce_curl_Network.cpp +++ b/source/modules/juce_core/native/juce_curl_Network.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -26,14 +26,13 @@ ============================================================================== */ - class WebInputStream : public InputStream { public: WebInputStream (const String& address, bool isPost, const MemoryBlock& postData, URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, const String& headers, int timeOutMs, StringPairArray* responseHeaders, - const int maxRedirects) + const int maxRedirects, const String& httpRequest) : multi (nullptr), curl (nullptr), headerList (nullptr), lastError (CURLE_OK), contentLength (-1), streamPos (0), finished (false), skipBytes (0), @@ -42,7 +41,7 @@ public: statusCode = -1; if (init() && setOptions (address, timeOutMs, (responseHeaders != nullptr), - maxRedirects, headers, isPost, postData.getSize())) + maxRedirects, headers, isPost, httpRequest, postData.getSize())) { connect (responseHeaders, isPost, postData, progressCallback, progressCallbackContext); } @@ -132,7 +131,7 @@ private: //============================================================================== bool setOptions (const String& address, int timeOutMs, bool wantsHeaders, const int maxRedirects, const String& headers, - bool isPost, size_t postSize) + bool isPost, const String& httpRequest, size_t postSize) { if (curl_easy_setopt (curl, CURLOPT_URL, address.toRawUTF8()) == CURLE_OK && curl_easy_setopt (curl, CURLOPT_WRITEDATA, this) == CURLE_OK @@ -150,6 +149,14 @@ private: return false; } + // handle special http request commands + bool hasSpecialRequestCmd = isPost ? (httpRequest != "POST") : (httpRequest != "GET"); + if (hasSpecialRequestCmd) + { + if (curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, httpRequest.toRawUTF8()) != CURLE_OK) + return false; + } + // do we want to parse the headers if (wantsHeaders) { diff --git a/source/modules/juce_core/native/juce_linux_CommonFile.cpp b/source/modules/juce_core/native/juce_linux_CommonFile.cpp index acdb48a41..924d5e905 100644 --- a/source/modules/juce_core/native/juce_linux_CommonFile.cpp +++ b/source/modules/juce_core/native/juce_linux_CommonFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_linux_Files.cpp b/source/modules/juce_core/native/juce_linux_Files.cpp index a0941abae..a8f641b41 100644 --- a/source/modules/juce_core/native/juce_linux_Files.cpp +++ b/source/modules/juce_core/native/juce_linux_Files.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_linux_Network.cpp b/source/modules/juce_core/native/juce_linux_Network.cpp index a2339c5de..30a05823b 100644 --- a/source/modules/juce_core/native/juce_linux_Network.cpp +++ b/source/modules/juce_core/native/juce_linux_Network.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -75,11 +75,11 @@ public: WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_, URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, const String& headers_, int timeOutMs_, StringPairArray* responseHeaders, - const int maxRedirects) + const int maxRedirects, const String& httpRequestCmd_) : statusCode (0), socketHandle (-1), levelsOfRedirection (0), address (address_), headers (headers_), postData (postData_), contentLength (-1), position (0), finished (false), isPost (isPost_), timeOutMs (timeOutMs_), numRedirectsToFollow (maxRedirects), - chunkEnd (0), isChunked (false), readingChunk (false) + httpRequestCmd (httpRequestCmd_), chunkEnd (0), isChunked (false), readingChunk (false) { statusCode = createConnection (progressCallback, progressCallbackContext, numRedirectsToFollow); @@ -159,7 +159,7 @@ public: } if (bytesToRead > chunkEnd - position) - bytesToRead = chunkEnd - position; + bytesToRead = static_cast (chunkEnd - position); } fd_set readbits; @@ -218,6 +218,7 @@ private: const bool isPost; const int timeOutMs; const int numRedirectsToFollow; + String httpRequestCmd; int64 chunkEnd; bool isChunked, readingChunk; @@ -306,8 +307,8 @@ private: freeaddrinfo (result); { - const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, proxyName, proxyPort, - hostPath, address, headers, postData, isPost)); + const MemoryBlock requestHeader (createRequestHeader (hostName, hostPort, proxyName, proxyPort, hostPath, + address, headers, postData, isPost, httpRequestCmd)); if (! sendHeader (socketHandle, requestHeader, timeOutTime, progressCallback, progressCallbackContext)) @@ -399,10 +400,10 @@ private: dest << "\r\n" << key << ' ' << value; } - static void writeHost (MemoryOutputStream& dest, const bool isPost, + static void writeHost (MemoryOutputStream& dest, const String& httpRequestCmd, const String& path, const String& host, int port) { - dest << (isPost ? "POST " : "GET ") << path << " HTTP/1.1\r\nHost: " << host; + dest << httpRequestCmd << ' ' << path << " HTTP/1.1\r\nHost: " << host; /* HTTP spec 14.23 says that the port number must be included in the header if it is not 80 */ if (port != 80) @@ -413,14 +414,14 @@ private: const String& proxyName, const int proxyPort, const String& hostPath, const String& originalURL, const String& userHeaders, const MemoryBlock& postData, - const bool isPost) + const bool isPost, const String& httpRequestCmd) { MemoryOutputStream header; if (proxyName.isEmpty()) - writeHost (header, isPost, hostPath, hostName, hostPort); + writeHost (header, httpRequestCmd, hostPath, hostName, hostPort); else - writeHost (header, isPost, originalURL, proxyName, proxyPort); + writeHost (header, httpRequestCmd, originalURL, proxyName, proxyPort); writeValueIfNotPresent (header, userHeaders, "User-Agent:", "JUCE/" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "." JUCE_STRINGIFY(JUCE_MINOR_VERSION) diff --git a/source/modules/juce_core/native/juce_linux_SystemStats.cpp b/source/modules/juce_core/native/juce_linux_SystemStats.cpp index 48e9313f5..9ac6901b9 100644 --- a/source/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/source/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_linux_Threads.cpp b/source/modules/juce_core/native/juce_linux_Threads.cpp index f28eff692..b9d3d4506 100644 --- a/source/modules/juce_core/native/juce_linux_Threads.cpp +++ b/source/modules/juce_core/native/juce_linux_Threads.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_mac_Files.mm b/source/modules/juce_core/native/juce_mac_Files.mm index fdebd6953..dabd97211 100644 --- a/source/modules/juce_core/native/juce_mac_Files.mm +++ b/source/modules/juce_core/native/juce_mac_Files.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -106,8 +106,7 @@ namespace FileHelpers return nsStringToJuce ([NSSearchPathForDirectoriesInDomains (type, NSUserDomainMask, YES) objectAtIndex: 0]); } - #endif - + #else static bool launchExecutable (const String& pathAndArguments) { const char* const argv[4] = { "/bin/sh", "-c", pathAndArguments.toUTF8(), nullptr }; @@ -127,6 +126,7 @@ namespace FileHelpers return cpid >= 0; } + #endif } bool File::isOnCDRomDrive() const diff --git a/source/modules/juce_core/native/juce_mac_Network.mm b/source/modules/juce_core/native/juce_mac_Network.mm index 299bb1135..287bba98d 100644 --- a/source/modules/juce_core/native/juce_mac_Network.mm +++ b/source/modules/juce_core/native/juce_mac_Network.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -350,9 +350,10 @@ public: WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_, URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, const String& headers_, int timeOutMs_, StringPairArray* responseHeaders, - const int numRedirectsToFollow_) + const int numRedirectsToFollow_, const String& httpRequestCmd_) : statusCode (0), address (address_), headers (headers_), postData (postData_), position (0), - finished (false), isPost (isPost_), timeOutMs (timeOutMs_), numRedirectsToFollow (numRedirectsToFollow_) + finished (false), isPost (isPost_), timeOutMs (timeOutMs_), + numRedirectsToFollow (numRedirectsToFollow_), httpRequestCmd (httpRequestCmd_) { JUCE_AUTORELEASEPOOL { @@ -429,6 +430,7 @@ private: const bool isPost; const int timeOutMs; const int numRedirectsToFollow; + String httpRequestCmd; void createConnection (URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext) { @@ -440,7 +442,7 @@ private: if (req != nil) { - [req setHTTPMethod: nsStringLiteral (isPost ? "POST" : "GET")]; + [req setHTTPMethod: [NSString stringWithUTF8String: httpRequestCmd.toRawUTF8()]]; //[req setCachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData]; StringArray headerLines; diff --git a/source/modules/juce_core/native/juce_mac_Strings.mm b/source/modules/juce_core/native/juce_mac_Strings.mm index 7a38b3d80..53341e07f 100644 --- a/source/modules/juce_core/native/juce_mac_Strings.mm +++ b/source/modules/juce_core/native/juce_mac_Strings.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_mac_SystemStats.mm b/source/modules/juce_core/native/juce_mac_SystemStats.mm index f188a9f39..c1b437194 100644 --- a/source/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/source/modules/juce_core/native/juce_mac_SystemStats.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_mac_Threads.mm b/source/modules/juce_core/native/juce_mac_Threads.mm index 004baeb2a..8150a15e0 100644 --- a/source/modules/juce_core/native/juce_mac_Threads.mm +++ b/source/modules/juce_core/native/juce_mac_Threads.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_osx_ObjCHelpers.h b/source/modules/juce_core/native/juce_osx_ObjCHelpers.h index 678ced205..cc7c56a9d 100644 --- a/source/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/source/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_posix_NamedPipe.cpp b/source/modules/juce_core/native/juce_posix_NamedPipe.cpp index d0c0b09af..45a9f8a58 100644 --- a/source/modules/juce_core/native/juce_posix_NamedPipe.cpp +++ b/source/modules/juce_core/native/juce_posix_NamedPipe.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -33,6 +33,8 @@ public: : pipeInName (pipePath + "_in"), pipeOutName (pipePath + "_out"), pipeIn (-1), pipeOut (-1), + createdFifoIn (false), + createdFifoOut (false), createdPipe (createPipe), stopReadOperation (false) { @@ -47,8 +49,8 @@ public: if (createdPipe) { - unlink (pipeInName.toUTF8()); - unlink (pipeOutName.toUTF8()); + if (createdFifoIn) unlink (pipeInName.toUTF8()); + if (createdFifoOut) unlink (pipeOutName.toUTF8()); } } @@ -119,14 +121,22 @@ public: return bytesWritten; } - bool createFifos() const + static bool createFifo (const String& name, bool mustNotExist) { - return (mkfifo (pipeInName .toUTF8(), 0666) == 0 || errno == EEXIST) - && (mkfifo (pipeOutName.toUTF8(), 0666) == 0 || errno == EEXIST); + return mkfifo (name.toUTF8(), 0666) == 0 || ((! mustNotExist) && errno == EEXIST); + } + + bool createFifos (bool mustNotExist) + { + createdFifoIn = createFifo (pipeInName, mustNotExist); + createdFifoOut = createFifo (pipeOutName, mustNotExist); + + return createdFifoIn && createdFifoOut; } const String pipeInName, pipeOutName; int pipeIn, pipeOut; + bool createdFifoIn, createdFifoOut; const bool createdPipe; bool stopReadOperation; @@ -188,7 +198,7 @@ void NamedPipe::close() } } -bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) +bool NamedPipe::openInternal (const String& pipeName, const bool createPipe, bool mustNotExist) { #if JUCE_IOS pimpl = new Pimpl (File::getSpecialLocation (File::tempDirectory) @@ -202,7 +212,7 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) pimpl = new Pimpl (file, createPipe); #endif - if (createPipe && ! pimpl->createFifos()) + if (createPipe && ! pimpl->createFifos (mustNotExist)) { pimpl = nullptr; return false; diff --git a/source/modules/juce_core/native/juce_posix_SharedCode.h b/source/modules/juce_core/native/juce_posix_SharedCode.h index 3e006ccd1..c4fa9c54c 100644 --- a/source/modules/juce_core/native/juce_posix_SharedCode.h +++ b/source/modules/juce_core/native/juce_posix_SharedCode.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -578,16 +578,10 @@ MemoryMappedFile::~MemoryMappedFile() } //============================================================================== -#if JUCE_PROJUCER_LIVE_BUILD -extern "C" const char* juce_getCurrentExecutablePath(); -#endif - File juce_getExecutableFile(); File juce_getExecutableFile() { - #if JUCE_PROJUCER_LIVE_BUILD - return File (juce_getCurrentExecutablePath()); - #elif JUCE_ANDROID + #if JUCE_ANDROID return File (android.appFile); #else struct DLAddrReader diff --git a/source/modules/juce_core/native/juce_win32_ComSmartPtr.h b/source/modules/juce_core/native/juce_win32_ComSmartPtr.h index 0dc0efc20..10d5d204c 100644 --- a/source/modules/juce_core/native/juce_win32_ComSmartPtr.h +++ b/source/modules/juce_core/native/juce_win32_ComSmartPtr.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_win32_Files.cpp b/source/modules/juce_core/native/juce_win32_Files.cpp index c51a370f0..5408efaea 100644 --- a/source/modules/juce_core/native/juce_win32_Files.cpp +++ b/source/modules/juce_core/native/juce_win32_Files.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -292,12 +292,12 @@ void FileOutputStream::closeHandle() CloseHandle ((HANDLE) fileHandle); } -ssize_t FileOutputStream::writeInternal (const void* buffer, size_t numBytes) +ssize_t FileOutputStream::writeInternal (const void* bufferToWrite, size_t numBytes) { if (fileHandle != nullptr) { DWORD actualNum = 0; - if (! WriteFile ((HANDLE) fileHandle, buffer, (DWORD) numBytes, &actualNum, 0)) + if (! WriteFile ((HANDLE) fileHandle, bufferToWrite, (DWORD) numBytes, &actualNum, 0)) status = WindowsFileHelpers::getResultForLastError(); return (ssize_t) actualNum; @@ -788,7 +788,7 @@ void File::revealToUser() const class NamedPipe::Pimpl { public: - Pimpl (const String& pipeName, const bool createPipe) + Pimpl (const String& pipeName, const bool createPipe, bool mustNotExist) : filename ("\\\\.\\pipe\\" + File::createLegalFileName (pipeName)), pipeH (INVALID_HANDLE_VALUE), cancelEvent (CreateEvent (0, FALSE, FALSE, 0)), @@ -800,7 +800,7 @@ public: PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, 0, PIPE_UNLIMITED_INSTANCES, 4096, 4096, 0, 0); - if (GetLastError() == ERROR_ALREADY_EXISTS) + if (mustNotExist && GetLastError() == ERROR_ALREADY_EXISTS) closePipeHandle(); } } @@ -995,9 +995,9 @@ void NamedPipe::close() } } -bool NamedPipe::openInternal (const String& pipeName, const bool createPipe) +bool NamedPipe::openInternal (const String& pipeName, const bool createPipe, bool mustNotExist) { - pimpl = new Pimpl (pipeName, createPipe); + pimpl = new Pimpl (pipeName, createPipe, mustNotExist); if (createPipe && pimpl->pipeH == INVALID_HANDLE_VALUE) { diff --git a/source/modules/juce_core/native/juce_win32_Network.cpp b/source/modules/juce_core/native/juce_win32_Network.cpp index 7e555cc52..437a6e50a 100644 --- a/source/modules/juce_core/native/juce_win32_Network.cpp +++ b/source/modules/juce_core/native/juce_win32_Network.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -40,10 +40,11 @@ class WebInputStream : public InputStream public: WebInputStream (const String& address_, bool isPost_, const MemoryBlock& postData_, URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext, - const String& headers_, int timeOutMs_, StringPairArray* responseHeaders, int numRedirectsToFollow) + const String& headers_, int timeOutMs_, StringPairArray* responseHeaders, + int numRedirectsToFollow, const String& httpRequestCmd_) : statusCode (0), connection (0), request (0), address (address_), headers (headers_), postData (postData_), position (0), - finished (false), isPost (isPost_), timeOutMs (timeOutMs_) + finished (false), isPost (isPost_), timeOutMs (timeOutMs_), httpRequestCmd (httpRequestCmd_) { while (numRedirectsToFollow-- >= 0) { @@ -52,7 +53,7 @@ public: if (! isError()) { DWORD bufferSizeBytes = 4096; - StringPairArray headers (false); + StringPairArray dataHeaders (false); for (;;) { @@ -68,8 +69,8 @@ public: const String& header = headersArray[i]; const String key (header.upToFirstOccurrenceOf (": ", false, false)); const String value (header.fromFirstOccurrenceOf (": ", false, false)); - const String previousValue (headers[key]); - headers.set (key, previousValue.isEmpty() ? value : (previousValue + "," + value)); + const String previousValue (dataHeaders[key]); + dataHeaders.set (key, previousValue.isEmpty() ? value : (previousValue + "," + value)); } break; @@ -91,7 +92,7 @@ public: if (numRedirectsToFollow >= 0 && (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 307)) { - String newLocation (headers["Location"]); + String newLocation (dataHeaders["Location"]); // Check whether location is a relative URI - this is an incomplete test for relative path, // but we'll use it for now (valid protocols for this implementation are http, https & ftp) @@ -114,7 +115,7 @@ public: } if (responseHeaders != nullptr) - responseHeaders->addArray (headers); + responseHeaders->addArray (dataHeaders); } break; @@ -198,6 +199,7 @@ private: bool finished; const bool isPost; int timeOutMs; + String httpRequestCmd; void close() { @@ -299,7 +301,7 @@ private: flags |= INTERNET_FLAG_SECURE; // (this flag only seems necessary if the OS is running IE6 - // IE7 seems to automatically work out when it's https) - request = HttpOpenRequest (connection, isPost ? _T("POST") : _T("GET"), + request = HttpOpenRequest (connection, httpRequestCmd.toWideCharPointer(), uc.lpszUrlPath, 0, 0, mimeTypes, flags, 0); if (request != 0) diff --git a/source/modules/juce_core/native/juce_win32_Registry.cpp b/source/modules/juce_core/native/juce_win32_Registry.cpp index 811947439..164f2e24c 100644 --- a/source/modules/juce_core/native/juce_win32_Registry.cpp +++ b/source/modules/juce_core/native/juce_win32_Registry.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_win32_SystemStats.cpp b/source/modules/juce_core/native/juce_win32_SystemStats.cpp index 0943f205d..b9007d32e 100644 --- a/source/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/source/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/native/juce_win32_Threads.cpp b/source/modules/juce_core/native/juce_win32_Threads.cpp index ca22ea07c..9856fd307 100644 --- a/source/modules/juce_core/native/juce_win32_Threads.cpp +++ b/source/modules/juce_core/native/juce_win32_Threads.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -110,7 +110,7 @@ void Thread::launchThread() { unsigned int newThreadId; threadHandle = (void*) _beginthreadex (0, 0, &threadEntryProc, this, 0, &newThreadId); - threadId = (ThreadID) newThreadId; + threadId = (ThreadID) (pointer_sized_int) newThreadId; } void Thread::closeThreadHandle() @@ -457,11 +457,11 @@ public: STARTUPINFOW startupInfo = { 0 }; startupInfo.cb = sizeof (startupInfo); - startupInfo.hStdOutput = (streamFlags | wantStdOut) != 0 ? writePipe : 0; - startupInfo.hStdError = (streamFlags | wantStdErr) != 0 ? writePipe : 0; + startupInfo.hStdOutput = (streamFlags & wantStdOut) != 0 ? writePipe : 0; + startupInfo.hStdError = (streamFlags & wantStdErr) != 0 ? writePipe : 0; startupInfo.dwFlags = STARTF_USESTDHANDLES; - ok = CreateProcess (nullptr, const_cast (command.toWideCharPointer()), + ok = CreateProcess (nullptr, const_cast (command.toWideCharPointer()), nullptr, nullptr, TRUE, CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, nullptr, nullptr, &startupInfo, &processInfo) != FALSE; } diff --git a/source/modules/juce_core/network/juce_IPAddress.cpp b/source/modules/juce_core/network/juce_IPAddress.cpp index 5560a49b0..5f137fc9b 100644 --- a/source/modules/juce_core/network/juce_IPAddress.cpp +++ b/source/modules/juce_core/network/juce_IPAddress.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/network/juce_IPAddress.h b/source/modules/juce_core/network/juce_IPAddress.h index 1f2f0e810..eb82e3fe6 100644 --- a/source/modules/juce_core/network/juce_IPAddress.h +++ b/source/modules/juce_core/network/juce_IPAddress.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/network/juce_MACAddress.cpp b/source/modules/juce_core/network/juce_MACAddress.cpp index b7cb3c115..78391f8d4 100644 --- a/source/modules/juce_core/network/juce_MACAddress.cpp +++ b/source/modules/juce_core/network/juce_MACAddress.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/network/juce_MACAddress.h b/source/modules/juce_core/network/juce_MACAddress.h index 67e119ec7..10a55f7d1 100644 --- a/source/modules/juce_core/network/juce_MACAddress.h +++ b/source/modules/juce_core/network/juce_MACAddress.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/network/juce_NamedPipe.cpp b/source/modules/juce_core/network/juce_NamedPipe.cpp index 488e63f41..d498ed158 100644 --- a/source/modules/juce_core/network/juce_NamedPipe.cpp +++ b/source/modules/juce_core/network/juce_NamedPipe.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -41,7 +41,7 @@ bool NamedPipe::openExisting (const String& pipeName) ScopedWriteLock sl (lock); currentPipeName = pipeName; - return openInternal (pipeName, false); + return openInternal (pipeName, false, false); } bool NamedPipe::isOpen() const @@ -49,13 +49,13 @@ bool NamedPipe::isOpen() const return pimpl != nullptr; } -bool NamedPipe::createNewPipe (const String& pipeName) +bool NamedPipe::createNewPipe (const String& pipeName, bool mustNotExist) { close(); ScopedWriteLock sl (lock); currentPipeName = pipeName; - return openInternal (pipeName, true); + return openInternal (pipeName, true, mustNotExist); } String NamedPipe::getName() const diff --git a/source/modules/juce_core/network/juce_NamedPipe.h b/source/modules/juce_core/network/juce_NamedPipe.h index d2029bd02..b0973fcdf 100644 --- a/source/modules/juce_core/network/juce_NamedPipe.h +++ b/source/modules/juce_core/network/juce_NamedPipe.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -56,8 +56,10 @@ public: /** Tries to create a new pipe. Returns true if it succeeds. + If mustNotExist is true then it will fail if a pipe is already + open with the same name. */ - bool createNewPipe (const String& pipeName); + bool createNewPipe (const String& pipeName, bool mustNotExist = false); /** Closes the pipe, if it's open. */ void close(); @@ -95,7 +97,7 @@ private: String currentPipeName; ReadWriteLock lock; - bool openInternal (const String& pipeName, const bool createPipe); + bool openInternal (const String& pipeName, bool createPipe, bool mustNotExist); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NamedPipe) }; diff --git a/source/modules/juce_core/network/juce_Socket.cpp b/source/modules/juce_core/network/juce_Socket.cpp index 10de2f7f2..64c770885 100644 --- a/source/modules/juce_core/network/juce_Socket.cpp +++ b/source/modules/juce_core/network/juce_Socket.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -62,17 +62,25 @@ namespace SocketHelpers #endif } - static bool resetSocketOptions (const SocketHandle handle, const bool isDatagram, const bool allowBroadcast) noexcept + template + static bool setOption (const SocketHandle handle, int mode, int property, Type value) noexcept + { + return setsockopt (handle, mode, property, reinterpret_cast (&value), sizeof (value)) == 0; + } + + template + static bool setOption (const SocketHandle handle, int property, Type value) noexcept { - const int sndBufSize = 65536; - const int rcvBufSize = 65536; - const int one = 1; + return setOption (handle, SOL_SOCKET, property, value); + } + static bool resetSocketOptions (const SocketHandle handle, const bool isDatagram, const bool allowBroadcast) noexcept + { return handle > 0 - && setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (rcvBufSize)) == 0 - && setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (sndBufSize)) == 0 - && (isDatagram ? ((! allowBroadcast) || setsockopt (handle, SOL_SOCKET, SO_BROADCAST, (const char*) &one, sizeof (one)) == 0) - : (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0)); + && setOption (handle, SO_RCVBUF, (int) 65536) + && setOption (handle, SO_SNDBUF, (int) 65536) + && (isDatagram ? ((! allowBroadcast) || setOption (handle, SO_BROADCAST, (int) 1)) + : setOption (handle, IPPROTO_TCP, TCP_NODELAY, (int) 1)); } static void closeSocket (volatile int& handle, CriticalSection& readLock, @@ -136,8 +144,12 @@ namespace SocketHelpers servTmpAddr.sin_addr.s_addr = htonl (INADDR_ANY); servTmpAddr.sin_port = htons ((uint16) port); + #if JUCE_WINDOWS if (address.isNotEmpty()) servTmpAddr.sin_addr.s_addr = ::inet_addr (address.toUTF8()); + #else + ignoreUnused (address); + #endif return bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0; } @@ -308,8 +320,7 @@ namespace SocketHelpers hints.ai_flags = AI_NUMERICSERV; struct addrinfo* info = nullptr; - if (getaddrinfo (hostName.toUTF8(), String (portNumber).toUTF8(), &hints, &info) == 0 - && info != nullptr) + if (getaddrinfo (hostName.toUTF8(), String (portNumber).toUTF8(), &hints, &info) == 0) return info; return nullptr; @@ -364,8 +375,7 @@ namespace SocketHelpers static void makeReusable (int handle) noexcept { - const int reuse = 1; - setsockopt (handle, SOL_SOCKET, SO_REUSEADDR, (const char*) &reuse, sizeof (reuse)); + setOption (handle, SO_REUSEADDR, (int) 1); } static bool multicast (int handle, const String& multicastIPAddress, @@ -380,9 +390,10 @@ namespace SocketHelpers if (interfaceIPAddress.isNotEmpty()) mreq.imr_interface.s_addr = inet_addr (interfaceIPAddress.toUTF8()); - int joinCmd = join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP; - - return setsockopt (handle, IPPROTO_IP, joinCmd, (const char*) &mreq, sizeof (mreq)) == 0; + return setsockopt (handle, IPPROTO_IP, + join ? IP_ADD_MEMBERSHIP + : IP_DROP_MEMBERSHIP, + (const char*) &mreq, sizeof (mreq)) == 0; } } @@ -569,17 +580,31 @@ DatagramSocket::DatagramSocket (const bool canBroadcast) SocketHelpers::initSockets(); handle = (int) socket (AF_INET, SOCK_DGRAM, 0); - SocketHelpers::resetSocketOptions (handle, true, canBroadcast); - SocketHelpers::makeReusable (handle); + + if (handle >= 0) + { + SocketHelpers::resetSocketOptions (handle, true, canBroadcast); + SocketHelpers::makeReusable (handle); + } } DatagramSocket::~DatagramSocket() { if (lastServerAddress != nullptr) - freeaddrinfo (static_cast (lastServerAddress)); + freeaddrinfo (static_cast (lastServerAddress)); + shutdown(); +} + +void DatagramSocket::shutdown() +{ + if (handle < 0) + return; + + int copyOfHandle = handle; + handle = -1; bool connected = false; - SocketHelpers::closeSocket (handle, readLock, false, 0, connected); + SocketHelpers::closeSocket (copyOfHandle, readLock, false, 0, connected); } bool DatagramSocket::bindToPort (const int port) @@ -589,6 +614,9 @@ bool DatagramSocket::bindToPort (const int port) bool DatagramSocket::bindToPort (const int port, const String& addr) { + if (handle < 0) + return false; + if (SocketHelpers::bindSocket (handle, port, addr)) { isBound = true; @@ -602,6 +630,9 @@ bool DatagramSocket::bindToPort (const int port, const String& addr) int DatagramSocket::getBoundPort() const noexcept { + if (handle < 0) + return -1; + return isBound ? SocketHelpers::getBoundPort (handle) : -1; } @@ -609,11 +640,17 @@ int DatagramSocket::getBoundPort() const noexcept int DatagramSocket::waitUntilReady (const bool readyForReading, const int timeoutMsecs) const { + if (handle < 0) + return -1; + return SocketHelpers::waitForReadiness (handle, readLock, readyForReading, timeoutMsecs); } int DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock) { + if (handle < 0) + return -1; + bool connected = true; return isBound ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead, connected, shouldBlock, readLock) : -1; @@ -621,6 +658,9 @@ int DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock int DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock, String& senderIPAddress, int& senderPort) { + if (handle < 0) + return -1; + bool connected = true; return isBound ? SocketHelpers::readSocket (handle, destBuffer, maxBytesToRead, connected, shouldBlock, readLock, &senderIPAddress, &senderPort) : -1; @@ -629,7 +669,10 @@ int DatagramSocket::read (void* destBuffer, int maxBytesToRead, bool shouldBlock int DatagramSocket::write (const String& remoteHostname, int remotePortNumber, const void* sourceBuffer, int numBytesToWrite) { - struct addrinfo*& info = reinterpret_cast (lastServerAddress); + if (handle < 0) + return -1; + + struct addrinfo*& info = reinterpret_cast (lastServerAddress); // getaddrinfo can be quite slow so cache the result of the address lookup if (info == nullptr || remoteHostname != lastServerHost || remotePortNumber != lastServerPort) @@ -651,7 +694,7 @@ int DatagramSocket::write (const String& remoteHostname, int remotePortNumber, bool DatagramSocket::joinMulticast (const String& multicastIPAddress) { - if (! isBound) + if (! isBound || handle < 0) return false; return SocketHelpers::multicast (handle, multicastIPAddress, lastBindAddress, true); @@ -659,12 +702,28 @@ bool DatagramSocket::joinMulticast (const String& multicastIPAddress) bool DatagramSocket::leaveMulticast (const String& multicastIPAddress) { - if (! isBound) + if (! isBound || handle < 0) return false; return SocketHelpers::multicast (handle, multicastIPAddress, lastBindAddress, false); } +bool DatagramSocket::setEnablePortReuse (bool enabled) +{ + #if ! JUCE_ANDROID + if (handle >= 0) + return SocketHelpers::setOption (handle, + #if JUCE_WINDOWS || JUCE_LINUX + SO_REUSEADDR, // port re-use is implied by addr re-use on these platforms + #else + SO_REUSEPORT, + #endif + (int) (enabled ? 1 : 0)); + #endif + + return false; +} + #if JUCE_MSVC #pragma warning (pop) #endif diff --git a/source/modules/juce_core/network/juce_Socket.h b/source/modules/juce_core/network/juce_Socket.h index d35847dd6..c6be4e71c 100644 --- a/source/modules/juce_core/network/juce_Socket.h +++ b/source/modules/juce_core/network/juce_Socket.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -306,6 +306,20 @@ public: int write (const String& remoteHostname, int remotePortNumber, const void* sourceBuffer, int numBytesToWrite); + /** Closes the underlying socket object. + + Closes the underlying socket object and aborts any read or write operations. + Note that all other methods will return an error after this call. This + method is useful if another thread is blocking in a read/write call and you + would like to abort the read/write thread. Simply deleting the socket + object without calling shutdown may cause a race-condition where the read/write + returns just before the socket is deleted and the subsequent read/write would + try to read from an invalid pointer. By calling shutdown first, the socket + object remains valid but all current and subsequent calls to read/write will + return immediately. + */ + void shutdown(); + //============================================================================== /** Join a multicast group @@ -319,6 +333,17 @@ public: */ bool leaveMulticast (const String& multicastIPAddress); + //============================================================================== + /** Allow other applications to re-use the port. + + Allow any other application currently running to bind to the same port. + Do not use this if your socket handles sensitive data as it could be + read by any, possibly malicious, third-party apps. + + Returns true on success. + */ + bool setEnablePortReuse (bool enabled); + private: //============================================================================== int handle; diff --git a/source/modules/juce_core/network/juce_URL.cpp b/source/modules/juce_core/network/juce_URL.cpp index f6f8620f9..9a0a3e66a 100644 --- a/source/modules/juce_core/network/juce_URL.cpp +++ b/source/modules/juce_core/network/juce_URL.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -249,7 +249,7 @@ void URL::createHeadersAndPostData (String& headers, MemoryBlock& headersAndPost if (filesToUpload.size() > 0) { // (this doesn't currently support mixing custom post-data with uploads..) - jassert (postData.isEmpty()); + jassert (postData.getSize() == 0); const String boundary (String::toHexString (Random::getSystemRandom().nextInt64())); @@ -335,7 +335,8 @@ InputStream* URL::createInputStream (const bool usePostCommand, const int timeOutMs, StringPairArray* const responseHeaders, int* statusCode, - const int numRedirectsToFollow) const + const int numRedirectsToFollow, + String httpRequestCmd) const { MemoryBlock headersAndPostData; @@ -348,11 +349,14 @@ InputStream* URL::createInputStream (const bool usePostCommand, if (! headers.endsWithChar ('\n')) headers << "\r\n"; + if (httpRequestCmd.isEmpty()) + httpRequestCmd = usePostCommand ? "POST" : "GET"; + ScopedPointer wi (new WebInputStream (toString (! usePostCommand), usePostCommand, headersAndPostData, progressCallback, progressCallbackContext, headers, timeOutMs, responseHeaders, - numRedirectsToFollow)); + numRedirectsToFollow, httpRequestCmd)); if (statusCode != nullptr) *statusCode = wi->statusCode; @@ -411,6 +415,11 @@ URL URL::withParameters (const StringPairArray& parametersToAdd) const } URL URL::withPOSTData (const String& newPostData) const +{ + return withPOSTData (MemoryBlock (newPostData.toRawUTF8(), newPostData.getNumBytesAsUTF8())); +} + +URL URL::withPOSTData (const MemoryBlock& newPostData) const { URL u (*this); u.postData = newPostData; diff --git a/source/modules/juce_core/network/juce_URL.h b/source/modules/juce_core/network/juce_URL.h index c02bf9618..a2b3cb765 100644 --- a/source/modules/juce_core/network/juce_URL.h +++ b/source/modules/juce_core/network/juce_URL.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -215,8 +215,25 @@ public: */ URL withPOSTData (const String& postData) const; + /** Returns a copy of this URL, with a block of data to send as the POST data. + + If you're setting the POST data, be careful not to have any parameters set + as well, otherwise it'll all get thrown in together, and might not have the + desired effect. + + If the URL already contains some POST data, this will replace it, rather + than being appended to it. + + This data will only be used if you specify a post operation when you call + createInputStream(). + */ + URL withPOSTData (const MemoryBlock& postData) const; + /** Returns the data that was set using withPOSTData(). */ - const String& getPostData() const noexcept { return postData; } + String getPostData() const noexcept { return postData.toString(); } + + /** Returns the data that was set using withPOSTData() as MemoryBlock. */ + const MemoryBlock& getPostDataAsMemoryBlock() const noexcept { return postData; } //============================================================================== /** Tries to launch the system's default browser to open the URL. @@ -251,37 +268,43 @@ public: Note that on some platforms (Android, for example) it's not permitted to do any network action from the message thread, so you must only call it from a background thread. - @param usePostCommand if true, it will try to do use a http 'POST' to pass - the parameters, otherwise it'll encode them into the - URL and do a 'GET'. - @param progressCallback if this is non-zero, it lets you supply a callback function - to keep track of the operation's progress. This can be useful - for lengthy POST operations, so that you can provide user feedback. + @param doPostLikeRequest if true, the parameters added to this class will be transferred + via the HTTP headers which is typical for POST requests. Otherwise + the parameters will be added to the URL address. Additionally, + if the parameter httpRequestCmd is not specified (or empty) then this + parameter will determine which HTTP request command will be used + (POST or GET). + @param progressCallback if this is non-zero, it lets you supply a callback function + to keep track of the operation's progress. This can be useful + for lengthy POST operations, so that you can provide user feedback. @param progressCallbackContext if a callback is specified, this value will be passed to - the function - @param extraHeaders if not empty, this string is appended onto the headers that - are used for the request. It must therefore be a valid set of HTML - header directives, separated by newlines. + the function + @param extraHeaders if not empty, this string is appended onto the headers that + are used for the request. It must therefore be a valid set of HTML + header directives, separated by newlines. @param connectionTimeOutMs if 0, this will use whatever default setting the OS chooses. If - a negative number, it will be infinite. Otherwise it specifies a - time in milliseconds. - @param responseHeaders if this is non-null, all the (key, value) pairs received as headers - in the response will be stored in this array - @param statusCode if this is non-null, it will get set to the http status code, if one - is known, or 0 if a code isn't available + a negative number, it will be infinite. Otherwise it specifies a + time in milliseconds. + @param responseHeaders if this is non-null, all the (key, value) pairs received as headers + in the response will be stored in this array + @param statusCode if this is non-null, it will get set to the http status code, if one + is known, or 0 if a code isn't available @param numRedirectsToFollow specifies the number of redirects that will be followed before - returning a response (ignored for Android which follows up to 5 redirects) + returning a response (ignored for Android which follows up to 5 redirects) + @param httpRequestCmd Specify which HTTP Request to use. If this is empty, then doPostRequest + will determine the HTTP request. @returns an input stream that the caller must delete, or a null pointer if there was an error trying to open it. */ - InputStream* createInputStream (bool usePostCommand, + InputStream* createInputStream (bool doPostLikeRequest, OpenStreamProgressCallback* progressCallback = nullptr, void* progressCallbackContext = nullptr, String extraHeaders = String(), int connectionTimeOutMs = 0, StringPairArray* responseHeaders = nullptr, int* statusCode = nullptr, - int numRedirectsToFollow = 5) const; + int numRedirectsToFollow = 5, + String httpRequestCmd = String()) const; //============================================================================== @@ -371,7 +394,8 @@ public: private: //============================================================================== - String url, postData; + String url; + MemoryBlock postData; StringArray parameterNames, parameterValues; struct Upload : public ReferenceCountedObject diff --git a/source/modules/juce_core/streams/juce_BufferedInputStream.cpp b/source/modules/juce_core/streams/juce_BufferedInputStream.cpp index ec01f8e1b..ea91f64a5 100644 --- a/source/modules/juce_core/streams/juce_BufferedInputStream.cpp +++ b/source/modules/juce_core/streams/juce_BufferedInputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_BufferedInputStream.h b/source/modules/juce_core/streams/juce_BufferedInputStream.h index 8f1e633be..e0e74a29b 100644 --- a/source/modules/juce_core/streams/juce_BufferedInputStream.h +++ b/source/modules/juce_core/streams/juce_BufferedInputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_FileInputSource.cpp b/source/modules/juce_core/streams/juce_FileInputSource.cpp index 51b9db906..9cbeaf11e 100644 --- a/source/modules/juce_core/streams/juce_FileInputSource.cpp +++ b/source/modules/juce_core/streams/juce_FileInputSource.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_FileInputSource.h b/source/modules/juce_core/streams/juce_FileInputSource.h index d2e6d862f..5a58c770d 100644 --- a/source/modules/juce_core/streams/juce_FileInputSource.h +++ b/source/modules/juce_core/streams/juce_FileInputSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_InputSource.h b/source/modules/juce_core/streams/juce_InputSource.h index 0e13ac520..a571ed0cb 100644 --- a/source/modules/juce_core/streams/juce_InputSource.h +++ b/source/modules/juce_core/streams/juce_InputSource.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_InputStream.cpp b/source/modules/juce_core/streams/juce_InputStream.cpp index 07b9976da..2cf3e00f9 100644 --- a/source/modules/juce_core/streams/juce_InputStream.cpp +++ b/source/modules/juce_core/streams/juce_InputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_InputStream.h b/source/modules/juce_core/streams/juce_InputStream.h index ebdc795fa..0149f0b8a 100644 --- a/source/modules/juce_core/streams/juce_InputStream.h +++ b/source/modules/juce_core/streams/juce_InputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_MemoryInputStream.cpp b/source/modules/juce_core/streams/juce_MemoryInputStream.cpp index 82b2d141e..da94088bc 100644 --- a/source/modules/juce_core/streams/juce_MemoryInputStream.cpp +++ b/source/modules/juce_core/streams/juce_MemoryInputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -101,7 +101,7 @@ class MemoryStreamTests : public UnitTest public: MemoryStreamTests() : UnitTest ("MemoryInputStream & MemoryOutputStream") {} - void runTest() + void runTest() override { beginTest ("Basics"); Random r = getRandom(); diff --git a/source/modules/juce_core/streams/juce_MemoryInputStream.h b/source/modules/juce_core/streams/juce_MemoryInputStream.h index 013bc39f6..6350f658d 100644 --- a/source/modules/juce_core/streams/juce_MemoryInputStream.h +++ b/source/modules/juce_core/streams/juce_MemoryInputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_MemoryOutputStream.cpp b/source/modules/juce_core/streams/juce_MemoryOutputStream.cpp index 28a558570..9c026700d 100644 --- a/source/modules/juce_core/streams/juce_MemoryOutputStream.cpp +++ b/source/modules/juce_core/streams/juce_MemoryOutputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_MemoryOutputStream.h b/source/modules/juce_core/streams/juce_MemoryOutputStream.h index 33cbb2e8c..6109444c0 100644 --- a/source/modules/juce_core/streams/juce_MemoryOutputStream.h +++ b/source/modules/juce_core/streams/juce_MemoryOutputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_OutputStream.cpp b/source/modules/juce_core/streams/juce_OutputStream.cpp index c67e3fb8c..8b5585f3a 100644 --- a/source/modules/juce_core/streams/juce_OutputStream.cpp +++ b/source/modules/juce_core/streams/juce_OutputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_OutputStream.h b/source/modules/juce_core/streams/juce_OutputStream.h index 102ab5a01..407d34218 100644 --- a/source/modules/juce_core/streams/juce_OutputStream.h +++ b/source/modules/juce_core/streams/juce_OutputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_SubregionStream.cpp b/source/modules/juce_core/streams/juce_SubregionStream.cpp index c998c7984..4398ab776 100644 --- a/source/modules/juce_core/streams/juce_SubregionStream.cpp +++ b/source/modules/juce_core/streams/juce_SubregionStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/streams/juce_SubregionStream.h b/source/modules/juce_core/streams/juce_SubregionStream.h index d291a03c3..55e4ccc85 100644 --- a/source/modules/juce_core/streams/juce_SubregionStream.h +++ b/source/modules/juce_core/streams/juce_SubregionStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/system/juce_CompilerSupport.h b/source/modules/juce_core/system/juce_CompilerSupport.h index 4b2b35704..103cd5132 100644 --- a/source/modules/juce_core/system/juce_CompilerSupport.h +++ b/source/modules/juce_core/system/juce_CompilerSupport.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -54,6 +54,12 @@ #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ! defined (JUCE_COMPILER_SUPPORTS_LAMBDAS) #define JUCE_COMPILER_SUPPORTS_LAMBDAS 1 #endif + + #ifndef JUCE_EXCEPTIONS_DISABLED + #if ! __EXCEPTIONS + #define JUCE_EXCEPTIONS_DISABLED 1 + #endif + #endif #endif //============================================================================== @@ -95,6 +101,12 @@ #define JUCE_COMPILER_SUPPORTS_ARC 1 #endif + #ifndef JUCE_EXCEPTIONS_DISABLED + #if ! __has_feature (cxx_exceptions) + #define JUCE_EXCEPTIONS_DISABLED 1 + #endif + #endif + #endif //============================================================================== @@ -119,6 +131,12 @@ #if _MSC_VER >= 1900 #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 #endif + + #ifndef JUCE_EXCEPTIONS_DISABLED + #if ! _CPPUNWIND + #define JUCE_EXCEPTIONS_DISABLED 1 + #endif + #endif #endif //============================================================================== diff --git a/source/modules/juce_core/system/juce_PlatformDefs.h b/source/modules/juce_core/system/juce_PlatformDefs.h index 43602f4d1..64dad9000 100644 --- a/source/modules/juce_core/system/juce_PlatformDefs.h +++ b/source/modules/juce_core/system/juce_PlatformDefs.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -228,7 +228,7 @@ namespace juce //============================================================================== #if JUCE_MSVC && ! defined (DOXYGEN) #define JUCE_WARNING_HELPER(file, line, mess) message(file "(" JUCE_STRINGIFY (line) ") : Warning: " #mess) - #define JUCE_COMPILER_WARNING(message) __pragma(JUCE_WARNING_HELPER (__FILE__, __LINE__, message)); + #define JUCE_COMPILER_WARNING(message) __pragma(JUCE_WARNING_HELPER (__FILE__, __LINE__, message)) #else #ifndef DOXYGEN #define JUCE_WARNING_HELPER(mess) message(#mess) @@ -241,7 +241,7 @@ namespace juce GCC and Clang provide the \#warning directive, but MSVC doesn't, so this macro is a cross-compiler way to get the same functionality as \#warning. */ - #define JUCE_COMPILER_WARNING(message) _Pragma(JUCE_STRINGIFY (JUCE_WARNING_HELPER (message))); + #define JUCE_COMPILER_WARNING(message) _Pragma(JUCE_STRINGIFY (JUCE_WARNING_HELPER (message))) #endif diff --git a/source/modules/juce_core/system/juce_StandardHeader.h b/source/modules/juce_core/system/juce_StandardHeader.h index b70c98163..af40d3fc0 100644 --- a/source/modules/juce_core/system/juce_StandardHeader.h +++ b/source/modules/juce_core/system/juce_StandardHeader.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -35,8 +35,8 @@ See also SystemStats::getJUCEVersion() for a string version. */ #define JUCE_MAJOR_VERSION 3 -#define JUCE_MINOR_VERSION 1 -#define JUCE_BUILDNUMBER 1 +#define JUCE_MINOR_VERSION 2 +#define JUCE_BUILDNUMBER 0 /** Current Juce version number. @@ -104,6 +104,10 @@ #pragma warning (pop) #endif +#if JUCE_MINGW + #include +#endif + #if JUCE_ANDROID #include #include @@ -114,6 +118,9 @@ #undef TYPE_BOOL #undef max #undef min +#undef major +#undef minor +#undef KeyPress //============================================================================== // DLL building settings on Windows diff --git a/source/modules/juce_core/system/juce_SystemStats.cpp b/source/modules/juce_core/system/juce_SystemStats.cpp index 540cc889e..65bb117cb 100644 --- a/source/modules/juce_core/system/juce_SystemStats.cpp +++ b/source/modules/juce_core/system/juce_SystemStats.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/system/juce_SystemStats.h b/source/modules/juce_core/system/juce_SystemStats.h index 665d86fbb..540bf73ea 100644 --- a/source/modules/juce_core/system/juce_SystemStats.h +++ b/source/modules/juce_core/system/juce_SystemStats.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/system/juce_TargetPlatform.h b/source/modules/juce_core/system/juce_TargetPlatform.h index 63470b668..6f900ec79 100644 --- a/source/modules/juce_core/system/juce_TargetPlatform.h +++ b/source/modules/juce_core/system/juce_TargetPlatform.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -58,6 +58,13 @@ #undef Point #undef Component + #if JUCE_PROJUCER_LIVE_BUILD + // This hack is a workaround for a bug (?) in Apple's 10.11 SDK headers + // which cause some configurations of Clang to throw out an error.. + #undef CF_OPTIONS + #define CF_OPTIONS(_type, _name) _type _name; enum + #endif + #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR #define JUCE_IPHONE 1 #define JUCE_IOS 1 diff --git a/source/modules/juce_core/text/juce_CharPointer_ASCII.h b/source/modules/juce_core/text/juce_CharPointer_ASCII.h index a8e8de841..e85af4ba6 100644 --- a/source/modules/juce_core/text/juce_CharPointer_ASCII.h +++ b/source/modules/juce_core/text/juce_CharPointer_ASCII.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -276,10 +276,10 @@ public: int compareIgnoreCase (const CharPointer_ASCII other) const { - #if JUCE_MSVC - return stricmp (data, other.data); - #elif JUCE_MINGW + #if JUCE_MINGW || (JUCE_WINDOWS && JUCE_CLANG) return CharacterFunctions::compareIgnoreCase (*this, other); + #elif JUCE_WINDOWS + return stricmp (data, other.data); #else return strcasecmp (data, other.data); #endif diff --git a/source/modules/juce_core/text/juce_CharPointer_UTF16.h b/source/modules/juce_core/text/juce_CharPointer_UTF16.h index 50d18901b..7a245e136 100644 --- a/source/modules/juce_core/text/juce_CharPointer_UTF16.h +++ b/source/modules/juce_core/text/juce_CharPointer_UTF16.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_CharPointer_UTF32.h b/source/modules/juce_core/text/juce_CharPointer_UTF32.h index 42cfe4871..9e96d7057 100644 --- a/source/modules/juce_core/text/juce_CharPointer_UTF32.h +++ b/source/modules/juce_core/text/juce_CharPointer_UTF32.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_CharPointer_UTF8.h b/source/modules/juce_core/text/juce_CharPointer_UTF8.h index 6cc5ebf4f..107d9c4a9 100644 --- a/source/modules/juce_core/text/juce_CharPointer_UTF8.h +++ b/source/modules/juce_core/text/juce_CharPointer_UTF8.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -90,9 +90,9 @@ public: uint32 n = (uint32) (uint8) byte; uint32 mask = 0x7f; uint32 bit = 0x40; - size_t numExtraValues = 0; + int numExtraValues = 0; - while ((n & bit) != 0 && bit > 0x10) + while ((n & bit) != 0 && bit > 0x8) { mask >>= 1; ++numExtraValues; @@ -101,9 +101,9 @@ public: n &= mask; - for (size_t i = 1; i <= numExtraValues; ++i) + for (int i = 1; i <= numExtraValues; ++i) { - const uint8 nextByte = (uint8) data [i]; + const uint32 nextByte = (uint32) (uint8) data[i]; if ((nextByte & 0xc0) != 0x80) break; @@ -312,9 +312,8 @@ public: static size_t getBytesRequiredFor (CharPointer text) noexcept { size_t count = 0; - juce_wchar n; - while ((n = text.getAndAdvance()) != 0) + while (juce_wchar n = text.getAndAdvance()) count += getBytesRequiredFor (n); return count; @@ -421,10 +420,10 @@ public: /** Compares this string with another one. */ int compareIgnoreCase (const CharPointer_UTF8 other) const noexcept { - #if JUCE_MSVC - return stricmp (data, other.data); - #elif JUCE_MINGW + #if JUCE_MINGW || (JUCE_WINDOWS && JUCE_CLANG) return CharacterFunctions::compareIgnoreCase (*this, other); + #elif JUCE_WINDOWS + return stricmp (data, other.data); #else return strcasecmp (data, other.data); #endif diff --git a/source/modules/juce_core/text/juce_CharacterFunctions.cpp b/source/modules/juce_core/text/juce_CharacterFunctions.cpp index b33940594..9b9d7a9d8 100644 --- a/source/modules/juce_core/text/juce_CharacterFunctions.cpp +++ b/source/modules/juce_core/text/juce_CharacterFunctions.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_CharacterFunctions.h b/source/modules/juce_core/text/juce_CharacterFunctions.h index bade0dd70..485d0e332 100644 --- a/source/modules/juce_core/text/juce_CharacterFunctions.h +++ b/source/modules/juce_core/text/juce_CharacterFunctions.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -331,15 +331,8 @@ public: template static void copyAll (DestCharPointerType& dest, SrcCharPointerType src) noexcept { - for (;;) - { - const juce_wchar c = src.getAndAdvance(); - - if (c == 0) - break; - + while (juce_wchar c = src.getAndAdvance()) dest.write (c); - } dest.writeNull(); } diff --git a/source/modules/juce_core/text/juce_Identifier.cpp b/source/modules/juce_core/text/juce_Identifier.cpp index 04cfd13d1..13821b69c 100644 --- a/source/modules/juce_core/text/juce_Identifier.cpp +++ b/source/modules/juce_core/text/juce_Identifier.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_Identifier.h b/source/modules/juce_core/text/juce_Identifier.h index 0abc1ae4a..789144381 100644 --- a/source/modules/juce_core/text/juce_Identifier.h +++ b/source/modules/juce_core/text/juce_Identifier.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_LocalisedStrings.cpp b/source/modules/juce_core/text/juce_LocalisedStrings.cpp index e6118d31a..3671fe033 100644 --- a/source/modules/juce_core/text/juce_LocalisedStrings.cpp +++ b/source/modules/juce_core/text/juce_LocalisedStrings.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_LocalisedStrings.h b/source/modules/juce_core/text/juce_LocalisedStrings.h index a594919b8..8eb79989a 100644 --- a/source/modules/juce_core/text/juce_LocalisedStrings.h +++ b/source/modules/juce_core/text/juce_LocalisedStrings.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_NewLine.h b/source/modules/juce_core/text/juce_NewLine.h index 980ac23cf..0d310cddb 100644 --- a/source/modules/juce_core/text/juce_NewLine.h +++ b/source/modules/juce_core/text/juce_NewLine.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_String.cpp b/source/modules/juce_core/text/juce_String.cpp index f91adf509..cf9336d72 100644 --- a/source/modules/juce_core/text/juce_String.cpp +++ b/source/modules/juce_core/text/juce_String.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -86,12 +86,7 @@ public: if (text.getAddress() == nullptr || text.isEmpty()) return CharPointerType (&(emptyString.text)); - CharPointer t (text); - size_t bytesNeeded = sizeof (CharType); - - while (! t.isEmpty()) - bytesNeeded += CharPointerType::getBytesRequiredFor (t.getAndAdvance()); - + const size_t bytesNeeded = sizeof (CharType) + CharPointerType::getBytesRequiredFor (text); const CharPointerType dest (createUninitialisedBytes (bytesNeeded)); CharPointerType (dest).writeAll (text); return dest; @@ -2229,7 +2224,7 @@ public: return CharPointer_UTF32 (buffer); } - void runTest() + void runTest() override { Random r = getRandom(); diff --git a/source/modules/juce_core/text/juce_String.h b/source/modules/juce_core/text/juce_String.h index 70a39a874..5c2a89f1c 100644 --- a/source/modules/juce_core/text/juce_String.h +++ b/source/modules/juce_core/text/juce_String.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringArray.cpp b/source/modules/juce_core/text/juce_StringArray.cpp index 05311ff24..de6ac3e87 100644 --- a/source/modules/juce_core/text/juce_StringArray.cpp +++ b/source/modules/juce_core/text/juce_StringArray.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringArray.h b/source/modules/juce_core/text/juce_StringArray.h index c3a1a17b6..6136575a1 100644 --- a/source/modules/juce_core/text/juce_StringArray.h +++ b/source/modules/juce_core/text/juce_StringArray.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -355,10 +355,10 @@ public: @param appendNumberToFirstInstance whether the first of a group of similar strings also has a number appended to it. @param preNumberString when adding a number, this string is added before the number. - If you pass 0, a default string will be used, which adds + If you pass nullptr, a default string will be used, which adds brackets around the number. @param postNumberString this string is appended after any numbers that are added. - If you pass 0, a default string will be used, which adds + If you pass nullptr, a default string will be used, which adds brackets around the number. */ void appendNumbersToDuplicates (bool ignoreCaseWhenComparing, diff --git a/source/modules/juce_core/text/juce_StringPairArray.cpp b/source/modules/juce_core/text/juce_StringPairArray.cpp index 3275d2d4a..d6bf37f65 100644 --- a/source/modules/juce_core/text/juce_StringPairArray.cpp +++ b/source/modules/juce_core/text/juce_StringPairArray.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringPairArray.h b/source/modules/juce_core/text/juce_StringPairArray.h index e1c774d12..81367fd19 100644 --- a/source/modules/juce_core/text/juce_StringPairArray.h +++ b/source/modules/juce_core/text/juce_StringPairArray.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringPool.cpp b/source/modules/juce_core/text/juce_StringPool.cpp index 039a30bf9..e9d295c0e 100644 --- a/source/modules/juce_core/text/juce_StringPool.cpp +++ b/source/modules/juce_core/text/juce_StringPool.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringPool.h b/source/modules/juce_core/text/juce_StringPool.h index 64d034e2b..047af53b9 100644 --- a/source/modules/juce_core/text/juce_StringPool.h +++ b/source/modules/juce_core/text/juce_StringPool.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_StringRef.h b/source/modules/juce_core/text/juce_StringRef.h index 434bf4ae7..3c17600ab 100644 --- a/source/modules/juce_core/text/juce_StringRef.h +++ b/source/modules/juce_core/text/juce_StringRef.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/text/juce_TextDiff.cpp b/source/modules/juce_core/text/juce_TextDiff.cpp index 6b4c80794..4b07015b2 100644 --- a/source/modules/juce_core/text/juce_TextDiff.cpp +++ b/source/modules/juce_core/text/juce_TextDiff.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -28,16 +28,19 @@ struct TextDiffHelpers { - enum { minLengthToMatch = 3 }; + enum { minLengthToMatch = 3, + maxComplexity = 16 * 1024 * 1024 }; struct StringRegion { StringRegion (const String& s) noexcept : text (s.getCharPointer()), start (0), length (s.length()) {} - StringRegion (const String::CharPointerType t, int s, int len) noexcept + StringRegion (const String::CharPointerType t, int s, int len) noexcept : text (t), start (s), length (len) {} + void incrementStart() noexcept { ++text; ++start; --length; } + String::CharPointerType text; int start, length; }; @@ -47,7 +50,7 @@ struct TextDiffHelpers TextDiff::Change c; c.insertedText = String (text, (size_t) length); c.start = index; - c.length = length; + c.length = 0; td.changes.add (c); } @@ -59,29 +62,28 @@ struct TextDiffHelpers td.changes.add (c); } - static void diffSkippingCommonStart (TextDiff& td, const StringRegion& a, const StringRegion& b) + static void diffSkippingCommonStart (TextDiff& td, StringRegion a, StringRegion b) { - String::CharPointerType sa (a.text); - String::CharPointerType sb (b.text); - const int maxLen = jmax (a.length, b.length); - - for (int i = 0; i < maxLen; ++i, ++sa, ++sb) + for (;;) { - if (*sa != *sb) - { - diffRecursively (td, StringRegion (sa, a.start + i, a.length - i), - StringRegion (sb, b.start + i, b.length - i)); + const juce_wchar ca = *a.text; + const juce_wchar cb = *b.text; + + if (ca != cb || ca == 0) break; - } + + a.incrementStart(); + b.incrementStart(); } + + diffRecursively (td, a, b); } - static void diffRecursively (TextDiff& td, const StringRegion& a, const StringRegion& b) + static void diffRecursively (TextDiff& td, StringRegion a, StringRegion b) { - int indexA, indexB; - const int len = findLongestCommonSubstring (a.text, a.length, - b.text, b.length, - indexA, indexB); + int indexA = 0, indexB = 0; + const int len = findLongestCommonSubstring (a.text, a.length, indexA, + b.text, b.length, indexB); if (len >= minLengthToMatch) { @@ -93,8 +95,8 @@ struct TextDiffHelpers else if (indexB > 0) addInsertion (td, b.text, b.start, indexB); - diffRecursively (td, StringRegion (a.text + indexA + len, a.start + indexA + len, a.length - indexA - len), - StringRegion (b.text + indexB + len, b.start + indexB + len, b.length - indexB - len)); + diffRecursively (td, StringRegion (a.text + (indexA + len), a.start + indexA + len, a.length - indexA - len), + StringRegion (b.text + (indexB + len), b.start + indexB + len, b.length - indexB - len)); } else { @@ -103,22 +105,25 @@ struct TextDiffHelpers } } - static int findLongestCommonSubstring (String::CharPointerType a, const int lenA, - const String::CharPointerType b, const int lenB, - int& indexInA, int& indexInB) + static int findLongestCommonSubstring (String::CharPointerType a, const int lenA, int& indexInA, + String::CharPointerType b, const int lenB, int& indexInB) noexcept { if (lenA == 0 || lenB == 0) return 0; - HeapBlock lines; - lines.calloc (2 + 2 * (size_t) lenB); + if (lenA * lenB > maxComplexity) + return findCommonSuffix (a, lenA, indexInA, + b, lenB, indexInB); + + const size_t scratchSpace = sizeof (int) * (2 + 2 * (size_t) lenB); + int* const lines = (int*) alloca (scratchSpace); + zeromem (lines, scratchSpace); int* l0 = lines; int* l1 = l0 + lenB + 1; int loopsWithoutImprovement = 0; int bestLength = 0; - indexInA = indexInB = 0; for (int i = 0; i < lenA; ++i) { @@ -156,6 +161,25 @@ struct TextDiffHelpers indexInB -= bestLength - 1; return bestLength; } + + static int findCommonSuffix (String::CharPointerType a, const int lenA, int& indexInA, + String::CharPointerType b, const int lenB, int& indexInB) noexcept + { + int length = 0; + a += lenA - 1; + b += lenB - 1; + + while (length < lenA && length < lenB && *a == *b) + { + --a; + --b; + ++length; + } + + indexInA = lenA - length; + indexInB = lenB - length; + return length; + } }; TextDiff::TextDiff (const String& original, const String& target) @@ -178,8 +202,7 @@ bool TextDiff::Change::isDeletion() const noexcept String TextDiff::Change::appliedTo (const String& text) const noexcept { - return text.substring (0, start) + (isDeletion() ? text.substring (start + length) - : (insertedText + text.substring (start))); + return text.replaceSection (start, length, insertedText); } //============================================================================== @@ -193,9 +216,9 @@ public: static String createString (Random& r) { - juce_wchar buffer[50] = { 0 }; + juce_wchar buffer[500] = { 0 }; - for (int i = r.nextInt (49); --i >= 0;) + for (int i = r.nextInt (numElementsInArray (buffer) - 1); --i >= 0;) { if (r.nextInt (10) == 0) { @@ -219,7 +242,7 @@ public: expectEquals (result, b); } - void runTest() + void runTest() override { beginTest ("TextDiff"); @@ -233,7 +256,7 @@ public: testDiff ("xxx", "x"); testDiff ("x", "xxx"); - for (int i = 5000; --i >= 0;) + for (int i = 1000; --i >= 0;) { String s (createString (r)); testDiff (s, createString (r)); diff --git a/source/modules/juce_core/text/juce_TextDiff.h b/source/modules/juce_core/text/juce_TextDiff.h index d420c3d85..2d1c6cb4b 100644 --- a/source/modules/juce_core/text/juce_TextDiff.h +++ b/source/modules/juce_core/text/juce_TextDiff.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ChildProcess.cpp b/source/modules/juce_core/threads/juce_ChildProcess.cpp index e98483782..c868a3483 100644 --- a/source/modules/juce_core/threads/juce_ChildProcess.cpp +++ b/source/modules/juce_core/threads/juce_ChildProcess.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -94,7 +94,7 @@ class ChildProcessTests : public UnitTest public: ChildProcessTests() : UnitTest ("ChildProcess") {} - void runTest() + void runTest() override { beginTest ("Child Processes"); diff --git a/source/modules/juce_core/threads/juce_ChildProcess.h b/source/modules/juce_core/threads/juce_ChildProcess.h index 7a1c88c3e..fcf1837d6 100644 --- a/source/modules/juce_core/threads/juce_ChildProcess.h +++ b/source/modules/juce_core/threads/juce_ChildProcess.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_CriticalSection.h b/source/modules/juce_core/threads/juce_CriticalSection.h index 60e61dda5..d19e94519 100644 --- a/source/modules/juce_core/threads/juce_CriticalSection.h +++ b/source/modules/juce_core/threads/juce_CriticalSection.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_DynamicLibrary.h b/source/modules/juce_core/threads/juce_DynamicLibrary.h index df6625b54..ec2fcd134 100644 --- a/source/modules/juce_core/threads/juce_DynamicLibrary.h +++ b/source/modules/juce_core/threads/juce_DynamicLibrary.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_HighResolutionTimer.cpp b/source/modules/juce_core/threads/juce_HighResolutionTimer.cpp index 3475b74d1..791255ba9 100644 --- a/source/modules/juce_core/threads/juce_HighResolutionTimer.cpp +++ b/source/modules/juce_core/threads/juce_HighResolutionTimer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_HighResolutionTimer.h b/source/modules/juce_core/threads/juce_HighResolutionTimer.h index 21022adc6..7c840af68 100644 --- a/source/modules/juce_core/threads/juce_HighResolutionTimer.h +++ b/source/modules/juce_core/threads/juce_HighResolutionTimer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_InterProcessLock.h b/source/modules/juce_core/threads/juce_InterProcessLock.h index dc903b02b..447dc8841 100644 --- a/source/modules/juce_core/threads/juce_InterProcessLock.h +++ b/source/modules/juce_core/threads/juce_InterProcessLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_Process.h b/source/modules/juce_core/threads/juce_Process.h index f3efd6628..eb5d59df8 100644 --- a/source/modules/juce_core/threads/juce_Process.h +++ b/source/modules/juce_core/threads/juce_Process.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ReadWriteLock.cpp b/source/modules/juce_core/threads/juce_ReadWriteLock.cpp index a0821b440..e05c4277a 100644 --- a/source/modules/juce_core/threads/juce_ReadWriteLock.cpp +++ b/source/modules/juce_core/threads/juce_ReadWriteLock.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ReadWriteLock.h b/source/modules/juce_core/threads/juce_ReadWriteLock.h index c41d2580a..51937827d 100644 --- a/source/modules/juce_core/threads/juce_ReadWriteLock.h +++ b/source/modules/juce_core/threads/juce_ReadWriteLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ScopedLock.h b/source/modules/juce_core/threads/juce_ScopedLock.h index 442551add..f359d9ddc 100644 --- a/source/modules/juce_core/threads/juce_ScopedLock.h +++ b/source/modules/juce_core/threads/juce_ScopedLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ScopedReadLock.h b/source/modules/juce_core/threads/juce_ScopedReadLock.h index 107e838a5..37cf14cee 100644 --- a/source/modules/juce_core/threads/juce_ScopedReadLock.h +++ b/source/modules/juce_core/threads/juce_ScopedReadLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ScopedWriteLock.h b/source/modules/juce_core/threads/juce_ScopedWriteLock.h index 44e3198a5..04072df92 100644 --- a/source/modules/juce_core/threads/juce_ScopedWriteLock.h +++ b/source/modules/juce_core/threads/juce_ScopedWriteLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_SpinLock.h b/source/modules/juce_core/threads/juce_SpinLock.h index 664cc3c0a..0d42a26f4 100644 --- a/source/modules/juce_core/threads/juce_SpinLock.h +++ b/source/modules/juce_core/threads/juce_SpinLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_Thread.cpp b/source/modules/juce_core/threads/juce_Thread.cpp index 3d1ff0ab1..dce488dbc 100644 --- a/source/modules/juce_core/threads/juce_Thread.cpp +++ b/source/modules/juce_core/threads/juce_Thread.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -273,7 +273,7 @@ class AtomicTests : public UnitTest public: AtomicTests() : UnitTest ("Atomics") {} - void runTest() + void runTest() override { beginTest ("Misc"); diff --git a/source/modules/juce_core/threads/juce_Thread.h b/source/modules/juce_core/threads/juce_Thread.h index 74b699680..89a0c507a 100644 --- a/source/modules/juce_core/threads/juce_Thread.h +++ b/source/modules/juce_core/threads/juce_Thread.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ThreadLocalValue.h b/source/modules/juce_core/threads/juce_ThreadLocalValue.h index bd5c808f8..19107fdbe 100644 --- a/source/modules/juce_core/threads/juce_ThreadLocalValue.h +++ b/source/modules/juce_core/threads/juce_ThreadLocalValue.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ThreadPool.cpp b/source/modules/juce_core/threads/juce_ThreadPool.cpp index e6b0b9f9a..405161019 100644 --- a/source/modules/juce_core/threads/juce_ThreadPool.cpp +++ b/source/modules/juce_core/threads/juce_ThreadPool.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_ThreadPool.h b/source/modules/juce_core/threads/juce_ThreadPool.h index 3d5f7622b..3934215e5 100644 --- a/source/modules/juce_core/threads/juce_ThreadPool.h +++ b/source/modules/juce_core/threads/juce_ThreadPool.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_TimeSliceThread.cpp b/source/modules/juce_core/threads/juce_TimeSliceThread.cpp index f055a15e2..63d537c3b 100644 --- a/source/modules/juce_core/threads/juce_TimeSliceThread.cpp +++ b/source/modules/juce_core/threads/juce_TimeSliceThread.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_TimeSliceThread.h b/source/modules/juce_core/threads/juce_TimeSliceThread.h index 8c3056750..5db4b41ca 100644 --- a/source/modules/juce_core/threads/juce_TimeSliceThread.h +++ b/source/modules/juce_core/threads/juce_TimeSliceThread.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/threads/juce_WaitableEvent.h b/source/modules/juce_core/threads/juce_WaitableEvent.h index 83f6f0645..ce10b4639 100644 --- a/source/modules/juce_core/threads/juce_WaitableEvent.h +++ b/source/modules/juce_core/threads/juce_WaitableEvent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/time/juce_PerformanceCounter.cpp b/source/modules/juce_core/time/juce_PerformanceCounter.cpp index b22d5e484..12fac64f3 100644 --- a/source/modules/juce_core/time/juce_PerformanceCounter.cpp +++ b/source/modules/juce_core/time/juce_PerformanceCounter.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/time/juce_PerformanceCounter.h b/source/modules/juce_core/time/juce_PerformanceCounter.h index aac50d21c..5426636ac 100644 --- a/source/modules/juce_core/time/juce_PerformanceCounter.h +++ b/source/modules/juce_core/time/juce_PerformanceCounter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/time/juce_RelativeTime.cpp b/source/modules/juce_core/time/juce_RelativeTime.cpp index 6fca4fede..913cc6eb0 100644 --- a/source/modules/juce_core/time/juce_RelativeTime.cpp +++ b/source/modules/juce_core/time/juce_RelativeTime.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/time/juce_RelativeTime.h b/source/modules/juce_core/time/juce_RelativeTime.h index 7e39d2117..76d8df569 100644 --- a/source/modules/juce_core/time/juce_RelativeTime.h +++ b/source/modules/juce_core/time/juce_RelativeTime.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/time/juce_Time.cpp b/source/modules/juce_core/time/juce_Time.cpp index 7ba8e5f83..847b360af 100644 --- a/source/modules/juce_core/time/juce_Time.cpp +++ b/source/modules/juce_core/time/juce_Time.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -62,21 +62,18 @@ namespace TimeHelpers } else { - time_t now = static_cast (seconds); + time_t now = static_cast (seconds); - #if JUCE_WINDOWS - #ifdef _INC_TIME_INL + #if JUCE_WINDOWS && JUCE_MINGW + return *localtime (&now); + #elif JUCE_WINDOWS if (now >= 0 && now <= 0x793406fff) localtime_s (&result, &now); else zerostruct (result); #else - result = *localtime (&now); - #endif - #else - localtime_r (&now, &result); // more thread-safe - #endif + #endif } return result; @@ -195,19 +192,15 @@ Time& Time::operator= (const Time& other) noexcept //============================================================================== int64 Time::currentTimeMillis() noexcept { - #if JUCE_WINDOWS + #if JUCE_WINDOWS && ! JUCE_MINGW struct _timeb t; - #ifdef _INC_TIME_INL _ftime_s (&t); - #else - _ftime (&t); - #endif return ((int64) t.time) * 1000 + t.millitm; - #else + #else struct timeval tv; gettimeofday (&tv, nullptr); return ((int64) tv.tv_sec) * 1000 + tv.tv_usec / 1000; - #endif + #endif } Time JUCE_CALLTYPE Time::getCurrentTime() noexcept @@ -364,7 +357,6 @@ String Time::getTimeZone() const noexcept #if JUCE_MSVC _tzset(); - #ifdef _INC_TIME_INL for (int i = 0; i < 2; ++i) { char name[128] = { 0 }; @@ -372,11 +364,6 @@ String Time::getTimeZone() const noexcept _get_tzname (&length, name, 127, i); zone[i] = name; } - #else - const char** const zonePtr = (const char**) _tzname; - zone[0] = zonePtr[0]; - zone[1] = zonePtr[1]; - #endif #else #if JUCE_MINGW #warning "Can't find a replacement for tzset on mingw - ideas welcome!" diff --git a/source/modules/juce_core/time/juce_Time.h b/source/modules/juce_core/time/juce_Time.h index 4a35e0878..b51ed0779 100644 --- a/source/modules/juce_core/time/juce_Time.h +++ b/source/modules/juce_core/time/juce_Time.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/unit_tests/juce_UnitTest.cpp b/source/modules/juce_core/unit_tests/juce_UnitTest.cpp index f5a60c1a5..597314d68 100644 --- a/source/modules/juce_core/unit_tests/juce_UnitTest.cpp +++ b/source/modules/juce_core/unit_tests/juce_UnitTest.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -143,6 +143,9 @@ void UnitTestRunner::runTests (const Array& tests, int64 randomSeed) if (shouldAbortTests()) break; + #if JUCE_EXCEPTIONS_DISABLED + tests.getUnchecked(i)->performTest (this); + #else try { tests.getUnchecked(i)->performTest (this); @@ -151,6 +154,7 @@ void UnitTestRunner::runTests (const Array& tests, int64 randomSeed) { addFail ("An unhandled exception was thrown!"); } + #endif } endTest(); diff --git a/source/modules/juce_core/unit_tests/juce_UnitTest.h b/source/modules/juce_core/unit_tests/juce_UnitTest.h index f5908c17c..1c80b4edd 100644 --- a/source/modules/juce_core/unit_tests/juce_UnitTest.h +++ b/source/modules/juce_core/unit_tests/juce_UnitTest.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -44,7 +44,7 @@ class UnitTestRunner; public: MyTest() : UnitTest ("Foobar testing") {} - void runTest() + void runTest() override { beginTest ("Part 1"); diff --git a/source/modules/juce_core/xml/juce_XmlDocument.cpp b/source/modules/juce_core/xml/juce_XmlDocument.cpp index 655f885ef..de77013b3 100644 --- a/source/modules/juce_core/xml/juce_XmlDocument.cpp +++ b/source/modules/juce_core/xml/juce_XmlDocument.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/xml/juce_XmlDocument.h b/source/modules/juce_core/xml/juce_XmlDocument.h index c032b854d..84d087162 100644 --- a/source/modules/juce_core/xml/juce_XmlDocument.h +++ b/source/modules/juce_core/xml/juce_XmlDocument.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/xml/juce_XmlElement.cpp b/source/modules/juce_core/xml/juce_XmlElement.cpp index 866d10ab3..d0fd99d9a 100644 --- a/source/modules/juce_core/xml/juce_XmlElement.cpp +++ b/source/modules/juce_core/xml/juce_XmlElement.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/xml/juce_XmlElement.h b/source/modules/juce_core/xml/juce_XmlElement.h index f755fb16d..b4101652c 100644 --- a/source/modules/juce_core/xml/juce_XmlElement.h +++ b/source/modules/juce_core/xml/juce_XmlElement.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp b/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp index cb9a577eb..a808ab802 100644 --- a/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp +++ b/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this @@ -166,7 +166,7 @@ class GZIPTests : public UnitTest public: GZIPTests() : UnitTest ("GZIP") {} - void runTest() + void runTest() override { beginTest ("GZIP"); Random rng = getRandom(); diff --git a/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h b/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h index d45d5ae7d..5ce8c561a 100644 --- a/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h +++ b/source/modules/juce_core/zip/juce_GZIPCompressorOutputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp b/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp index e2f660850..88d49a334 100644 --- a/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp +++ b/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h b/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h index 614a87a56..cdd9fd270 100644 --- a/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h +++ b/source/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/zip/juce_ZipFile.cpp b/source/modules/juce_core/zip/juce_ZipFile.cpp index 0055e0f32..c7ae45d36 100644 --- a/source/modules/juce_core/zip/juce_ZipFile.cpp +++ b/source/modules/juce_core/zip/juce_ZipFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_core/zip/juce_ZipFile.h b/source/modules/juce_core/zip/juce_ZipFile.h index 926441a42..43f3c1017 100644 --- a/source/modules/juce_core/zip/juce_ZipFile.h +++ b/source/modules/juce_core/zip/juce_ZipFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the juce_core module of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp b/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp index 6db825e89..53ff45360 100644 --- a/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp +++ b/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h b/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h index 21edbc2af..a047de839 100644 --- a/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h +++ b/source/modules/juce_data_structures/app_properties/juce_ApplicationProperties.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp b/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp index ece2121f3..bd14b66d6 100644 --- a/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp +++ b/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.h b/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.h index a8198e699..c91d61c54 100644 --- a/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.h +++ b/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/juce_data_structures.cpp b/source/modules/juce_data_structures/juce_data_structures.cpp index e2e8e8189..0d2b8759c 100644 --- a/source/modules/juce_data_structures/juce_data_structures.cpp +++ b/source/modules/juce_data_structures/juce_data_structures.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/juce_data_structures.h b/source/modules/juce_data_structures/juce_data_structures.h index e80d1cea5..c130d57a9 100644 --- a/source/modules/juce_data_structures/juce_data_structures.h +++ b/source/modules/juce_data_structures/juce_data_structures.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/undomanager/juce_UndoManager.cpp b/source/modules/juce_data_structures/undomanager/juce_UndoManager.cpp index c1c174116..4dc27b870 100644 --- a/source/modules/juce_data_structures/undomanager/juce_UndoManager.cpp +++ b/source/modules/juce_data_structures/undomanager/juce_UndoManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/undomanager/juce_UndoManager.h b/source/modules/juce_data_structures/undomanager/juce_UndoManager.h index ad22272bf..1e740eea3 100644 --- a/source/modules/juce_data_structures/undomanager/juce_UndoManager.h +++ b/source/modules/juce_data_structures/undomanager/juce_UndoManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/undomanager/juce_UndoableAction.h b/source/modules/juce_data_structures/undomanager/juce_UndoableAction.h index 866d48825..ff22895be 100644 --- a/source/modules/juce_data_structures/undomanager/juce_UndoableAction.h +++ b/source/modules/juce_data_structures/undomanager/juce_UndoableAction.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/values/juce_Value.cpp b/source/modules/juce_data_structures/values/juce_Value.cpp index 9fd05f40b..1034381fb 100644 --- a/source/modules/juce_data_structures/values/juce_Value.cpp +++ b/source/modules/juce_data_structures/values/juce_Value.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/values/juce_Value.h b/source/modules/juce_data_structures/values/juce_Value.h index c25d35d05..632a3832d 100644 --- a/source/modules/juce_data_structures/values/juce_Value.h +++ b/source/modules/juce_data_structures/values/juce_Value.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/values/juce_ValueTree.cpp b/source/modules/juce_data_structures/values/juce_ValueTree.cpp index 1efcb0b09..8b6d2ac25 100644 --- a/source/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/source/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -396,7 +396,7 @@ public: } } - bool isEquivalentTo (const SharedObject& other) const + bool isEquivalentTo (const SharedObject& other) const noexcept { if (type != other.type || properties.size() != other.properties.size() @@ -465,7 +465,7 @@ public: { } - bool perform() + bool perform() override { jassert (! (isAddingNewProperty && target->hasProperty (name))); @@ -477,7 +477,7 @@ public: return true; } - bool undo() + bool undo() override { if (isAddingNewProperty) target->removeProperty (name, nullptr); @@ -487,12 +487,12 @@ public: return true; } - int getSizeInUnits() + int getSizeInUnits() override { return (int) sizeof (*this); //xxx should be more accurate } - UndoableAction* createCoalescedAction (UndoableAction* nextAction) + UndoableAction* createCoalescedAction (UndoableAction* nextAction) override { if (! (isAddingNewProperty || isDeletingProperty)) { @@ -528,7 +528,7 @@ public: jassert (child != nullptr); } - bool perform() + bool perform() override { if (isDeleting) target->removeChild (childIndex, nullptr); @@ -538,7 +538,7 @@ public: return true; } - bool undo() + bool undo() override { if (isDeleting) { @@ -555,7 +555,7 @@ public: return true; } - int getSizeInUnits() + int getSizeInUnits() override { return (int) sizeof (*this); //xxx should be more accurate } @@ -577,24 +577,24 @@ public: { } - bool perform() + bool perform() override { parent->moveChild (startIndex, endIndex, nullptr); return true; } - bool undo() + bool undo() override { parent->moveChild (endIndex, startIndex, nullptr); return true; } - int getSizeInUnits() + int getSizeInUnits() override { return (int) sizeof (*this); //xxx should be more accurate } - UndoableAction* createCoalescedAction (UndoableAction* nextAction) + UndoableAction* createCoalescedAction (UndoableAction* nextAction) override { if (MoveChildAction* next = dynamic_cast (nextAction)) if (next->parent == parent && next->startIndex == endIndex) @@ -634,11 +634,11 @@ ValueTree::ValueTree (const Identifier& type) : object (new ValueTree::SharedOb jassert (type.toString().isNotEmpty()); // All objects must be given a sensible type name! } -ValueTree::ValueTree (SharedObject* so) : object (so) +ValueTree::ValueTree (SharedObject* so) noexcept : object (so) { } -ValueTree::ValueTree (const ValueTree& other) : object (other.object) +ValueTree::ValueTree (const ValueTree& other) noexcept : object (other.object) { } @@ -702,23 +702,23 @@ ValueTree ValueTree::createCopy() const return ValueTree (createCopyIfNotNull (object.get())); } -bool ValueTree::hasType (const Identifier& typeName) const +bool ValueTree::hasType (const Identifier& typeName) const noexcept { return object != nullptr && object->type == typeName; } -Identifier ValueTree::getType() const +Identifier ValueTree::getType() const noexcept { return object != nullptr ? object->type : Identifier(); } -ValueTree ValueTree::getParent() const +ValueTree ValueTree::getParent() const noexcept { return ValueTree (object != nullptr ? object->parent : static_cast (nullptr)); } -ValueTree ValueTree::getSibling (const int delta) const +ValueTree ValueTree::getSibling (const int delta) const noexcept { if (object == nullptr || object->parent == nullptr) return invalid; @@ -727,12 +727,12 @@ ValueTree ValueTree::getSibling (const int delta) const return ValueTree (object->parent->children.getObjectPointer (index)); } -const var& ValueTree::operator[] (const Identifier& name) const +const var& ValueTree::operator[] (const Identifier& name) const noexcept { return object == nullptr ? var::null : object->properties[name]; } -const var& ValueTree::getProperty (const Identifier& name) const +const var& ValueTree::getProperty (const Identifier& name) const noexcept { return object == nullptr ? var::null : object->properties[name]; } @@ -754,7 +754,7 @@ ValueTree& ValueTree::setProperty (const Identifier& name, const var& newValue, return *this; } -bool ValueTree::hasProperty (const Identifier& name) const +bool ValueTree::hasProperty (const Identifier& name) const noexcept { return object != nullptr && object->hasProperty (name); } @@ -771,12 +771,12 @@ void ValueTree::removeAllProperties (UndoManager* const undoManager) object->removeAllProperties (undoManager); } -int ValueTree::getNumProperties() const +int ValueTree::getNumProperties() const noexcept { return object == nullptr ? 0 : object->properties.size(); } -Identifier ValueTree::getPropertyName (const int index) const +Identifier ValueTree::getPropertyName (const int index) const noexcept { return object == nullptr ? Identifier() : object->properties.getName (index); @@ -841,7 +841,7 @@ Value ValueTree::getPropertyAsValue (const Identifier& name, UndoManager* const } //============================================================================== -int ValueTree::getNumChildren() const +int ValueTree::getNumChildren() const noexcept { return object == nullptr ? 0 : object->children.size(); } @@ -867,12 +867,12 @@ ValueTree ValueTree::getChildWithProperty (const Identifier& propertyName, const return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree(); } -bool ValueTree::isAChildOf (const ValueTree& possibleParent) const +bool ValueTree::isAChildOf (const ValueTree& possibleParent) const noexcept { return object != nullptr && object->isAChildOf (possibleParent.object); } -int ValueTree::indexOf (const ValueTree& child) const +int ValueTree::indexOf (const ValueTree& child) const noexcept { return object != nullptr ? object->indexOf (child) : -1; } @@ -958,22 +958,26 @@ XmlElement* ValueTree::createXml() const ValueTree ValueTree::fromXml (const XmlElement& xml) { - // ValueTrees don't have any equivalent to XML text elements! - jassert (! xml.isTextElement()); + if (! xml.isTextElement()) + { + ValueTree v (xml.getTagName()); + v.object->properties.setFromXmlAttributes (xml); - ValueTree v (xml.getTagName()); - v.object->properties.setFromXmlAttributes (xml); + forEachXmlChildElement (xml, e) + v.addChild (fromXml (*e), -1, nullptr); - forEachXmlChildElement (xml, e) - v.addChild (fromXml (*e), -1, nullptr); + return v; + } - return v; + // ValueTrees don't have any equivalent to XML text elements! + jassertfalse; + return ValueTree(); } String ValueTree::toXmlString() const { const ScopedPointer xml (createXml()); - return xml != nullptr ? xml->createDocument ("") : String(); + return xml != nullptr ? xml->createDocument (StringRef()) : String(); } //============================================================================== @@ -1106,7 +1110,7 @@ public: return v; } - void runTest() + void runTest() override { beginTest ("ValueTree"); Random r = getRandom(); diff --git a/source/modules/juce_data_structures/values/juce_ValueTree.h b/source/modules/juce_data_structures/values/juce_ValueTree.h index 78d870f8c..92c9fd608 100644 --- a/source/modules/juce_data_structures/values/juce_ValueTree.h +++ b/source/modules/juce_data_structures/values/juce_ValueTree.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -56,6 +56,11 @@ assertions if you try to do anything dangerous, but there are still plenty of ways it could go wrong. + Note that although the children in a tree have a fixed order, the properties are not + guaranteed to be stored in any particular order, so don't expect that a property's index + will correspond to the order in which the property was added, or that it will remain + constant when other properties are added or removed. + Listeners can be added to a ValueTree to be told when properies change and when nodes are added or removed. @@ -82,7 +87,7 @@ public: explicit ValueTree (const Identifier& type); /** Creates a reference to another ValueTree. */ - ValueTree (const ValueTree&); + ValueTree (const ValueTree&) noexcept; /** Makes this object reference another node. */ ValueTree& operator= (const ValueTree&); @@ -119,7 +124,7 @@ public: It's hard to create an invalid node, but you might get one returned, e.g. by an out-of-range call to getChild(). */ - bool isValid() const { return object != nullptr; } + bool isValid() const noexcept { return object != nullptr; } /** Returns a deep copy of this tree and all its sub-nodes. */ ValueTree createCopy() const; @@ -129,12 +134,12 @@ public: The type is specified when the ValueTree is created. @see hasType */ - Identifier getType() const; + Identifier getType() const noexcept; /** Returns true if the node has this type. The comparison is case-sensitive. */ - bool hasType (const Identifier& typeName) const; + bool hasType (const Identifier& typeName) const noexcept; //============================================================================== /** Returns the value of a named property. @@ -142,7 +147,7 @@ public: You can also use operator[] to get a property. @see var, setProperty, hasProperty */ - const var& getProperty (const Identifier& name) const; + const var& getProperty (const Identifier& name) const noexcept; /** Returns the value of a named property, or a user-specified default if the property doesn't exist. If no such property has been set, this will return the value of defaultReturnValue. @@ -156,7 +161,7 @@ public: calling getProperty(). @see getProperty */ - const var& operator[] (const Identifier& name) const; + const var& operator[] (const Identifier& name) const noexcept; /** Changes a named property of the node. The name identifier must not be an empty string. @@ -168,7 +173,7 @@ public: ValueTree& setProperty (const Identifier& name, const var& newValue, UndoManager* undoManager); /** Returns true if the node contains a named property. */ - bool hasProperty (const Identifier& name) const; + bool hasProperty (const Identifier& name) const noexcept; /** Removes a property from the node. If the undoManager parameter is non-null, its UndoManager::perform() method will be used, @@ -185,12 +190,15 @@ public: /** Returns the total number of properties that the node contains. @see getProperty. */ - int getNumProperties() const; + int getNumProperties() const noexcept; /** Returns the identifier of the property with a given index. + Note that properties are not guaranteed to be stored in any particular order, so don't + expect that the index will correspond to the order in which the property was added, or + that it will remain constant when other properties are added or removed. @see getNumProperties */ - Identifier getPropertyName (int index) const; + Identifier getPropertyName (int index) const noexcept; /** Returns a Value object that can be used to control and respond to one of the tree's properties. @@ -210,7 +218,7 @@ public: /** Returns the number of child nodes belonging to this one. @see getChild */ - int getNumChildren() const; + int getNumChildren() const noexcept; /** Returns one of this node's child nodes. If the index is out of range, it'll return an invalid node. (See isValid() to find out @@ -293,18 +301,18 @@ public: /** Returns true if this node is anywhere below the specified parent node. This returns true if the node is a child-of-a-child, as well as a direct child. */ - bool isAChildOf (const ValueTree& possibleParent) const; + bool isAChildOf (const ValueTree& possibleParent) const noexcept; /** Returns the index of a child item in this parent. If the child isn't found, this returns -1. */ - int indexOf (const ValueTree& child) const; + int indexOf (const ValueTree& child) const noexcept; /** Returns the parent node that contains this one. If the node has no parent, this will return an invalid node. (See isValid() to find out whether a node is valid). */ - ValueTree getParent() const; + ValueTree getParent() const noexcept; /** Returns one of this node's siblings in its parent's child list. @@ -312,7 +320,7 @@ public: that follows this one, -1 would return the node before it, 0 will return this node itself, etc. If the requested position is beyond the range of available nodes, this will return ValueTree::invalid. */ - ValueTree getSibling (int delta) const; + ValueTree getSibling (int delta) const noexcept; //============================================================================== /** Creates an XmlElement that holds a complete image of this node and all its children. @@ -526,7 +534,7 @@ private: void createListOfChildren (OwnedArray&) const; void reorderChildren (const OwnedArray&, UndoManager*); - explicit ValueTree (SharedObject*); + explicit ValueTree (SharedObject*) noexcept; }; diff --git a/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp b/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp index 027620786..e0d2b21f4 100644 --- a/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp +++ b/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h b/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h index 8cb4fbef6..3773faf70 100644 --- a/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h +++ b/source/modules/juce_data_structures/values/juce_ValueTreeSynchroniser.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp b/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp index 33f232d5b..a1ff9757d 100644 --- a/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp +++ b/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h b/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h index 8052bed3c..5926eef65 100644 --- a/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h +++ b/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_ActionListener.h b/source/modules/juce_events/broadcasters/juce_ActionListener.h index 12257f93d..8f1d5cd63 100644 --- a/source/modules/juce_events/broadcasters/juce_ActionListener.h +++ b/source/modules/juce_events/broadcasters/juce_ActionListener.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp b/source/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp index 980eb4146..64acb79da 100644 --- a/source/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp +++ b/source/modules/juce_events/broadcasters/juce_AsyncUpdater.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_AsyncUpdater.h b/source/modules/juce_events/broadcasters/juce_AsyncUpdater.h index 79ab6e1ca..d0c343b05 100644 --- a/source/modules/juce_events/broadcasters/juce_AsyncUpdater.h +++ b/source/modules/juce_events/broadcasters/juce_AsyncUpdater.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp b/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp index bff1f1a2d..a17c67381 100644 --- a/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp +++ b/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -24,7 +24,7 @@ ChangeBroadcaster::ChangeBroadcaster() noexcept { - callback.owner = this; + broadcastCallback.owner = this; } ChangeBroadcaster::~ChangeBroadcaster() @@ -61,7 +61,7 @@ void ChangeBroadcaster::removeAllChangeListeners() void ChangeBroadcaster::sendChangeMessage() { if (changeListeners.size() > 0) - callback.triggerAsyncUpdate(); + broadcastCallback.triggerAsyncUpdate(); } void ChangeBroadcaster::sendSynchronousChangeMessage() @@ -69,13 +69,13 @@ void ChangeBroadcaster::sendSynchronousChangeMessage() // This can only be called by the event thread. jassert (MessageManager::getInstance()->isThisTheMessageThread()); - callback.cancelPendingUpdate(); + broadcastCallback.cancelPendingUpdate(); callListeners(); } void ChangeBroadcaster::dispatchPendingMessages() { - callback.handleUpdateNowIfNeeded(); + broadcastCallback.handleUpdateNowIfNeeded(); } void ChangeBroadcaster::callListeners() diff --git a/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h b/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h index 8d9aca9d0..a74070883 100644 --- a/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h +++ b/source/modules/juce_events/broadcasters/juce_ChangeBroadcaster.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -93,7 +93,7 @@ private: }; friend class ChangeBroadcasterCallback; - ChangeBroadcasterCallback callback; + ChangeBroadcasterCallback broadcastCallback; ListenerList changeListeners; void callListeners(); diff --git a/source/modules/juce_events/broadcasters/juce_ChangeListener.h b/source/modules/juce_events/broadcasters/juce_ChangeListener.h index 59e3025bb..3e619485a 100644 --- a/source/modules/juce_events/broadcasters/juce_ChangeListener.h +++ b/source/modules/juce_events/broadcasters/juce_ChangeListener.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/broadcasters/juce_ListenerList.h b/source/modules/juce_events/broadcasters/juce_ListenerList.h index 853e252db..c68858f26 100644 --- a/source/modules/juce_events/broadcasters/juce_ListenerList.h +++ b/source/modules/juce_events/broadcasters/juce_ListenerList.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp b/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp index 2c36c2c64..9ebdbb36a 100644 --- a/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp +++ b/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -142,7 +142,7 @@ bool ChildProcessMaster::sendMessageToSlave (const MemoryBlock& mb) return false; } -bool ChildProcessMaster::launchSlaveProcess (const File& executable, const String& commandLineUniqueID, int timeoutMs) +bool ChildProcessMaster::launchSlaveProcess (const File& executable, const String& commandLineUniqueID, int timeoutMs, int streamFlags) { connection = nullptr; jassert (childProcess.kill()); @@ -153,7 +153,7 @@ bool ChildProcessMaster::launchSlaveProcess (const File& executable, const Strin args.add (executable.getFullPathName()); args.add (getCommandLinePrefix (commandLineUniqueID) + pipeName); - if (childProcess.start (args)) + if (childProcess.start (args, streamFlags)) { connection = new Connection (*this, pipeName, timeoutMs <= 0 ? defaultTimeoutMs : timeoutMs); diff --git a/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.h b/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.h index 60e3b7105..75f67ca57 100644 --- a/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.h +++ b/source/modules/juce_events/interprocess/juce_ConnectedChildProcess.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -157,7 +157,8 @@ public: */ bool launchSlaveProcess (const File& executableToLaunch, const String& commandLineUniqueID, - int timeoutMs = 0); + int timeoutMs = 0, + int streamFlags = ChildProcess::wantStdOut | ChildProcess::wantStdErr); /** This will be called to deliver a message from the slave process. The call will probably be made on a background thread, so be careful with your thread-safety! diff --git a/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp b/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp index f008cd133..70ac59ca2 100644 --- a/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp +++ b/source/modules/juce_events/interprocess/juce_InterprocessConnection.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -91,13 +91,13 @@ bool InterprocessConnection::connectToPipe (const String& pipeName, const int ti return false; } -bool InterprocessConnection::createPipe (const String& pipeName, const int timeoutMs) +bool InterprocessConnection::createPipe (const String& pipeName, const int timeoutMs, bool mustNotExist) { disconnect(); ScopedPointer newPipe (new NamedPipe()); - if (newPipe->createNewPipe (pipeName)) + if (newPipe->createNewPipe (pipeName, mustNotExist)) { const ScopedLock sl (pipeAndSocketLock); pipeReceiveMessageTimeout = timeoutMs; diff --git a/source/modules/juce_events/interprocess/juce_InterprocessConnection.h b/source/modules/juce_events/interprocess/juce_InterprocessConnection.h index a88e8fdc5..280ad54a9 100644 --- a/source/modules/juce_events/interprocess/juce_InterprocessConnection.h +++ b/source/modules/juce_events/interprocess/juce_InterprocessConnection.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -108,13 +108,14 @@ public: This creates a pipe with the given name, so that other processes can use connectToPipe() to connect to the other end. - @param pipeName the name to use for the pipe - this should be unique to your app + @param pipeName the name to use for the pipe - this should be unique to your app @param pipeReceiveMessageTimeoutMs a timeout length to be used when reading or writing - to the pipe, or -1 for an infinite timeout. + to the pipe, or -1 for an infinite timeout + @param mustNotExist if set to true, the method will fail if the pipe already exists @returns true if the pipe was created, or false if it fails (e.g. if another process is - already using using the pipe). + already using using the pipe) */ - bool createPipe (const String& pipeName, int pipeReceiveMessageTimeoutMs); + bool createPipe (const String& pipeName, int pipeReceiveMessageTimeoutMs, bool mustNotExist = false); /** Disconnects and closes any currently-open sockets or pipes. */ void disconnect(); diff --git a/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp b/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp index e9b542649..b422a1cb6 100644 --- a/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp +++ b/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h b/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h index 8de7b8f28..2bf0a2221 100644 --- a/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h +++ b/source/modules/juce_events/interprocess/juce_InterprocessConnectionServer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/juce_events.cpp b/source/modules/juce_events/juce_events.cpp index 2110d0a5d..53069c472 100644 --- a/source/modules/juce_events/juce_events.cpp +++ b/source/modules/juce_events/juce_events.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/juce_events.h b/source/modules/juce_events/juce_events.h index 7af9c9c53..0ef1070b4 100644 --- a/source/modules/juce_events/juce_events.h +++ b/source/modules/juce_events/juce_events.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_ApplicationBase.cpp b/source/modules/juce_events/messages/juce_ApplicationBase.cpp index 8bbda9baf..66cd07f4b 100644 --- a/source/modules/juce_events/messages/juce_ApplicationBase.cpp +++ b/source/modules/juce_events/messages/juce_ApplicationBase.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_ApplicationBase.h b/source/modules/juce_events/messages/juce_ApplicationBase.h index 733501980..bde123bf8 100644 --- a/source/modules/juce_events/messages/juce_ApplicationBase.h +++ b/source/modules/juce_events/messages/juce_ApplicationBase.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_CallbackMessage.h b/source/modules/juce_events/messages/juce_CallbackMessage.h index 799defdfe..17ddbea9a 100644 --- a/source/modules/juce_events/messages/juce_CallbackMessage.h +++ b/source/modules/juce_events/messages/juce_CallbackMessage.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_DeletedAtShutdown.cpp b/source/modules/juce_events/messages/juce_DeletedAtShutdown.cpp index d3c6e9725..c3357af4e 100644 --- a/source/modules/juce_events/messages/juce_DeletedAtShutdown.cpp +++ b/source/modules/juce_events/messages/juce_DeletedAtShutdown.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_DeletedAtShutdown.h b/source/modules/juce_events/messages/juce_DeletedAtShutdown.h index ce1f10edd..b3215eb57 100644 --- a/source/modules/juce_events/messages/juce_DeletedAtShutdown.h +++ b/source/modules/juce_events/messages/juce_DeletedAtShutdown.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_Initialisation.h b/source/modules/juce_events/messages/juce_Initialisation.h index d3302dd74..d358d0d8b 100644 --- a/source/modules/juce_events/messages/juce_Initialisation.h +++ b/source/modules/juce_events/messages/juce_Initialisation.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_Message.h b/source/modules/juce_events/messages/juce_Message.h index 4ae55f6f1..dab10a4af 100644 --- a/source/modules/juce_events/messages/juce_Message.h +++ b/source/modules/juce_events/messages/juce_Message.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_MessageListener.cpp b/source/modules/juce_events/messages/juce_MessageListener.cpp index b398ffa3f..6bcd25e51 100644 --- a/source/modules/juce_events/messages/juce_MessageListener.cpp +++ b/source/modules/juce_events/messages/juce_MessageListener.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_MessageListener.h b/source/modules/juce_events/messages/juce_MessageListener.h index ddd51e23b..96edc1b6e 100644 --- a/source/modules/juce_events/messages/juce_MessageListener.h +++ b/source/modules/juce_events/messages/juce_MessageListener.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_MessageManager.cpp b/source/modules/juce_events/messages/juce_MessageManager.cpp index 8f4f92abe..b7a1d8192 100644 --- a/source/modules/juce_events/messages/juce_MessageManager.cpp +++ b/source/modules/juce_events/messages/juce_MessageManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_MessageManager.h b/source/modules/juce_events/messages/juce_MessageManager.h index 0901b29d3..23b8a6234 100644 --- a/source/modules/juce_events/messages/juce_MessageManager.h +++ b/source/modules/juce_events/messages/juce_MessageManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h b/source/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h index fe6287543..b98790514 100644 --- a/source/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h +++ b/source/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/messages/juce_NotificationType.h b/source/modules/juce_events/messages/juce_NotificationType.h index c3ecccc66..9fb0c3a7d 100644 --- a/source/modules/juce_events/messages/juce_NotificationType.h +++ b/source/modules/juce_events/messages/juce_NotificationType.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_ScopedXLock.h b/source/modules/juce_events/native/juce_ScopedXLock.h index d2136c728..12342074d 100644 --- a/source/modules/juce_events/native/juce_ScopedXLock.h +++ b/source/modules/juce_events/native/juce_ScopedXLock.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_android_Messaging.cpp b/source/modules/juce_events/native/juce_android_Messaging.cpp index 144a32646..73cc3a4ae 100644 --- a/source/modules/juce_events/native/juce_android_Messaging.cpp +++ b/source/modules/juce_events/native/juce_android_Messaging.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_ios_MessageManager.mm b/source/modules/juce_events/native/juce_ios_MessageManager.mm index 1c53b49bf..998cace30 100644 --- a/source/modules/juce_events/native/juce_ios_MessageManager.mm +++ b/source/modules/juce_events/native/juce_ios_MessageManager.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_linux_Messaging.cpp b/source/modules/juce_events/native/juce_linux_Messaging.cpp index 6e17abb59..a3e761138 100644 --- a/source/modules/juce_events/native/juce_linux_Messaging.cpp +++ b/source/modules/juce_events/native/juce_linux_Messaging.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_mac_MessageManager.mm b/source/modules/juce_events/native/juce_mac_MessageManager.mm index 928abfd4d..e1f6d87ab 100644 --- a/source/modules/juce_events/native/juce_mac_MessageManager.mm +++ b/source/modules/juce_events/native/juce_mac_MessageManager.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_osx_MessageQueue.h b/source/modules/juce_events/native/juce_osx_MessageQueue.h index 6ffbefe6b..4b3656407 100644 --- a/source/modules/juce_events/native/juce_osx_MessageQueue.h +++ b/source/modules/juce_events/native/juce_osx_MessageQueue.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/native/juce_win32_HiddenMessageWindow.h b/source/modules/juce_events/native/juce_win32_HiddenMessageWindow.h index e0df59ad0..80295f63b 100644 --- a/source/modules/juce_events/native/juce_win32_HiddenMessageWindow.h +++ b/source/modules/juce_events/native/juce_win32_HiddenMessageWindow.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -63,7 +63,7 @@ private: ATOM atom; HWND hwnd; - LPCTSTR getClassNameFromAtom() noexcept { return (LPCTSTR) MAKELONG (atom, 0); } + LPCTSTR getClassNameFromAtom() noexcept { return (LPCTSTR) (pointer_sized_uint) atom; } }; //============================================================================== diff --git a/source/modules/juce_events/native/juce_win32_Messaging.cpp b/source/modules/juce_events/native/juce_win32_Messaging.cpp index 24bc41a32..7c027529b 100644 --- a/source/modules/juce_events/native/juce_win32_Messaging.cpp +++ b/source/modules/juce_events/native/juce_win32_Messaging.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/timers/juce_MultiTimer.cpp b/source/modules/juce_events/timers/juce_MultiTimer.cpp index 4885e7b5f..7941cf349 100644 --- a/source/modules/juce_events/timers/juce_MultiTimer.cpp +++ b/source/modules/juce_events/timers/juce_MultiTimer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/timers/juce_MultiTimer.h b/source/modules/juce_events/timers/juce_MultiTimer.h index c7fe0e43e..d32a0dd0c 100644 --- a/source/modules/juce_events/timers/juce_MultiTimer.h +++ b/source/modules/juce_events/timers/juce_MultiTimer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/timers/juce_Timer.cpp b/source/modules/juce_events/timers/juce_Timer.cpp index 25037dfc8..284e1ce07 100644 --- a/source/modules/juce_events/timers/juce_Timer.cpp +++ b/source/modules/juce_events/timers/juce_Timer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_events/timers/juce_Timer.h b/source/modules/juce_events/timers/juce_Timer.h index 859cfc644..a6670e3fc 100644 --- a/source/modules/juce_events/timers/juce_Timer.h +++ b/source/modules/juce_events/timers/juce_Timer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_Colour.cpp b/source/modules/juce_graphics/colour/juce_Colour.cpp index efbffe14b..43d99e7cf 100644 --- a/source/modules/juce_graphics/colour/juce_Colour.cpp +++ b/source/modules/juce_graphics/colour/juce_Colour.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_Colour.h b/source/modules/juce_graphics/colour/juce_Colour.h index 3b074fab2..885eaa301 100644 --- a/source/modules/juce_graphics/colour/juce_Colour.h +++ b/source/modules/juce_graphics/colour/juce_Colour.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_ColourGradient.cpp b/source/modules/juce_graphics/colour/juce_ColourGradient.cpp index 8e10816c1..87ccb5692 100644 --- a/source/modules/juce_graphics/colour/juce_ColourGradient.cpp +++ b/source/modules/juce_graphics/colour/juce_ColourGradient.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_ColourGradient.h b/source/modules/juce_graphics/colour/juce_ColourGradient.h index 73e6631ce..9349d82b3 100644 --- a/source/modules/juce_graphics/colour/juce_ColourGradient.h +++ b/source/modules/juce_graphics/colour/juce_ColourGradient.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_Colours.cpp b/source/modules/juce_graphics/colour/juce_Colours.cpp index fbde0ba6e..f79d52852 100644 --- a/source/modules/juce_graphics/colour/juce_Colours.cpp +++ b/source/modules/juce_graphics/colour/juce_Colours.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_Colours.h b/source/modules/juce_graphics/colour/juce_Colours.h index 90e4aa555..86f382879 100644 --- a/source/modules/juce_graphics/colour/juce_Colours.h +++ b/source/modules/juce_graphics/colour/juce_Colours.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_FillType.cpp b/source/modules/juce_graphics/colour/juce_FillType.cpp index 5e5db5632..c477f71d9 100644 --- a/source/modules/juce_graphics/colour/juce_FillType.cpp +++ b/source/modules/juce_graphics/colour/juce_FillType.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_FillType.h b/source/modules/juce_graphics/colour/juce_FillType.h index 19401d66a..3cf037d14 100644 --- a/source/modules/juce_graphics/colour/juce_FillType.h +++ b/source/modules/juce_graphics/colour/juce_FillType.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/colour/juce_PixelFormats.h b/source/modules/juce_graphics/colour/juce_PixelFormats.h index beb9c6011..0df5987b1 100644 --- a/source/modules/juce_graphics/colour/juce_PixelFormats.h +++ b/source/modules/juce_graphics/colour/juce_PixelFormats.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_GraphicsContext.cpp b/source/modules/juce_graphics/contexts/juce_GraphicsContext.cpp index 836fd6ee3..c6747f786 100644 --- a/source/modules/juce_graphics/contexts/juce_GraphicsContext.cpp +++ b/source/modules/juce_graphics/contexts/juce_GraphicsContext.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_GraphicsContext.h b/source/modules/juce_graphics/contexts/juce_GraphicsContext.h index ff9446626..bf5458135 100644 --- a/source/modules/juce_graphics/contexts/juce_GraphicsContext.h +++ b/source/modules/juce_graphics/contexts/juce_GraphicsContext.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h index 8a0176f8a..30a305e38 100644 --- a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h +++ b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsContext.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp index c159b4a06..d2d6a1ea4 100644 --- a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp +++ b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -51,7 +51,7 @@ LowLevelGraphicsPostScriptRenderer::LowLevelGraphicsPostScriptRenderer (OutputSt out << "%!PS-Adobe-3.0 EPSF-3.0" "\n%%BoundingBox: 0 0 600 824" "\n%%Pages: 0" - "\n%%Creator: Raw Material Software JUCE" + "\n%%Creator: ROLI Ltd. JUCE" "\n%%Title: " << documentTitle << "\n%%CreationDate: none" "\n%%LanguageLevel: 2" diff --git a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h index 2b893a360..94364f6ba 100644 --- a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h +++ b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsPostScriptRenderer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp index a57e4d62d..535f74e78 100644 --- a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp +++ b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h index 9928092ca..14f14a628 100644 --- a/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h +++ b/source/modules/juce_graphics/contexts/juce_LowLevelGraphicsSoftwareRenderer.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/effects/juce_DropShadowEffect.cpp b/source/modules/juce_graphics/effects/juce_DropShadowEffect.cpp index 603d034fb..2a2eaa0c4 100644 --- a/source/modules/juce_graphics/effects/juce_DropShadowEffect.cpp +++ b/source/modules/juce_graphics/effects/juce_DropShadowEffect.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/effects/juce_DropShadowEffect.h b/source/modules/juce_graphics/effects/juce_DropShadowEffect.h index 1f9362a0b..f8b0d8c68 100644 --- a/source/modules/juce_graphics/effects/juce_DropShadowEffect.h +++ b/source/modules/juce_graphics/effects/juce_DropShadowEffect.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/effects/juce_GlowEffect.cpp b/source/modules/juce_graphics/effects/juce_GlowEffect.cpp index 7db7ef5f8..83a8d7578 100644 --- a/source/modules/juce_graphics/effects/juce_GlowEffect.cpp +++ b/source/modules/juce_graphics/effects/juce_GlowEffect.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/effects/juce_GlowEffect.h b/source/modules/juce_graphics/effects/juce_GlowEffect.h index ab9ce3b02..df2fa3edf 100644 --- a/source/modules/juce_graphics/effects/juce_GlowEffect.h +++ b/source/modules/juce_graphics/effects/juce_GlowEffect.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/effects/juce_ImageEffectFilter.h b/source/modules/juce_graphics/effects/juce_ImageEffectFilter.h index 84d6b0b93..84a5aaa03 100644 --- a/source/modules/juce_graphics/effects/juce_ImageEffectFilter.h +++ b/source/modules/juce_graphics/effects/juce_ImageEffectFilter.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_AttributedString.cpp b/source/modules/juce_graphics/fonts/juce_AttributedString.cpp index 43b6318f1..a5c5849ba 100644 --- a/source/modules/juce_graphics/fonts/juce_AttributedString.cpp +++ b/source/modules/juce_graphics/fonts/juce_AttributedString.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_AttributedString.h b/source/modules/juce_graphics/fonts/juce_AttributedString.h index 8c33d75d3..6f46e1f18 100644 --- a/source/modules/juce_graphics/fonts/juce_AttributedString.h +++ b/source/modules/juce_graphics/fonts/juce_AttributedString.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_CustomTypeface.cpp b/source/modules/juce_graphics/fonts/juce_CustomTypeface.cpp index a2adb0429..bb869b01e 100644 --- a/source/modules/juce_graphics/fonts/juce_CustomTypeface.cpp +++ b/source/modules/juce_graphics/fonts/juce_CustomTypeface.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_CustomTypeface.h b/source/modules/juce_graphics/fonts/juce_CustomTypeface.h index 25db68b72..1d7183453 100644 --- a/source/modules/juce_graphics/fonts/juce_CustomTypeface.h +++ b/source/modules/juce_graphics/fonts/juce_CustomTypeface.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_Font.cpp b/source/modules/juce_graphics/fonts/juce_Font.cpp index d1c3d5c56..f47e182cd 100644 --- a/source/modules/juce_graphics/fonts/juce_Font.cpp +++ b/source/modules/juce_graphics/fonts/juce_Font.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -631,7 +631,7 @@ float Font::getDescentInPoints() const { return getDescent() * getHeightToP int Font::getStringWidth (const String& text) const { - return roundToInt (getStringWidthFloat (text)); + return (int) std::ceil (getStringWidthFloat (text)); } float Font::getStringWidthFloat (const String& text) const diff --git a/source/modules/juce_graphics/fonts/juce_Font.h b/source/modules/juce_graphics/fonts/juce_Font.h index 429e35e43..3fc11bbde 100644 --- a/source/modules/juce_graphics/fonts/juce_Font.h +++ b/source/modules/juce_graphics/fonts/juce_Font.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/source/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index 895166859..c62ef39c8 100644 --- a/source/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/source/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -654,12 +654,13 @@ void GlyphArrangement::splitLines (const String& text, Font font, int startIndex float lineY = y; float widthPerLine = lineWidth / numLines; - for (int line = 0; line < numLines; ++line) + while (lineY < y + height) { int i = startIndex; - float lineStartX = glyphs.getReference (startIndex).getLeft(); + const float lineStartX = glyphs.getReference (startIndex).getLeft(); + const float lineBottomY = lineY + font.getHeight(); - if (line == numLines - 1) + if (lineBottomY >= y + height) { widthPerLine = width; i = glyphs.size(); @@ -732,7 +733,7 @@ void GlyphArrangement::splitLines (const String& text, Font font, int startIndex minimumHorizontalScale); startIndex = i; - lineY += font.getHeight(); + lineY = lineBottomY; if (startIndex >= glyphs.size()) break; diff --git a/source/modules/juce_graphics/fonts/juce_GlyphArrangement.h b/source/modules/juce_graphics/fonts/juce_GlyphArrangement.h index 1749728cd..6f4243dcc 100644 --- a/source/modules/juce_graphics/fonts/juce_GlyphArrangement.h +++ b/source/modules/juce_graphics/fonts/juce_GlyphArrangement.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_TextLayout.cpp b/source/modules/juce_graphics/fonts/juce_TextLayout.cpp index f5073680c..322b8e6e0 100644 --- a/source/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/source/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_TextLayout.h b/source/modules/juce_graphics/fonts/juce_TextLayout.h index 0ae8237d9..0aaa073c3 100644 --- a/source/modules/juce_graphics/fonts/juce_TextLayout.h +++ b/source/modules/juce_graphics/fonts/juce_TextLayout.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_Typeface.cpp b/source/modules/juce_graphics/fonts/juce_Typeface.cpp index 4eda6b034..2077cd72c 100644 --- a/source/modules/juce_graphics/fonts/juce_Typeface.cpp +++ b/source/modules/juce_graphics/fonts/juce_Typeface.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/fonts/juce_Typeface.h b/source/modules/juce_graphics/fonts/juce_Typeface.h index a392fb705..064630554 100644 --- a/source/modules/juce_graphics/fonts/juce_Typeface.h +++ b/source/modules/juce_graphics/fonts/juce_Typeface.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_AffineTransform.cpp b/source/modules/juce_graphics/geometry/juce_AffineTransform.cpp index 85d6f4e8e..3f17bb920 100644 --- a/source/modules/juce_graphics/geometry/juce_AffineTransform.cpp +++ b/source/modules/juce_graphics/geometry/juce_AffineTransform.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_AffineTransform.h b/source/modules/juce_graphics/geometry/juce_AffineTransform.h index f30fdb81f..f9773f392 100644 --- a/source/modules/juce_graphics/geometry/juce_AffineTransform.h +++ b/source/modules/juce_graphics/geometry/juce_AffineTransform.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -275,11 +275,6 @@ public: */ float mat00, mat01, mat02; float mat10, mat11, mat12; - - -private: - //============================================================================== - JUCE_LEAK_DETECTOR (AffineTransform) }; #endif // JUCE_AFFINETRANSFORM_H_INCLUDED diff --git a/source/modules/juce_graphics/geometry/juce_BorderSize.h b/source/modules/juce_graphics/geometry/juce_BorderSize.h index b6a6686a7..1d2436f4c 100644 --- a/source/modules/juce_graphics/geometry/juce_BorderSize.h +++ b/source/modules/juce_graphics/geometry/juce_BorderSize.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_EdgeTable.cpp b/source/modules/juce_graphics/geometry/juce_EdgeTable.cpp index 73ee1c3c2..edefa73c6 100644 --- a/source/modules/juce_graphics/geometry/juce_EdgeTable.cpp +++ b/source/modules/juce_graphics/geometry/juce_EdgeTable.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_EdgeTable.h b/source/modules/juce_graphics/geometry/juce_EdgeTable.h index d8b6d66ae..9f3d5eb63 100644 --- a/source/modules/juce_graphics/geometry/juce_EdgeTable.h +++ b/source/modules/juce_graphics/geometry/juce_EdgeTable.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_Line.h b/source/modules/juce_graphics/geometry/juce_Line.h index b13ad0d18..02f91699b 100644 --- a/source/modules/juce_graphics/geometry/juce_Line.h +++ b/source/modules/juce_graphics/geometry/juce_Line.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_Path.cpp b/source/modules/juce_graphics/geometry/juce_Path.cpp index 0f204e68d..48c78aaf5 100644 --- a/source/modules/juce_graphics/geometry/juce_Path.cpp +++ b/source/modules/juce_graphics/geometry/juce_Path.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_Path.h b/source/modules/juce_graphics/geometry/juce_Path.h index d2aeacae9..50d2e0f0c 100644 --- a/source/modules/juce_graphics/geometry/juce_Path.h +++ b/source/modules/juce_graphics/geometry/juce_Path.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_PathIterator.cpp b/source/modules/juce_graphics/geometry/juce_PathIterator.cpp index 0a15581ce..ce3c46310 100644 --- a/source/modules/juce_graphics/geometry/juce_PathIterator.cpp +++ b/source/modules/juce_graphics/geometry/juce_PathIterator.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_PathIterator.h b/source/modules/juce_graphics/geometry/juce_PathIterator.h index dcb8b9031..0c1e5a163 100644 --- a/source/modules/juce_graphics/geometry/juce_PathIterator.h +++ b/source/modules/juce_graphics/geometry/juce_PathIterator.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_PathStrokeType.cpp b/source/modules/juce_graphics/geometry/juce_PathStrokeType.cpp index bdac333d3..a762aab4d 100644 --- a/source/modules/juce_graphics/geometry/juce_PathStrokeType.cpp +++ b/source/modules/juce_graphics/geometry/juce_PathStrokeType.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_PathStrokeType.h b/source/modules/juce_graphics/geometry/juce_PathStrokeType.h index 63747419c..b390838fc 100644 --- a/source/modules/juce_graphics/geometry/juce_PathStrokeType.h +++ b/source/modules/juce_graphics/geometry/juce_PathStrokeType.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_Point.h b/source/modules/juce_graphics/geometry/juce_Point.h index c62f7c4dd..33dc1c774 100644 --- a/source/modules/juce_graphics/geometry/juce_Point.h +++ b/source/modules/juce_graphics/geometry/juce_Point.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_Rectangle.h b/source/modules/juce_graphics/geometry/juce_Rectangle.h index 072641449..ac9df0eb3 100644 --- a/source/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/source/modules/juce_graphics/geometry/juce_Rectangle.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/geometry/juce_RectangleList.h b/source/modules/juce_graphics/geometry/juce_RectangleList.h index 254124283..8863a0e20 100644 --- a/source/modules/juce_graphics/geometry/juce_RectangleList.h +++ b/source/modules/juce_graphics/geometry/juce_RectangleList.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/image_formats/jpglib/jinclude.h b/source/modules/juce_graphics/image_formats/jpglib/jinclude.h index ab660087d..bccfd5442 100644 --- a/source/modules/juce_graphics/image_formats/jpglib/jinclude.h +++ b/source/modules/juce_graphics/image_formats/jpglib/jinclude.h @@ -180,11 +180,16 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */ { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; +#define SHIFTED_BITS_PLUS_ONE(n) (int) (((unsigned int) -1) << n) + 1 + static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; + { 0, + SHIFTED_BITS_PLUS_ONE (1), SHIFTED_BITS_PLUS_ONE (2), SHIFTED_BITS_PLUS_ONE (3), SHIFTED_BITS_PLUS_ONE (4), + SHIFTED_BITS_PLUS_ONE (5), SHIFTED_BITS_PLUS_ONE (6), SHIFTED_BITS_PLUS_ONE (7), SHIFTED_BITS_PLUS_ONE (8), + SHIFTED_BITS_PLUS_ONE (9), SHIFTED_BITS_PLUS_ONE (10), SHIFTED_BITS_PLUS_ONE (11), SHIFTED_BITS_PLUS_ONE (12), + SHIFTED_BITS_PLUS_ONE (13), SHIFTED_BITS_PLUS_ONE (14), SHIFTED_BITS_PLUS_ONE (15) }; + +#undef SHIFTED_BITS_PLUS_ONE #endif /* AVOID_TABLES */ diff --git a/source/modules/juce_graphics/image_formats/juce_GIFLoader.cpp b/source/modules/juce_graphics/image_formats/juce_GIFLoader.cpp index 2c9066f5b..ff5cd8ff2 100644 --- a/source/modules/juce_graphics/image_formats/juce_GIFLoader.cpp +++ b/source/modules/juce_graphics/image_formats/juce_GIFLoader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp b/source/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp index 0f56e32c8..a5a09a590 100644 --- a/source/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp +++ b/source/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -139,9 +139,7 @@ namespace JPEGHelpers using jpeglibNamespace::boolean; #endif - struct JPEGDecodingFailure {}; - - static void fatalErrorHandler (j_common_ptr) { throw JPEGDecodingFailure(); } + static void fatalErrorHandler (j_common_ptr p) { *((bool*) (p->client_data)) = true; } static void silentErrorCallback1 (j_common_ptr) {} static void silentErrorCallback2 (j_common_ptr, int) {} static void silentErrorCallback3 (j_common_ptr, char*) {} @@ -264,6 +262,9 @@ Image JPEGImageFormat::decodeImage (InputStream& in) jpegDecompStruct.src = (jpeg_source_mgr*)(jpegDecompStruct.mem->alloc_small) ((j_common_ptr)(&jpegDecompStruct), JPOOL_PERMANENT, sizeof (jpeg_source_mgr)); + bool hasFailed = false; + jpegDecompStruct.client_data = &hasFailed; + jpegDecompStruct.src->init_source = dummyCallback1; jpegDecompStruct.src->fill_input_buffer = jpegFill; jpegDecompStruct.src->skip_input_data = jpegSkip; @@ -273,67 +274,72 @@ Image JPEGImageFormat::decodeImage (InputStream& in) jpegDecompStruct.src->next_input_byte = static_cast (mb.getData()); jpegDecompStruct.src->bytes_in_buffer = mb.getDataSize(); - try - { - jpeg_read_header (&jpegDecompStruct, TRUE); + jpeg_read_header (&jpegDecompStruct, TRUE); + if (! hasFailed) + { jpeg_calc_output_dimensions (&jpegDecompStruct); - const int width = (int) jpegDecompStruct.output_width; - const int height = (int) jpegDecompStruct.output_height; - - jpegDecompStruct.out_color_space = JCS_RGB; - - JSAMPARRAY buffer - = (*jpegDecompStruct.mem->alloc_sarray) ((j_common_ptr) &jpegDecompStruct, - JPOOL_IMAGE, - (JDIMENSION) width * 3, 1); - - if (jpeg_start_decompress (&jpegDecompStruct)) + if (! hasFailed) { - image = Image (Image::RGB, width, height, false); - image.getProperties()->set ("originalImageHadAlpha", false); - const bool hasAlphaChan = image.hasAlphaChannel(); // (the native image creator may not give back what we expect) + const int width = (int) jpegDecompStruct.output_width; + const int height = (int) jpegDecompStruct.output_height; - const Image::BitmapData destData (image, Image::BitmapData::writeOnly); + jpegDecompStruct.out_color_space = JCS_RGB; - for (int y = 0; y < height; ++y) + JSAMPARRAY buffer + = (*jpegDecompStruct.mem->alloc_sarray) ((j_common_ptr) &jpegDecompStruct, + JPOOL_IMAGE, + (JDIMENSION) width * 3, 1); + + if (jpeg_start_decompress (&jpegDecompStruct) && ! hasFailed) { - jpeg_read_scanlines (&jpegDecompStruct, buffer, 1); + image = Image (Image::RGB, width, height, false); + image.getProperties()->set ("originalImageHadAlpha", false); + const bool hasAlphaChan = image.hasAlphaChannel(); // (the native image creator may not give back what we expect) - const uint8* src = *buffer; - uint8* dest = destData.getLinePointer (y); + const Image::BitmapData destData (image, Image::BitmapData::writeOnly); - if (hasAlphaChan) + for (int y = 0; y < height; ++y) { - for (int i = width; --i >= 0;) + jpeg_read_scanlines (&jpegDecompStruct, buffer, 1); + + if (hasFailed) + break; + + const uint8* src = *buffer; + uint8* dest = destData.getLinePointer (y); + + if (hasAlphaChan) { - ((PixelARGB*) dest)->setARGB (0xff, src[0], src[1], src[2]); - ((PixelARGB*) dest)->premultiply(); - dest += destData.pixelStride; - src += 3; + for (int i = width; --i >= 0;) + { + ((PixelARGB*) dest)->setARGB (0xff, src[0], src[1], src[2]); + ((PixelARGB*) dest)->premultiply(); + dest += destData.pixelStride; + src += 3; + } } - } - else - { - for (int i = width; --i >= 0;) + else { - ((PixelRGB*) dest)->setARGB (0xff, src[0], src[1], src[2]); - dest += destData.pixelStride; - src += 3; + for (int i = width; --i >= 0;) + { + ((PixelRGB*) dest)->setARGB (0xff, src[0], src[1], src[2]); + dest += destData.pixelStride; + src += 3; + } } } - } - jpeg_finish_decompress (&jpegDecompStruct); + if (! hasFailed) + jpeg_finish_decompress (&jpegDecompStruct); - in.setPosition (((char*) jpegDecompStruct.src->next_input_byte) - (char*) mb.getData()); + in.setPosition (((char*) jpegDecompStruct.src->next_input_byte) - (char*) mb.getData()); + } } - - jpeg_destroy_decompress (&jpegDecompStruct); } - catch (...) - {} + + jpeg_destroy_decompress (&jpegDecompStruct); } return image; diff --git a/source/modules/juce_graphics/image_formats/juce_PNGLoader.cpp b/source/modules/juce_graphics/image_formats/juce_PNGLoader.cpp index 636b29386..393bef47a 100644 --- a/source/modules/juce_graphics/image_formats/juce_PNGLoader.cpp +++ b/source/modules/juce_graphics/image_formats/juce_PNGLoader.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -42,6 +42,10 @@ namespace zlibNamespace #endif } +#if ! defined (jmp_buf) || ! defined (longjmp) + #include +#endif + namespace pnglibNamespace { using namespace zlibNamespace; @@ -313,64 +317,25 @@ namespace PNGHelpers struct PNGErrorStruct {}; - static void JUCE_CDECL errorCallback (png_structp, png_const_charp) + static void JUCE_CDECL errorCallback (png_structp p, png_const_charp) { - throw PNGErrorStruct(); + longjmp (*(jmp_buf*) p->error_ptr, 1); } static void JUCE_CDECL warningCallback (png_structp, png_const_charp) {} - #endif -} - -//============================================================================== -PNGImageFormat::PNGImageFormat() {} -PNGImageFormat::~PNGImageFormat() {} - -String PNGImageFormat::getFormatName() { return "PNG"; } -bool PNGImageFormat::usesFileExtension (const File& f) { return f.hasFileExtension ("png"); } - -bool PNGImageFormat::canUnderstand (InputStream& in) -{ - const int bytesNeeded = 4; - char header [bytesNeeded]; - - return in.read (header, bytesNeeded) == bytesNeeded - && header[1] == 'P' - && header[2] == 'N' - && header[3] == 'G'; -} -#if JUCE_USING_COREIMAGE_LOADER - Image juce_loadWithCoreImage (InputStream& input); -#endif - -Image PNGImageFormat::decodeImage (InputStream& in) -{ -#if JUCE_USING_COREIMAGE_LOADER - return juce_loadWithCoreImage (in); -#else - using namespace pnglibNamespace; - Image image; + #if JUCE_MSVC + #pragma warning (push) + #pragma warning (disable: 4611) // (warning about setjmp) + #endif - if (png_structp pngReadStruct = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0)) + static bool readHeader (InputStream& in, png_structp pngReadStruct, png_infop pngInfoStruct, jmp_buf& errorJumpBuf, + png_uint_32& width, png_uint_32& height, int& bitDepth, int& colorType, int& interlaceType) noexcept { - try + if (setjmp (errorJumpBuf) == 0) { - png_infop pngInfoStruct = png_create_info_struct (pngReadStruct); - - if (pngInfoStruct == nullptr) - { - png_destroy_read_struct (&pngReadStruct, 0, 0); - return Image::null; - } - - png_set_error_fn (pngReadStruct, 0, PNGHelpers::errorCallback, PNGHelpers::warningCallback); - // read the header.. - png_set_read_fn (pngReadStruct, &in, PNGHelpers::readCallback); - - png_uint_32 width = 0, height = 0; - int bitDepth = 0, colorType = 0, interlaceType; + png_set_read_fn (pngReadStruct, &in, readCallback); png_read_info (pngReadStruct, pngInfoStruct); @@ -388,76 +353,150 @@ Image PNGImageFormat::decodeImage (InputStream& in) if (bitDepth < 8) png_set_expand (pngReadStruct); - if (png_get_valid (pngReadStruct, pngInfoStruct, PNG_INFO_tRNS)) - png_set_expand (pngReadStruct); - if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb (pngReadStruct); - png_set_add_alpha (pngReadStruct, 0xff, PNG_FILLER_AFTER); + return true; + } - bool hasAlphaChan = (colorType & PNG_COLOR_MASK_ALPHA) != 0 - || pngInfoStruct->num_trans > 0; + return false; + } - // Load the image into a temp buffer in the pnglib format.. - const size_t lineStride = width * 4; - HeapBlock tempBuffer (height * lineStride); + static bool readImageData (png_structp pngReadStruct, png_infop pngInfoStruct, jmp_buf& errorJumpBuf, png_bytepp rows) noexcept + { + if (setjmp (errorJumpBuf) == 0) + { + if (png_get_valid (pngReadStruct, pngInfoStruct, PNG_INFO_tRNS)) + png_set_expand (pngReadStruct); - HeapBlock rows (height); - for (size_t y = 0; y < height; ++y) - rows[y] = (png_bytep) (tempBuffer + lineStride * y); + png_set_add_alpha (pngReadStruct, 0xff, PNG_FILLER_AFTER); - try - { - png_read_image (pngReadStruct, rows); - png_read_end (pngReadStruct, pngInfoStruct); - } - catch (PNGHelpers::PNGErrorStruct&) - {} + png_read_image (pngReadStruct, rows); + png_read_end (pngReadStruct, pngInfoStruct); + return true; + } - png_destroy_read_struct (&pngReadStruct, &pngInfoStruct, 0); + return false; + } - // now convert the data to a juce image format.. - image = Image (hasAlphaChan ? Image::ARGB : Image::RGB, - (int) width, (int) height, hasAlphaChan); + #if JUCE_MSVC + #pragma warning (pop) + #endif + + static Image createImageFromData (bool hasAlphaChan, int width, int height, png_bytepp rows) + { + // now convert the data to a juce image format.. + Image image (hasAlphaChan ? Image::ARGB : Image::RGB, width, height, hasAlphaChan); - image.getProperties()->set ("originalImageHadAlpha", image.hasAlphaChannel()); - hasAlphaChan = image.hasAlphaChannel(); // (the native image creator may not give back what we expect) + image.getProperties()->set ("originalImageHadAlpha", image.hasAlphaChannel()); + hasAlphaChan = image.hasAlphaChannel(); // (the native image creator may not give back what we expect) - const Image::BitmapData destData (image, Image::BitmapData::writeOnly); + const Image::BitmapData destData (image, Image::BitmapData::writeOnly); - for (int y = 0; y < (int) height; ++y) - { - const uint8* src = rows[y]; - uint8* dest = destData.getLinePointer (y); + for (int y = 0; y < (int) height; ++y) + { + const uint8* src = rows[y]; + uint8* dest = destData.getLinePointer (y); - if (hasAlphaChan) + if (hasAlphaChan) + { + for (int i = (int) width; --i >= 0;) { - for (int i = (int) width; --i >= 0;) - { - ((PixelARGB*) dest)->setARGB (src[3], src[0], src[1], src[2]); - ((PixelARGB*) dest)->premultiply(); - dest += destData.pixelStride; - src += 4; - } + ((PixelARGB*) dest)->setARGB (src[3], src[0], src[1], src[2]); + ((PixelARGB*) dest)->premultiply(); + dest += destData.pixelStride; + src += 4; } - else + } + else + { + for (int i = (int) width; --i >= 0;) { - for (int i = (int) width; --i >= 0;) - { - ((PixelRGB*) dest)->setARGB (0, src[0], src[1], src[2]); - dest += destData.pixelStride; - src += 4; - } + ((PixelRGB*) dest)->setARGB (0, src[0], src[1], src[2]); + dest += destData.pixelStride; + src += 4; } } } - catch (PNGHelpers::PNGErrorStruct&) - {} + + return image; + } + + static Image readImage (InputStream& in, png_structp pngReadStruct, png_infop pngInfoStruct) + { + jmp_buf errorJumpBuf; + png_set_error_fn (pngReadStruct, &errorJumpBuf, errorCallback, warningCallback); + + png_uint_32 width = 0, height = 0; + int bitDepth = 0, colorType = 0, interlaceType = 0; + + if (readHeader (in, pngReadStruct, pngInfoStruct, errorJumpBuf, + width, height, bitDepth, colorType, interlaceType)) + { + // Load the image into a temp buffer.. + const size_t lineStride = width * 4; + HeapBlock tempBuffer (height * lineStride); + HeapBlock rows (height); + + for (size_t y = 0; y < height; ++y) + rows[y] = (png_bytep) (tempBuffer + lineStride * y); + + if (readImageData (pngReadStruct, pngInfoStruct, errorJumpBuf, rows)) + return createImageFromData ((colorType & PNG_COLOR_MASK_ALPHA) != 0 || pngInfoStruct->num_trans > 0, + (int) width, (int) height, rows); + } + + return Image(); } - return image; + static Image readImage (InputStream& in) + { + if (png_structp pngReadStruct = png_create_read_struct (PNG_LIBPNG_VER_STRING, 0, 0, 0)) + { + if (png_infop pngInfoStruct = png_create_info_struct (pngReadStruct)) + { + Image image (readImage (in, pngReadStruct, pngInfoStruct)); + png_destroy_read_struct (&pngReadStruct, &pngInfoStruct, 0); + return image; + } + + png_destroy_read_struct (&pngReadStruct, 0, 0); + } + + return Image(); + } + #endif +} + +//============================================================================== +PNGImageFormat::PNGImageFormat() {} +PNGImageFormat::~PNGImageFormat() {} + +String PNGImageFormat::getFormatName() { return "PNG"; } +bool PNGImageFormat::usesFileExtension (const File& f) { return f.hasFileExtension ("png"); } + +bool PNGImageFormat::canUnderstand (InputStream& in) +{ + const int bytesNeeded = 4; + char header [bytesNeeded]; + + return in.read (header, bytesNeeded) == bytesNeeded + && header[1] == 'P' + && header[2] == 'N' + && header[3] == 'G'; +} + +#if JUCE_USING_COREIMAGE_LOADER + Image juce_loadWithCoreImage (InputStream&); #endif + +Image PNGImageFormat::decodeImage (InputStream& in) +{ + #if JUCE_USING_COREIMAGE_LOADER + return juce_loadWithCoreImage (in); + #else + return PNGHelpers::readImage (in); + #endif } bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out) diff --git a/source/modules/juce_graphics/images/juce_Image.cpp b/source/modules/juce_graphics/images/juce_Image.cpp index 7a0ddbe2e..42998526d 100644 --- a/source/modules/juce_graphics/images/juce_Image.cpp +++ b/source/modules/juce_graphics/images/juce_Image.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_Image.h b/source/modules/juce_graphics/images/juce_Image.h index 0e624ebcc..189094c9f 100644 --- a/source/modules/juce_graphics/images/juce_Image.h +++ b/source/modules/juce_graphics/images/juce_Image.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_ImageCache.cpp b/source/modules/juce_graphics/images/juce_ImageCache.cpp index a806e48d9..797c796b2 100644 --- a/source/modules/juce_graphics/images/juce_ImageCache.cpp +++ b/source/modules/juce_graphics/images/juce_ImageCache.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_ImageCache.h b/source/modules/juce_graphics/images/juce_ImageCache.h index c4243952b..77bdc6081 100644 --- a/source/modules/juce_graphics/images/juce_ImageCache.h +++ b/source/modules/juce_graphics/images/juce_ImageCache.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp b/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp index 78e4fb8d6..95a184cc4 100644 --- a/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp +++ b/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.h b/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.h index 885dc6bf3..67d55d61c 100644 --- a/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.h +++ b/source/modules/juce_graphics/images/juce_ImageConvolutionKernel.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/images/juce_ImageFileFormat.cpp b/source/modules/juce_graphics/images/juce_ImageFileFormat.cpp index a1cfd6a44..30b47d0c7 100644 --- a/source/modules/juce_graphics/images/juce_ImageFileFormat.cpp +++ b/source/modules/juce_graphics/images/juce_ImageFileFormat.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -74,12 +74,10 @@ ImageFileFormat* ImageFileFormat::findImageFormatForFileExtension (const File& f //============================================================================== Image ImageFileFormat::loadFrom (InputStream& input) { - ImageFileFormat* const format = findImageFormatForStream (input); - - if (format != nullptr) + if (ImageFileFormat* format = findImageFormatForStream (input)) return format->decodeImage (input); - return Image::null; + return Image(); } Image ImageFileFormat::loadFrom (const File& file) @@ -92,7 +90,7 @@ Image ImageFileFormat::loadFrom (const File& file) return loadFrom (b); } - return Image::null; + return Image(); } Image ImageFileFormat::loadFrom (const void* rawData, const size_t numBytes) @@ -103,5 +101,5 @@ Image ImageFileFormat::loadFrom (const void* rawData, const size_t numBytes) return loadFrom (stream); } - return Image::null; + return Image(); } diff --git a/source/modules/juce_graphics/images/juce_ImageFileFormat.h b/source/modules/juce_graphics/images/juce_ImageFileFormat.h index 76a13d25a..e54ede699 100644 --- a/source/modules/juce_graphics/images/juce_ImageFileFormat.h +++ b/source/modules/juce_graphics/images/juce_ImageFileFormat.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/juce_graphics.cpp b/source/modules/juce_graphics/juce_graphics.cpp index a03c4640d..2d5a0966e 100644 --- a/source/modules/juce_graphics/juce_graphics.cpp +++ b/source/modules/juce_graphics/juce_graphics.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/juce_graphics.h b/source/modules/juce_graphics/juce_graphics.h index 9a5a0150f..a79213188 100644 --- a/source/modules/juce_graphics/juce_graphics.h +++ b/source/modules/juce_graphics/juce_graphics.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_RenderingHelpers.h b/source/modules/juce_graphics/native/juce_RenderingHelpers.h index 53c2f10a7..cd8cd368d 100644 --- a/source/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/source/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_android_Fonts.cpp b/source/modules/juce_graphics/native/juce_android_Fonts.cpp index e08ef2a01..78d2b4962 100644 --- a/source/modules/juce_graphics/native/juce_android_Fonts.cpp +++ b/source/modules/juce_graphics/native/juce_android_Fonts.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_android_GraphicsContext.cpp b/source/modules/juce_graphics/native/juce_android_GraphicsContext.cpp index 9382c1db6..4c4881291 100644 --- a/source/modules/juce_graphics/native/juce_android_GraphicsContext.cpp +++ b/source/modules/juce_graphics/native/juce_android_GraphicsContext.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_freetype_Fonts.cpp b/source/modules/juce_graphics/native/juce_freetype_Fonts.cpp index 6114456e9..cc87924cd 100644 --- a/source/modules/juce_graphics/native/juce_freetype_Fonts.cpp +++ b/source/modules/juce_graphics/native/juce_freetype_Fonts.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_linux_Fonts.cpp b/source/modules/juce_graphics/native/juce_linux_Fonts.cpp index 0869ec719..39dd38444 100644 --- a/source/modules/juce_graphics/native/juce_linux_Fonts.cpp +++ b/source/modules/juce_graphics/native/juce_linux_Fonts.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h index 9beefef00..df34033b3 100644 --- a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h +++ b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm index 9858afd7f..a6f98741a 100644 --- a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm +++ b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h index bc9e66bd3..1982ea3db 100644 --- a/source/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h +++ b/source/modules/juce_graphics/native/juce_mac_CoreGraphicsHelpers.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_mac_Fonts.mm b/source/modules/juce_graphics/native/juce_mac_Fonts.mm index 3298e9ef1..b5c6918f4 100644 --- a/source/modules/juce_graphics/native/juce_mac_Fonts.mm +++ b/source/modules/juce_graphics/native/juce_mac_Fonts.mm @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp b/source/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp index e4356b724..ba1d3397a 100644 --- a/source/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp +++ b/source/modules/juce_graphics/native/juce_win32_Direct2DGraphicsContext.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp b/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp index fd2c7a703..d637fca96 100644 --- a/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp +++ b/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -52,11 +52,37 @@ namespace DirectWriteTypeLayout return S_OK; } - JUCE_COMRESULT GetCurrentTransform (void*, DWRITE_MATRIX*) { return S_OK; } - JUCE_COMRESULT GetPixelsPerDip (void*, FLOAT*) { return S_OK; } - JUCE_COMRESULT DrawUnderline (void*, FLOAT, FLOAT, DWRITE_UNDERLINE const*, IUnknown*) { return S_OK; } - JUCE_COMRESULT DrawStrikethrough (void*, FLOAT, FLOAT, DWRITE_STRIKETHROUGH const*, IUnknown*) { return S_OK; } - JUCE_COMRESULT DrawInlineObject (void*, FLOAT, FLOAT, IDWriteInlineObject*, BOOL, BOOL, IUnknown*) { return E_NOTIMPL; } + JUCE_COMRESULT GetCurrentTransform (void*, DWRITE_MATRIX* matrix) + { + matrix->m11 = 1.0f; + matrix->m12 = 0.0f; + matrix->m21 = 0.0f; + matrix->m22 = 1.0f; + matrix->dx = 0.0f; + matrix->dy = 0.0f; + return S_OK; + } + + JUCE_COMRESULT GetPixelsPerDip (void*, FLOAT* pixelsPerDip) + { + *pixelsPerDip = 1.0f; + return S_OK; + } + + JUCE_COMRESULT DrawUnderline (void*, FLOAT, FLOAT, DWRITE_UNDERLINE const*, IUnknown*) + { + return E_NOTIMPL; + } + + JUCE_COMRESULT DrawStrikethrough (void*, FLOAT, FLOAT, DWRITE_STRIKETHROUGH const*, IUnknown*) + { + return E_NOTIMPL; + } + + JUCE_COMRESULT DrawInlineObject (void*, FLOAT, FLOAT, IDWriteInlineObject*, BOOL, BOOL, IUnknown*) + { + return E_NOTIMPL; + } JUCE_COMRESULT DrawGlyphRun (void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE, DWRITE_GLYPH_RUN const* glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION const* runDescription, @@ -75,10 +101,10 @@ namespace DirectWriteTypeLayout if (currentLine >= layout->getNumLines()) { jassert (currentLine == layout->getNumLines()); - TextLayout::Line* const newLine = new TextLayout::Line(); - layout->addLine (newLine); + TextLayout::Line* const line = new TextLayout::Line(); + layout->addLine (line); - newLine->lineOrigin = Point (baselineOriginX, baselineOriginY); + line->lineOrigin = Point (baselineOriginX, baselineOriginY); } } @@ -419,20 +445,6 @@ bool TextLayout::createNativeLayout (const AttributedString& text) if (factories->d2dFactory != nullptr && factories->systemFonts != nullptr) { - #if JUCE_64BIT - // There's a mysterious bug in 64-bit Windows that causes garbage floating-point - // values to be returned to DrawGlyphRun the first time that it gets used. - // In lieu of a better plan, this bodge uses a dummy call to work around this. - static bool hasBeenCalled = false; - if (! hasBeenCalled) - { - hasBeenCalled = true; - TextLayout dummy; - DirectWriteTypeLayout::createLayout (dummy, text, factories->directWriteFactory, - factories->d2dFactory, factories->systemFonts); - } - #endif - DirectWriteTypeLayout::createLayout (*this, text, factories->directWriteFactory, factories->d2dFactory, factories->systemFonts); return true; diff --git a/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp b/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp index 0673aa556..dcf660623 100644 --- a/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp +++ b/source/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/native/juce_win32_Fonts.cpp b/source/modules/juce_graphics/native/juce_win32_Fonts.cpp index bc5bb3520..db57fd198 100644 --- a/source/modules/juce_graphics/native/juce_win32_Fonts.cpp +++ b/source/modules/juce_graphics/native/juce_win32_Fonts.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -542,22 +542,22 @@ private: } } - void createKerningPairs (HDC dc, const float height) + void createKerningPairs (HDC hdc, const float height) { HeapBlock rawKerning; - const DWORD numKPs = GetKerningPairs (dc, 0, 0); + const DWORD numKPs = GetKerningPairs (hdc, 0, 0); rawKerning.calloc (numKPs); - GetKerningPairs (dc, numKPs, rawKerning); + GetKerningPairs (hdc, numKPs, rawKerning); kerningPairs.ensureStorageAllocated ((int) numKPs); for (DWORD i = 0; i < numKPs; ++i) { KerningPair kp; - kp.glyph1 = getGlyphForChar (dc, rawKerning[i].wFirst); - kp.glyph2 = getGlyphForChar (dc, rawKerning[i].wSecond); + kp.glyph1 = getGlyphForChar (hdc, rawKerning[i].wFirst); + kp.glyph2 = getGlyphForChar (hdc, rawKerning[i].wSecond); - const int standardWidth = getGlyphWidth (dc, kp.glyph1); + const int standardWidth = getGlyphWidth (hdc, kp.glyph1); kp.kerning = (standardWidth + rawKerning[i].iKernAmount) / height; kerningPairs.add (kp); @@ -587,7 +587,7 @@ private: return gm.gmCellIncX; } - float getKerning (HDC dc, const int glyph1, const int glyph2) + float getKerning (HDC hdc, const int glyph1, const int glyph2) { KerningPair kp; kp.glyph1 = glyph1; @@ -602,7 +602,7 @@ private: if (index < 0) { kp.glyph2 = -1; - kp.kerning = getGlyphWidth (dc, kp.glyph1) / (float) tm.tmHeight; + kp.kerning = getGlyphWidth (hdc, kp.glyph1) / (float) tm.tmHeight; kerningPairs.add (kp); return kp.kerning; } diff --git a/source/modules/juce_graphics/placement/juce_Justification.h b/source/modules/juce_graphics/placement/juce_Justification.h index f80fa217d..c48ab7172 100644 --- a/source/modules/juce_graphics/placement/juce_Justification.h +++ b/source/modules/juce_graphics/placement/juce_Justification.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/placement/juce_RectanglePlacement.cpp b/source/modules/juce_graphics/placement/juce_RectanglePlacement.cpp index 031048e30..c13e505b2 100644 --- a/source/modules/juce_graphics/placement/juce_RectanglePlacement.cpp +++ b/source/modules/juce_graphics/placement/juce_RectanglePlacement.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_graphics/placement/juce_RectanglePlacement.h b/source/modules/juce_graphics/placement/juce_RectanglePlacement.h index 9341e6742..fd5b24e75 100644 --- a/source/modules/juce_graphics/placement/juce_RectanglePlacement.h +++ b/source/modules/juce_graphics/placement/juce_RectanglePlacement.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/application/juce_Application.cpp b/source/modules/juce_gui_basics/application/juce_Application.cpp index 4e2187316..47c4ee2a5 100644 --- a/source/modules/juce_gui_basics/application/juce_Application.cpp +++ b/source/modules/juce_gui_basics/application/juce_Application.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/application/juce_Application.h b/source/modules/juce_gui_basics/application/juce_Application.h index 175502d52..b5c3f28ef 100644 --- a/source/modules/juce_gui_basics/application/juce_Application.h +++ b/source/modules/juce_gui_basics/application/juce_Application.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp b/source/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp index 75f8590c6..5ff5411cc 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_ArrowButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ArrowButton.h b/source/modules/juce_gui_basics/buttons/juce_ArrowButton.h index 5d64123ab..17efd6fd5 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ArrowButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_ArrowButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_Button.cpp b/source/modules/juce_gui_basics/buttons/juce_Button.cpp index 10d6e03f6..3debe03d2 100644 --- a/source/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_Button.h b/source/modules/juce_gui_basics/buttons/juce_Button.h index a58342d56..8704e6c59 100644 --- a/source/modules/juce_gui_basics/buttons/juce_Button.h +++ b/source/modules/juce_gui_basics/buttons/juce_Button.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp b/source/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp index f944bec70..6bbfc2026 100644 --- a/source/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_DrawableButton.h b/source/modules/juce_gui_basics/buttons/juce_DrawableButton.h index f07616fd1..072cbbf74 100644 --- a/source/modules/juce_gui_basics/buttons/juce_DrawableButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_DrawableButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp b/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp index 8274f4c12..f448a1e2d 100644 --- a/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h b/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h index 4cd3f5292..e40dae532 100644 --- a/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_HyperlinkButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ImageButton.cpp b/source/modules/juce_gui_basics/buttons/juce_ImageButton.cpp index 3170d05f6..41a850422 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ImageButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_ImageButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ImageButton.h b/source/modules/juce_gui_basics/buttons/juce_ImageButton.h index 64db59df2..fed3cad40 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ImageButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_ImageButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp b/source/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp index 28cd8de82..0894e80ae 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ShapeButton.h b/source/modules/juce_gui_basics/buttons/juce_ShapeButton.h index ddc462521..624a23143 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ShapeButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_ShapeButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_TextButton.cpp b/source/modules/juce_gui_basics/buttons/juce_TextButton.cpp index b51ea6587..534a9f4d6 100644 --- a/source/modules/juce_gui_basics/buttons/juce_TextButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_TextButton.cpp @@ -1,7 +1,8 @@ /* ============================================================================== - file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + + This file is part of the JUCE library. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_TextButton.h b/source/modules/juce_gui_basics/buttons/juce_TextButton.h index 31c477ba7..161b38979 100644 --- a/source/modules/juce_gui_basics/buttons/juce_TextButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_TextButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp b/source/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp index edaf7ab0a..c9a68d732 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ToggleButton.h b/source/modules/juce_gui_basics/buttons/juce_ToggleButton.h index 911bc5991..8c10fd0e2 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ToggleButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_ToggleButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp b/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp index f7ef1b096..f398f335b 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp +++ b/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.h b/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.h index 1f2548f07..9721aa810 100644 --- a/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.h +++ b/source/modules/juce_gui_basics/buttons/juce_ToolbarButton.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h index 9a00cbc8c..d24d49ed5 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandID.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp index 174ec80f3..e86ff44cd 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h index f906f4347..04604f791 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp index 82ec3a248..0d3a1d083 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h index d040dc9a0..4ace28425 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp index c31d1874d..734def2e6 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h index c14faa818..b65218dad 100644 --- a/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h +++ b/source/modules/juce_gui_basics/commands/juce_ApplicationCommandTarget.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp b/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp index bcfac4e80..aa52f0c25 100644 --- a/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp +++ b/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h b/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h index d3351aca5..315de8f64 100644 --- a/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h +++ b/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_CachedComponentImage.h b/source/modules/juce_gui_basics/components/juce_CachedComponentImage.h index 3f273cba0..e9be2c632 100644 --- a/source/modules/juce_gui_basics/components/juce_CachedComponentImage.h +++ b/source/modules/juce_gui_basics/components/juce_CachedComponentImage.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_Component.cpp b/source/modules/juce_gui_basics/components/juce_Component.cpp index 0d9f9ab6a..a02f6a56e 100644 --- a/source/modules/juce_gui_basics/components/juce_Component.cpp +++ b/source/modules/juce_gui_basics/components/juce_Component.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -789,6 +789,8 @@ public: Graphics imG (image); LowLevelGraphicsContext& lg = imG.getInternalContext(); + lg.addTransform (AffineTransform::scale (scale)); + for (const Rectangle* i = validArea.begin(), * const e = validArea.end(); i != e; ++i) lg.excludeClipRectangle (*i); @@ -799,11 +801,10 @@ public: lg.setFill (Colours::black); } - lg.addTransform (AffineTransform::scale (scale)); owner.paintEntireComponent (imG, true); } - validArea = imageBounds; + validArea = compBounds; g.setColour (Colours::black.withAlpha (owner.getAlpha())); g.drawImageTransformed (image, AffineTransform::scale (compBounds.getWidth() / (float) imageBounds.getWidth(), @@ -811,7 +812,7 @@ public: } bool invalidateAll() override { validArea.clear(); return true; } - bool invalidate (const Rectangle& area) override { validArea.subtract (area * scale); return true; } + bool invalidate (const Rectangle& area) override { validArea.subtract (area); return true; } void releaseResources() override { image = Image::null; } private: @@ -1837,6 +1838,11 @@ void Component::setRepaintsOnMouseActivity (const bool shouldRepaint) noexcept } //============================================================================== +float Component::getAlpha() const noexcept +{ + return (255 - componentTransparency) / 255.0f; +} + void Component::setAlpha (const float newAlpha) { const uint8 newIntAlpha = (uint8) (255 - jlimit (0, 255, roundToInt (newAlpha * 255.0))); @@ -1844,22 +1850,21 @@ void Component::setAlpha (const float newAlpha) if (componentTransparency != newIntAlpha) { componentTransparency = newIntAlpha; - - if (flags.hasHeavyweightPeerFlag) - { - if (ComponentPeer* const peer = getPeer()) - peer->setAlpha (newAlpha); - } - else - { - repaint(); - } + alphaChanged(); } } -float Component::getAlpha() const +void Component::alphaChanged() { - return (255 - componentTransparency) / 255.0f; + if (flags.hasHeavyweightPeerFlag) + { + if (ComponentPeer* const peer = getPeer()) + peer->setAlpha (getAlpha()); + } + else + { + repaint(); + } } //============================================================================== diff --git a/source/modules/juce_gui_basics/components/juce_Component.h b/source/modules/juce_gui_basics/components/juce_Component.h index 3d15f5860..9b93c4ef0 100644 --- a/source/modules/juce_gui_basics/components/juce_Component.h +++ b/source/modules/juce_gui_basics/components/juce_Component.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -1353,19 +1353,26 @@ public: */ virtual void enablementChanged(); + //============================================================================== + /** Returns the component's current transparancy level. + See setAlpha() for more details. + */ + float getAlpha() const noexcept; + /** Changes the transparency of this component. When painted, the entire component and all its children will be rendered with this as the overall opacity level, where 0 is completely invisible, and 1.0 is fully opaque (i.e. normal). - @see getAlpha + @see getAlpha, alphaChanged */ void setAlpha (float newAlpha); - /** Returns the component's current transparancy level. - See setAlpha() for more details. + /** Called when setAlpha() is used to change the alpha value of this component. + If you override this, you should also invoke the base class's implementation + during your overridden function, as it performs some repainting behaviour. */ - float getAlpha() const; + virtual void alphaChanged(); //============================================================================== /** Changes the mouse cursor shape to use when the mouse is over this component. @@ -1880,6 +1887,7 @@ public: virtual void handleCommandMessage (int commandId); //============================================================================== + #if JUCE_MODAL_LOOPS_PERMITTED /** Runs a component modally, waiting until the loop terminates. This method first makes the component visible, brings it to the front and @@ -1893,10 +1901,18 @@ public: the component is deleted), and then this method returns, returning the value passed into exitModalState(). + Note that you SHOULD NEVER USE THIS METHOD! Modal loops are a dangerous construct + because things that happen during the events that they dispatch could affect the + state of objects which are currently in use somewhere on the stack, so when the + loop finishes and the stack unwinds, horrible problems can occur. This is especially + bad in plugins, where the host may choose to delete the plugin during runModalLoop(), + so that when it returns, the entire DLL could have been unloaded from memory! + Also, some OSes deliberately make it impossible to run modal loops (e.g. Android), + so this method won't even exist on some platforms. + @see enterModalState, exitModalState, isCurrentlyModal, getCurrentlyModalComponent, isCurrentlyBlockedByAnotherModalComponent, ModalComponentManager */ - #if JUCE_MODAL_LOOPS_PERMITTED int runModalLoop(); #endif diff --git a/source/modules/juce_gui_basics/components/juce_ComponentListener.cpp b/source/modules/juce_gui_basics/components/juce_ComponentListener.cpp index 3e5cd35eb..b5968d9a1 100644 --- a/source/modules/juce_gui_basics/components/juce_ComponentListener.cpp +++ b/source/modules/juce_gui_basics/components/juce_ComponentListener.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_ComponentListener.h b/source/modules/juce_gui_basics/components/juce_ComponentListener.h index 56c06311b..39e5b37ff 100644 --- a/source/modules/juce_gui_basics/components/juce_ComponentListener.h +++ b/source/modules/juce_gui_basics/components/juce_ComponentListener.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_Desktop.cpp b/source/modules/juce_gui_basics/components/juce_Desktop.cpp index 8aaece46b..a80c5808d 100644 --- a/source/modules/juce_gui_basics/components/juce_Desktop.cpp +++ b/source/modules/juce_gui_basics/components/juce_Desktop.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_Desktop.h b/source/modules/juce_gui_basics/components/juce_Desktop.h index 4cc33171c..a31d71e94 100644 --- a/source/modules/juce_gui_basics/components/juce_Desktop.h +++ b/source/modules/juce_gui_basics/components/juce_Desktop.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp b/source/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp index 12b81df06..cc46ac0b9 100644 --- a/source/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp +++ b/source/modules/juce_gui_basics/components/juce_ModalComponentManager.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/components/juce_ModalComponentManager.h b/source/modules/juce_gui_basics/components/juce_ModalComponentManager.h index 1eac49938..df8b7b2de 100644 --- a/source/modules/juce_gui_basics/components/juce_ModalComponentManager.h +++ b/source/modules/juce_gui_basics/components/juce_ModalComponentManager.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_Drawable.cpp b/source/modules/juce_gui_basics/drawables/juce_Drawable.cpp index 3e8831880..f9b0944d7 100644 --- a/source/modules/juce_gui_basics/drawables/juce_Drawable.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_Drawable.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -32,6 +32,7 @@ Drawable::Drawable (const Drawable& other) : Component (other.getName()) { setComponentID (other.getComponentID()); + setTransform (other.getTransform()); } Drawable::~Drawable() diff --git a/source/modules/juce_gui_basics/drawables/juce_Drawable.h b/source/modules/juce_gui_basics/drawables/juce_Drawable.h index 1338d7e92..f297d9c55 100644 --- a/source/modules/juce_gui_basics/drawables/juce_Drawable.h +++ b/source/modules/juce_gui_basics/drawables/juce_Drawable.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp index 688507fd5..fa21d9233 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.h b/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.h index 7629ef895..8c484c987 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableComposite.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -30,6 +30,11 @@ /** A drawable object which acts as a container for a set of other Drawables. + Note that although this is a Component, it takes ownership of its child components + and will delete them, so that you can use it as a self-contained graphic object. + The intention is that you should not add your own components to it, only add other + Drawable objects. + @see Drawable */ class JUCE_API DrawableComposite : public Drawable diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp index d609011a1..8eb51d26c 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableImage.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableImage.h b/source/modules/juce_gui_basics/drawables/juce_DrawableImage.h index 6089dee8a..56814a8f7 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableImage.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableImage.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp index 0b437a4b6..19a2d4dfe 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawablePath.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -88,11 +88,11 @@ public: bool ok = true; jassert (owner.relativePath != nullptr); - const RelativePointPath& path = *owner.relativePath; + const RelativePointPath& relPath = *owner.relativePath; - for (int i = 0; i < path.elements.size(); ++i) + for (int i = 0; i < relPath.elements.size(); ++i) { - RelativePointPath::ElementBase* const e = path.elements.getUnchecked(i); + RelativePointPath::ElementBase* const e = relPath.elements.getUnchecked(i); int numPoints; RelativePoint* const points = e->getControlPoints (numPoints); diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawablePath.h b/source/modules/juce_gui_basics/drawables/juce_DrawablePath.h index bed3895d1..a06ea4349 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawablePath.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawablePath.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -123,8 +123,8 @@ public: ValueTree getPathState(); - void readFrom (const RelativePointPath& path, UndoManager* undoManager); - void writeTo (RelativePointPath& path) const; + void readFrom (const RelativePointPath& relativePath, UndoManager* undoManager); + void writeTo (RelativePointPath& relativePath) const; static const Identifier nonZeroWinding, point1, point2, point3; }; diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp index 5a8c1c85e..034953bc4 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h b/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h index 9bae02e9f..b136b8d8c 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableRectangle.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp index 907aafac7..16aad5ebb 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableShape.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableShape.h b/source/modules/juce_gui_basics/drawables/juce_DrawableShape.h index ed893f14c..5fa5b3ed4 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableShape.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableShape.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableText.cpp b/source/modules/juce_gui_basics/drawables/juce_DrawableText.cpp index e9c980212..d14288151 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableText.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableText.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_DrawableText.h b/source/modules/juce_gui_basics/drawables/juce_DrawableText.h index ac44fb49f..16b801bb0 100644 --- a/source/modules/juce_gui_basics/drawables/juce_DrawableText.h +++ b/source/modules/juce_gui_basics/drawables/juce_DrawableText.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/source/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index 352616c9c..01d487228 100644 --- a/source/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/source/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -377,6 +377,7 @@ private: if (tag == "polygon") return parsePolygon (xml, false); if (tag == "text") return parseText (xml, true); if (tag == "switch") return parseSwitch (xml); + if (tag == "a") return parseLinkElement (xml); if (tag == "style") parseCSSStyle (xml); return nullptr; @@ -412,6 +413,11 @@ private: return drawable; } + DrawableComposite* parseLinkElement (const XmlPath& xml) + { + return parseGroupElement (xml); // TODO: support for making this clickable + } + //============================================================================== Drawable* parsePath (const XmlPath& xml) const { @@ -1085,6 +1091,11 @@ private: } //============================================================================== + static bool isStartOfNumber (juce_wchar c) noexcept + { + return CharacterFunctions::isDigit (c) || c == '-' || c == '+'; + } + static bool parseNextNumber (String::CharPointerType& text, String& value, const bool allowUnits) { String::CharPointerType s (text); @@ -1094,14 +1105,21 @@ private: String::CharPointerType start (s); - if (s.isDigit() || *s == '.' || *s == '-') + if (isStartOfNumber (*s)) ++s; - while (s.isDigit() || *s == '.') + while (s.isDigit()) ++s; - if ((*s == 'e' || *s == 'E') - && ((s + 1).isDigit() || s[1] == '-' || s[1] == '+')) + if (*s == '.') + { + ++s; + + while (s.isDigit()) + ++s; + } + + if ((*s == 'e' || *s == 'E') && isStartOfNumber (s[1])) { s += 2; diff --git a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp index 265df8312..287119357 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp +++ b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h index ebe16805f..0aa8235da 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h +++ b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsDisplayComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp index db98eb25c..79d810fdb 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp +++ b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h index b2e6a21d0..2c015de83 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h +++ b/source/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) diff --git a/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp b/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp index 2dc3364fb..d7c0feb3c 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp +++ b/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -32,7 +32,8 @@ FileBrowserComponent::FileBrowserComponent (int flags_, previewComp (previewComp_), currentPathBox ("path"), fileLabel ("f", TRANS ("file:")), - thread ("Juce FileBrowser") + thread ("Juce FileBrowser"), + wasProcessActive (false) { // You need to specify one or other of the open/save flags.. jassert ((flags & (saveMode | openMode)) != 0); @@ -109,6 +110,8 @@ FileBrowserComponent::FileBrowserComponent (int flags_, setRoot (currentRoot); thread.startThread (4); + + startTimer (2000); } FileBrowserComponent::~FileBrowserComponent() @@ -178,7 +181,7 @@ void FileBrowserComponent::deselectAllFiles() bool FileBrowserComponent::isFileSuitable (const File& file) const { return (flags & canSelectFiles) != 0 - && (fileFilter == nullptr || fileFilter->isFileSuitable (file)); + && (fileFilter == nullptr || fileFilter->isFileSuitable (file)); } bool FileBrowserComponent::isDirectorySuitable (const File&) const @@ -190,10 +193,10 @@ bool FileBrowserComponent::isFileOrDirSuitable (const File& f) const { if (f.isDirectory()) return (flags & canSelectDirectories) != 0 - && (fileFilter == nullptr || fileFilter->isDirectorySuitable (f)); + && (fileFilter == nullptr || fileFilter->isDirectorySuitable (f)); return (flags & canSelectFiles) != 0 && f.exists() - && (fileFilter == nullptr || fileFilter->isFileSuitable (f)); + && (fileFilter == nullptr || fileFilter->isFileSuitable (f)); } //============================================================================== @@ -401,8 +404,6 @@ void FileBrowserComponent::browserRootChanged (const File&) {} bool FileBrowserComponent::keyPressed (const KeyPress& key) { - (void) key; - #if JUCE_LINUX || JUCE_WINDOWS if (key.getModifiers().isCommandDown() && (key.getKeyCode() == 'H' || key.getKeyCode() == 'h')) @@ -413,6 +414,7 @@ bool FileBrowserComponent::keyPressed (const KeyPress& key) } #endif + ignoreUnused (key); return false; } @@ -589,3 +591,16 @@ void FileBrowserComponent::getRoots (StringArray& rootNames, StringArray& rootPa { getDefaultRoots (rootNames, rootPaths); } + +void FileBrowserComponent::timerCallback() +{ + const bool isProcessActive = Process::isForegroundProcess(); + + if (wasProcessActive != isProcessActive) + { + wasProcessActive = isProcessActive; + + if (isProcessActive && fileList != nullptr) + refresh(); + } +} diff --git a/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h b/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h index 62d28742d..284ee95b4 100644 --- a/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h +++ b/source/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h @@ -2,7 +2,7 @@ ============================================================================== This file is part of the JUCE library. - Copyright (c) 2013 - Raw Material Software Ltd. + Copyright (c) 2015 - ROLI Ltd. Permission is granted to use this software under the terms of either: a) the GPL v2 (or any later version) @@ -41,7 +41,8 @@ class JUCE_API FileBrowserComponent : public Component, private TextEditorListener, private ButtonListener, private ComboBoxListener, // (can't use ComboBox::Listener due to idiotic VC2005 bug) - private FileFilter + private FileFilter, + private Timer { public: //============================================================================== @@ -103,8 +104,7 @@ public: */ File getSelectedFile (int index) const noexcept; - /** Deselects any files that are currently selected. - */ + /** Deselects any files that are currently selected. */ void deselectAllFiles(); /** Returns true if the currently selected file(s) are usable. @@ -150,8 +150,7 @@ public: */ virtual String getActionVerb() const; - /** Returns true if the saveMode flag was set when this component was created. - */ + /** Returns true if the saveMode flag was set when this component was created. */ bool isSaveMode() const noexcept; /** Sets the label that will be displayed next to the filename entry box. @@ -243,10 +242,8 @@ public: bool isFileSuitable (const File&) const override; /** @internal */ bool isDirectorySuitable (const File&) const override; - /** @internal */ FilePreviewComponent* getPreviewComponent() const noexcept; - /** @internal */ DirectoryContentsDisplayComponent* getDisplayComponent() const noexcept; @@ -263,13 +260,13 @@ protected: private: //============================================================================== - ScopedPointer fileList; + ScopedPointer fileList; const FileFilter* fileFilter; int flags; File currentRoot; Array chosenFiles; - ListenerList listeners; + ListenerList listeners; ScopedPointer fileListComponent; FilePreviewComponent* previewComp; @@ -277,11 +274,12 @@ private: TextEditor filenameBox; Label fileLabel; ScopedPointer