| @@ -56,7 +56,7 @@ struct MidiDeviceListEntry : ReferenceCountedObject | |||
| std::unique_ptr<MidiInput> inDevice; | |||
| std::unique_ptr<MidiOutput> outDevice; | |||
| typedef ReferenceCountedObjectPtr<MidiDeviceListEntry> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<MidiDeviceListEntry>; | |||
| }; | |||
| //============================================================================== | |||
| @@ -91,7 +91,7 @@ public: | |||
| void handleRedoInEditor (const String& className); | |||
| void handleMissingSystemHeaders(); | |||
| typedef ReferenceCountedObjectPtr<CompileEngineChildProcess> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<CompileEngineChildProcess>; | |||
| private: | |||
| //============================================================================== | |||
| @@ -234,7 +234,7 @@ public: | |||
| BuildConfiguration (Project& project, const ValueTree& configNode, const ProjectExporter&); | |||
| ~BuildConfiguration(); | |||
| typedef ReferenceCountedObjectPtr<BuildConfiguration> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<BuildConfiguration>; | |||
| //============================================================================== | |||
| virtual void createConfigProperties (PropertyListBuilder&) = 0; | |||
| @@ -308,7 +308,7 @@ public: | |||
| class NonConst | |||
| { | |||
| public: | |||
| typedef void VoidType; | |||
| using VoidType = void; | |||
| static inline void* toVoidPtr (VoidType* v) noexcept { return v; } | |||
| enum { isConst = 0 }; | |||
| }; | |||
| @@ -316,7 +316,7 @@ public: | |||
| class Const | |||
| { | |||
| public: | |||
| typedef const void VoidType; | |||
| using VoidType = const void; | |||
| static inline void* toVoidPtr (VoidType* v) noexcept { return const_cast<void*> (v); } | |||
| enum { isConst = 1 }; | |||
| }; | |||
| @@ -1062,7 +1062,7 @@ public: | |||
| //============================================================================== | |||
| /** This allows templated code that takes an AudioBuffer to access its sample type. */ | |||
| typedef Type SampleType; | |||
| using SampleType = Type; | |||
| private: | |||
| //============================================================================== | |||
| @@ -1125,12 +1125,12 @@ private: | |||
| /** | |||
| A multi-channel buffer of 32-bit floating point audio samples. | |||
| This typedef is here for backwards compatibility with the older AudioSampleBuffer | |||
| This type is here for backwards compatibility with the older AudioSampleBuffer | |||
| class, which was fixed for 32-bit data, but is otherwise the same as the new | |||
| templated AudioBuffer class. | |||
| @see AudioBuffer | |||
| */ | |||
| typedef AudioBuffer<float> AudioSampleBuffer; | |||
| using AudioSampleBuffer = AudioBuffer<float>; | |||
| } // namespace juce | |||
| @@ -37,9 +37,9 @@ namespace FloatVectorHelpers | |||
| struct BasicOps32 | |||
| { | |||
| typedef float Type; | |||
| typedef __m128 ParallelType; | |||
| typedef __m128 IntegerType; | |||
| using Type = float; | |||
| using ParallelType = __m128; | |||
| using IntegerType = __m128; | |||
| enum { numParallel = 4 }; | |||
| // Integer and parallel types are the same for SSE. On neon they have different types | |||
| @@ -69,9 +69,9 @@ namespace FloatVectorHelpers | |||
| struct BasicOps64 | |||
| { | |||
| typedef double Type; | |||
| typedef __m128d ParallelType; | |||
| typedef __m128d IntegerType; | |||
| using Type = double; | |||
| using ParallelType = __m128d; | |||
| using IntegerType = __m128d; | |||
| enum { numParallel = 2 }; | |||
| // Integer and parallel types are the same for SSE. On neon they have different types | |||
| @@ -102,7 +102,7 @@ namespace FloatVectorHelpers | |||
| #define JUCE_BEGIN_VEC_OP \ | |||
| typedef FloatVectorHelpers::ModeType<sizeof(*dest)>::Mode Mode; \ | |||
| using Mode = FloatVectorHelpers::ModeType<sizeof(*dest)>::Mode; \ | |||
| { \ | |||
| const int numLongOps = num / Mode::numParallel; | |||
| @@ -202,9 +202,9 @@ namespace FloatVectorHelpers | |||
| struct BasicOps32 | |||
| { | |||
| typedef float Type; | |||
| typedef float32x4_t ParallelType; | |||
| typedef uint32x4_t IntegerType; | |||
| using Type = float; | |||
| using ParallelType = float32x4_t; | |||
| using IntegerType = uint32x4_t; | |||
| union signMaskUnion { ParallelType f; IntegerType i; }; | |||
| enum { numParallel = 4 }; | |||
| @@ -234,9 +234,9 @@ namespace FloatVectorHelpers | |||
| struct BasicOps64 | |||
| { | |||
| typedef double Type; | |||
| typedef double ParallelType; | |||
| typedef uint64 IntegerType; | |||
| using Type = double; | |||
| using ParallelType = double; | |||
| using IntegerType = uint64; | |||
| union signMaskUnion { ParallelType f; IntegerType i; }; | |||
| enum { numParallel = 1 }; | |||
| @@ -265,7 +265,7 @@ namespace FloatVectorHelpers | |||
| }; | |||
| #define JUCE_BEGIN_VEC_OP \ | |||
| typedef FloatVectorHelpers::ModeType<sizeof(*dest)>::Mode Mode; \ | |||
| using Mode = FloatVectorHelpers::ModeType<sizeof(*dest)>::Mode; \ | |||
| if (Mode::numParallel > 1) \ | |||
| { \ | |||
| const int numLongOps = num / Mode::numParallel; | |||
| @@ -353,14 +353,14 @@ namespace FloatVectorHelpers | |||
| union signMask64 { double d; uint64 i; }; | |||
| #if JUCE_USE_SSE_INTRINSICS || JUCE_USE_ARM_NEON | |||
| template<int typeSize> struct ModeType { typedef BasicOps32 Mode; }; | |||
| template<> struct ModeType<8> { typedef BasicOps64 Mode; }; | |||
| template<int typeSize> struct ModeType { using Mode = BasicOps32; }; | |||
| template<> struct ModeType<8> { using Mode = BasicOps64; }; | |||
| template <typename Mode> | |||
| struct MinMax | |||
| { | |||
| typedef typename Mode::Type Type; | |||
| typedef typename Mode::ParallelType ParallelType; | |||
| using Type = typename Mode::Type; | |||
| using ParallelType = typename Mode::ParallelType; | |||
| static Type findMinOrMax (const Type* src, int num, const bool isMinimum) noexcept | |||
| { | |||
| @@ -2062,7 +2062,8 @@ private: | |||
| class UnitTestInstrument : public MPEInstrument, | |||
| private MPEInstrument::Listener | |||
| { | |||
| typedef MPEInstrument Base; | |||
| using Base = MPEInstrument; | |||
| public: | |||
| UnitTestInstrument() | |||
| : noteOnCallCounter (0), noteOffCallCounter (0), pitchbendCallCounter (0), | |||
| @@ -165,7 +165,7 @@ public: | |||
| void setLegacyModePitchbendRange (int pitchbendRange); | |||
| //============================================================================== | |||
| typedef MPEInstrument::TrackingMode TrackingMode; | |||
| using TrackingMode = MPEInstrument::TrackingMode; | |||
| /** Set the MPE tracking mode for the pressure dimension. */ | |||
| void setPressureTrackingMode (TrackingMode modeToUse); | |||
| @@ -64,7 +64,7 @@ public: | |||
| virtual bool appliesToChannel (int midiChannel) = 0; | |||
| /** The class is reference-counted, so this is a handy pointer class for it. */ | |||
| typedef ReferenceCountedObjectPtr<SynthesiserSound> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<SynthesiserSound>; | |||
| private: | |||
| @@ -416,12 +416,11 @@ public: | |||
| */ | |||
| struct LevelMeter : public ReferenceCountedObject | |||
| { | |||
| typedef ReferenceCountedObjectPtr<LevelMeter> Ptr; | |||
| LevelMeter() noexcept; | |||
| double getCurrentLevel() const noexcept; | |||
| using Ptr = ReferenceCountedObjectPtr<LevelMeter>; | |||
| private: | |||
| friend class AudioDeviceManager; | |||
| @@ -48,8 +48,8 @@ struct OboeAudioIODeviceBufferHelpers<int16> | |||
| { | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Int16, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Int16, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const>; | |||
| DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
| SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
| @@ -61,8 +61,8 @@ struct OboeAudioIODeviceBufferHelpers<int16> | |||
| { | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Int16, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Int16, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
| SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
| @@ -95,8 +95,8 @@ struct OboeAudioIODeviceBufferHelpers<float> | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::Const>; | |||
| DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
| SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
| @@ -115,8 +115,8 @@ struct OboeAudioIODeviceBufferHelpers<float> | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
| SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
| @@ -172,8 +172,8 @@ struct BufferHelpers<int16> | |||
| { | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Int16, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Int16, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const>; | |||
| DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
| SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
| @@ -185,8 +185,8 @@ struct BufferHelpers<int16> | |||
| { | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Int16, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Int16, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
| SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
| @@ -231,8 +231,8 @@ struct BufferHelpers<float> | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const>; | |||
| DstSampleType dstData (audioBuffer.getWritePointer (i)); | |||
| SrcSampleType srcData (srcInterleaved + i, audioBuffer.getNumChannels()); | |||
| @@ -250,8 +250,8 @@ struct BufferHelpers<float> | |||
| for (int i = 0; i < audioBuffer.getNumChannels(); ++i) | |||
| { | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst> DstSampleType; | |||
| typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SrcSampleType; | |||
| using DstSampleType = AudioData::Pointer<AudioData::Float32, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst>; | |||
| using SrcSampleType = AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| DstSampleType dstData (dstInterleaved + i, audioBuffer.getNumChannels()); | |||
| SrcSampleType srcData (audioBuffer.getReadPointer (i)); | |||
| @@ -383,7 +383,7 @@ public: | |||
| template <typename T> | |||
| struct OpenSLQueueRunnerPlayer : OpenSLQueueRunner<T, OpenSLQueueRunnerPlayer<T>, SLPlayItf_> | |||
| { | |||
| typedef OpenSLQueueRunner<T, OpenSLQueueRunnerPlayer<T>, SLPlayItf_> Base; | |||
| using Base = OpenSLQueueRunner<T, OpenSLQueueRunnerPlayer<T>, SLPlayItf_>; | |||
| enum { isPlayer = 1 }; | |||
| @@ -425,7 +425,7 @@ public: | |||
| template <typename T> | |||
| struct OpenSLQueueRunnerRecorder : OpenSLQueueRunner<T, OpenSLQueueRunnerRecorder<T>, SLRecordItf_> | |||
| { | |||
| typedef OpenSLQueueRunner<T, OpenSLQueueRunnerRecorder<T>, SLRecordItf_> Base; | |||
| using Base = OpenSLQueueRunner<T, OpenSLQueueRunnerRecorder<T>, SLRecordItf_>; | |||
| enum { isPlayer = 0 }; | |||
| @@ -586,7 +586,7 @@ public: | |||
| int numBuffersToUse); | |||
| //============================================================================== | |||
| typedef SLresult (*CreateEngineFunc)(SLObjectItf*,SLuint32,const SLEngineOption*,SLuint32,const SLInterfaceID*,const SLboolean*); | |||
| typedef SLresult (*CreateEngineFunc)(SLObjectItf*, SLuint32, const SLEngineOption*, SLuint32, const SLInterfaceID*, const SLboolean*); | |||
| //============================================================================== | |||
| int inputChannels, outputChannels; | |||
| @@ -431,7 +431,7 @@ private: | |||
| { | |||
| if (forInput) | |||
| { | |||
| typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestType; | |||
| using DestType = AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| if (isLittleEndian) | |||
| return new AudioData::ConverterInstance <AudioData::Pointer <SampleType, AudioData::LittleEndian, InterleavedType, AudioData::Const>, DestType> (numInterleavedChannels, 1); | |||
| @@ -439,7 +439,7 @@ private: | |||
| return new AudioData::ConverterInstance <AudioData::Pointer <SampleType, AudioData::BigEndian, InterleavedType, AudioData::Const>, DestType> (numInterleavedChannels, 1); | |||
| } | |||
| typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceType; | |||
| using SourceType = AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| if (isLittleEndian) | |||
| return new AudioData::ConverterInstance <SourceType, AudioData::Pointer <SampleType, AudioData::LittleEndian, InterleavedType, AudioData::NonConst>> (1, numInterleavedChannels); | |||
| @@ -35,24 +35,17 @@ namespace | |||
| { | |||
| //============================================================================== | |||
| class AlsaClient : public ReferenceCountedObject | |||
| class AlsaClient : public ReferenceCountedObject | |||
| { | |||
| public: | |||
| typedef ReferenceCountedObjectPtr<AlsaClient> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<AlsaClient>; | |||
| //============================================================================== | |||
| // represents an input or output port of the supplied AlsaClient | |||
| class Port | |||
| struct Port | |||
| { | |||
| public: | |||
| Port (AlsaClient& c, bool forInput) noexcept | |||
| : portId (-1), | |||
| callbackEnabled (false), | |||
| client (c), | |||
| isInput (forInput), | |||
| callback (nullptr), | |||
| maxEventSize (4 * 1024), | |||
| midiInput (nullptr) | |||
| : client (c), isInput (forInput) | |||
| {} | |||
| ~Port() | |||
| @@ -81,10 +74,9 @@ public: | |||
| return client.get() != nullptr && portId >= 0; | |||
| } | |||
| void setupInput(MidiInput* input, MidiInputCallback* cb) | |||
| void setupInput (MidiInput* input, MidiInputCallback* cb) | |||
| { | |||
| jassert (cb && input); | |||
| jassert (cb != nullptr && input != nullptr); | |||
| callback = cb; | |||
| midiInput = input; | |||
| } | |||
| @@ -92,7 +84,6 @@ public: | |||
| void setupOutput() | |||
| { | |||
| jassert (! isInput); | |||
| snd_midi_event_new ((size_t) maxEventSize, &midiParser); | |||
| } | |||
| @@ -121,15 +112,15 @@ public: | |||
| snd_seq_event_t event; | |||
| snd_seq_ev_clear (&event); | |||
| long numBytes = (long) message.getRawDataSize(); | |||
| auto numBytes = (long) message.getRawDataSize(); | |||
| const uint8* data = message.getRawData(); | |||
| snd_seq_t* seqHandle = client.get(); | |||
| auto* seqHandle = client.get(); | |||
| bool success = true; | |||
| while (numBytes > 0) | |||
| { | |||
| const long numSent = snd_midi_event_encode (midiParser, data, numBytes, &event); | |||
| auto numSent = snd_midi_event_encode (midiParser, data, numBytes, &event); | |||
| if (numSent <= 0) | |||
| { | |||
| @@ -161,22 +152,9 @@ public: | |||
| return portId != -1 && portId == lhs.portId; | |||
| } | |||
| int portId; | |||
| bool callbackEnabled; | |||
| private: | |||
| friend class AlsaClient; | |||
| AlsaClient& client; | |||
| bool isInput; | |||
| MidiInputCallback* callback; | |||
| snd_midi_event_t* midiParser; | |||
| int maxEventSize; | |||
| MidiInput* midiInput; | |||
| void createPort (const String& name, bool enableSubscription) | |||
| { | |||
| if (snd_seq_t* seqHandle = client.get()) | |||
| if (auto* seqHandle = client.get()) | |||
| { | |||
| const unsigned int caps = | |||
| isInput | |||
| @@ -197,6 +175,15 @@ public: | |||
| { | |||
| callback->handlePartialSysexMessage (midiInput, messageData, numBytesSoFar, timeStamp); | |||
| } | |||
| AlsaClient& client; | |||
| MidiInputCallback* callback = nullptr; | |||
| snd_midi_event_t* midiParser = nullptr; | |||
| MidiInput* midiInput = nullptr; | |||
| int maxEventSize = 4096; | |||
| int portId = -1; | |||
| bool callbackEnabled = false; | |||
| bool isInput = false; | |||
| }; | |||
| static Ptr getInstance() | |||
| @@ -212,21 +199,21 @@ public: | |||
| if (inputThread == nullptr) | |||
| inputThread.reset (new MidiInputThread (*this)); | |||
| if (++activeCallbacks - 1 == 0) | |||
| if (++activeCallbacks == 1) | |||
| inputThread->startThread(); | |||
| } | |||
| void unregisterCallback() | |||
| { | |||
| jassert (activeCallbacks.get() > 0); | |||
| if (--activeCallbacks == 0 && inputThread->isThreadRunning()) | |||
| inputThread->signalThreadShouldExit(); | |||
| } | |||
| void handleIncomingMidiMessage (snd_seq_event* event, const MidiMessage& message) | |||
| { | |||
| if (event->dest.port < ports.size() | |||
| && ports[event->dest.port]->callbackEnabled) | |||
| if (event->dest.port < ports.size() && ports[event->dest.port]->callbackEnabled) | |||
| ports[event->dest.port]->handleIncomingMidiMessage (message); | |||
| } | |||
| @@ -242,7 +229,7 @@ public: | |||
| Port* createPort (const String& name, bool forInput, bool enableSubscription) | |||
| { | |||
| Port* port = new Port (*this, forInput); | |||
| auto port = new Port (*this, forInput); | |||
| port->createPort (name, enableSubscription); | |||
| ports.set (port->portId, port); | |||
| incReferenceCount(); | |||
| @@ -256,8 +243,8 @@ public: | |||
| } | |||
| private: | |||
| snd_seq_t* handle; | |||
| int clientId; | |||
| snd_seq_t* handle = nullptr; | |||
| int clientId = 0; | |||
| OwnedArray<Port> ports; | |||
| Atomic<int> activeCallbacks; | |||
| CriticalSection callbackLock; | |||
| @@ -269,8 +256,6 @@ private: | |||
| friend struct ContainerDeletePolicy<AlsaClient>; | |||
| AlsaClient() | |||
| : handle (nullptr), | |||
| inputThread (nullptr) | |||
| { | |||
| jassert (instance == nullptr); | |||
| @@ -303,7 +288,7 @@ private: | |||
| { | |||
| public: | |||
| MidiInputThread (AlsaClient& c) | |||
| : Thread ("JUCE MIDI Input"), client (c), concatenator (2048) | |||
| : Thread ("JUCE MIDI Input"), client (c) | |||
| { | |||
| jassert (client.get() != nullptr); | |||
| } | |||
| @@ -358,7 +343,7 @@ private: | |||
| private: | |||
| AlsaClient& client; | |||
| MidiDataConcatenator concatenator; | |||
| MidiDataConcatenator concatenator { 2048 }; | |||
| }; | |||
| std::unique_ptr<MidiInputThread> inputThread; | |||
| @@ -369,9 +354,9 @@ AlsaClient* AlsaClient::instance = nullptr; | |||
| //============================================================================== | |||
| static AlsaClient::Port* iterateMidiClient (const AlsaClient::Ptr& client, | |||
| snd_seq_client_info_t* clientInfo, | |||
| const bool forInput, | |||
| bool forInput, | |||
| StringArray& deviceNamesFound, | |||
| const int deviceIndexToOpen) | |||
| int deviceIndexToOpen) | |||
| { | |||
| AlsaClient::Port* port = nullptr; | |||
| @@ -380,8 +365,8 @@ static AlsaClient::Port* iterateMidiClient (const AlsaClient::Ptr& client, | |||
| snd_seq_port_info_alloca (&portInfo); | |||
| jassert (portInfo); | |||
| int numPorts = snd_seq_client_info_get_num_ports (clientInfo); | |||
| const int sourceClient = snd_seq_client_info_get_client (clientInfo); | |||
| auto numPorts = snd_seq_client_info_get_num_ports (clientInfo); | |||
| auto sourceClient = snd_seq_client_info_get_client (clientInfo); | |||
| snd_seq_port_info_set_client (portInfo, sourceClient); | |||
| snd_seq_port_info_set_port (portInfo, -1); | |||
| @@ -392,13 +377,14 @@ static AlsaClient::Port* iterateMidiClient (const AlsaClient::Ptr& client, | |||
| && (snd_seq_port_info_get_capability (portInfo) | |||
| & (forInput ? SND_SEQ_PORT_CAP_SUBS_READ : SND_SEQ_PORT_CAP_SUBS_WRITE)) != 0) | |||
| { | |||
| const String portName = snd_seq_port_info_get_name(portInfo); | |||
| String portName = snd_seq_port_info_get_name(portInfo); | |||
| deviceNamesFound.add (portName); | |||
| if (deviceNamesFound.size() == deviceIndexToOpen + 1) | |||
| { | |||
| const int sourcePort = snd_seq_port_info_get_port (portInfo); | |||
| auto sourcePort = snd_seq_port_info_get_port (portInfo); | |||
| if (sourcePort != -1) | |||
| { | |||
| port = client->createPort (portName, forInput, false); | |||
| @@ -413,37 +399,39 @@ static AlsaClient::Port* iterateMidiClient (const AlsaClient::Ptr& client, | |||
| return port; | |||
| } | |||
| static AlsaClient::Port* iterateMidiDevices (const bool forInput, | |||
| static AlsaClient::Port* iterateMidiDevices (bool forInput, | |||
| StringArray& deviceNamesFound, | |||
| const int deviceIndexToOpen) | |||
| int deviceIndexToOpen) | |||
| { | |||
| AlsaClient::Port* port = nullptr; | |||
| const AlsaClient::Ptr client (AlsaClient::getInstance()); | |||
| auto client = AlsaClient::getInstance(); | |||
| if (snd_seq_t* const seqHandle = client->get()) | |||
| if (auto* seqHandle = client->get()) | |||
| { | |||
| snd_seq_system_info_t* systemInfo = nullptr; | |||
| snd_seq_client_info_t* clientInfo = nullptr; | |||
| snd_seq_system_info_alloca (&systemInfo); | |||
| jassert(systemInfo); | |||
| jassert (systemInfo != nullptr); | |||
| if (snd_seq_system_info (seqHandle, systemInfo) == 0) | |||
| { | |||
| snd_seq_client_info_alloca (&clientInfo); | |||
| jassert(clientInfo); | |||
| int numClients = snd_seq_system_info_get_cur_clients (systemInfo); | |||
| jassert (clientInfo != nullptr); | |||
| auto numClients = snd_seq_system_info_get_cur_clients (systemInfo); | |||
| while (--numClients >= 0) | |||
| { | |||
| if (snd_seq_query_next_client (seqHandle, clientInfo) == 0) | |||
| { | |||
| const int sourceClient = snd_seq_client_info_get_client (clientInfo); | |||
| if (sourceClient != client->getId() | |||
| && sourceClient != SND_SEQ_CLIENT_SYSTEM) | |||
| auto sourceClient = snd_seq_client_info_get_client (clientInfo); | |||
| if (sourceClient != client->getId() && sourceClient != SND_SEQ_CLIENT_SYSTEM) | |||
| { | |||
| port = iterateMidiClient (client, clientInfo, forInput, | |||
| deviceNamesFound, deviceIndexToOpen); | |||
| if (port) | |||
| if (port != nullptr) | |||
| break; | |||
| } | |||
| } | |||
| @@ -475,7 +463,7 @@ MidiOutput* MidiOutput::openDevice (int deviceIndex) | |||
| MidiOutput* newDevice = nullptr; | |||
| StringArray devices; | |||
| AlsaClient::Port* port = iterateMidiDevices (false, devices, deviceIndex); | |||
| auto* port = iterateMidiDevices (false, devices, deviceIndex); | |||
| if (port == nullptr) | |||
| return nullptr; | |||
| @@ -492,12 +480,9 @@ MidiOutput* MidiOutput::openDevice (int deviceIndex) | |||
| MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| { | |||
| MidiOutput* newDevice = nullptr; | |||
| const AlsaClient::Ptr client (AlsaClient::getInstance()); | |||
| AlsaClient::Port* port = client->createPort (deviceName, false, true); | |||
| jassert (port->isValid()); | |||
| auto client = AlsaClient::getInstance(); | |||
| auto* port = client->createPort (deviceName, false, true); | |||
| jassert (port != nullptr && port->isValid()); | |||
| newDevice = new MidiOutput (deviceName); | |||
| port->setupOutput(); | |||
| @@ -509,9 +494,7 @@ MidiOutput* MidiOutput::createNewDevice (const String& deviceName) | |||
| MidiOutput::~MidiOutput() | |||
| { | |||
| stopBackgroundThread(); | |||
| AlsaClient::Ptr client (AlsaClient::getInstance()); | |||
| client->deletePort (static_cast<AlsaClient::Port*> (internal)); | |||
| AlsaClient::getInstance()->deletePort (static_cast<AlsaClient::Port*> (internal)); | |||
| } | |||
| void MidiOutput::sendMessageNow (const MidiMessage& message) | |||
| @@ -528,8 +511,7 @@ MidiInput::MidiInput (const String& nm) | |||
| MidiInput::~MidiInput() | |||
| { | |||
| stop(); | |||
| AlsaClient::Ptr client (AlsaClient::getInstance()); | |||
| client->deletePort (static_cast<AlsaClient::Port*> (internal)); | |||
| AlsaClient::getInstance()->deletePort (static_cast<AlsaClient::Port*> (internal)); | |||
| } | |||
| void MidiInput::start() | |||
| @@ -559,7 +541,7 @@ MidiInput* MidiInput::openDevice (int deviceIndex, MidiInputCallback* callback) | |||
| MidiInput* newDevice = nullptr; | |||
| StringArray devices; | |||
| AlsaClient::Port* port = iterateMidiDevices (true, devices, deviceIndex); | |||
| auto* port = iterateMidiDevices (true, devices, deviceIndex); | |||
| if (port == nullptr) | |||
| return nullptr; | |||
| @@ -577,9 +559,8 @@ MidiInput* MidiInput::createNewDevice (const String& deviceName, MidiInputCallba | |||
| { | |||
| MidiInput* newDevice = nullptr; | |||
| AlsaClient::Ptr client (AlsaClient::getInstance()); | |||
| AlsaClient::Port* port = client->createPort (deviceName, true, true); | |||
| auto client = AlsaClient::getInstance(); | |||
| auto* port = client->createPort (deviceName, true, true); | |||
| jassert (port->isValid()); | |||
| @@ -23,7 +23,7 @@ | |||
| extern "C" | |||
| { | |||
| // Declare just the minimum number of interfaces for the DSound objects that we need.. | |||
| typedef struct typeDSBUFFERDESC | |||
| struct DSBUFFERDESC | |||
| { | |||
| DWORD dwSize; | |||
| DWORD dwFlags; | |||
| @@ -31,7 +31,7 @@ extern "C" | |||
| DWORD dwReserved; | |||
| LPWAVEFORMATEX lpwfxFormat; | |||
| GUID guid3DAlgorithm; | |||
| } DSBUFFERDESC; | |||
| }; | |||
| struct IDirectSoundBuffer; | |||
| @@ -80,14 +80,14 @@ extern "C" | |||
| }; | |||
| //============================================================================== | |||
| typedef struct typeDSCBUFFERDESC | |||
| struct DSCBUFFERDESC | |||
| { | |||
| DWORD dwSize; | |||
| DWORD dwFlags; | |||
| DWORD dwBufferBytes; | |||
| DWORD dwReserved; | |||
| LPWAVEFORMATEX lpwfxFormat; | |||
| } DSCBUFFERDESC; | |||
| }; | |||
| struct IDirectSoundCaptureBuffer; | |||
| @@ -256,8 +256,8 @@ protected: | |||
| template <class DestSampleType, class SourceSampleType, class SourceEndianness> | |||
| struct ReadHelper | |||
| { | |||
| typedef AudioData::Pointer<DestSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> DestType; | |||
| typedef AudioData::Pointer<SourceSampleType, SourceEndianness, AudioData::Interleaved, AudioData::Const> SourceType; | |||
| using DestType = AudioData::Pointer<DestSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst>; | |||
| using SourceType = AudioData::Pointer<SourceSampleType, SourceEndianness, AudioData::Interleaved, AudioData::Const>; | |||
| template <typename TargetType> | |||
| static void read (TargetType* const* destData, int destOffset, int numDestChannels, | |||
| @@ -268,8 +268,8 @@ protected: | |||
| template <class DestSampleType, class SourceSampleType, class DestEndianness> | |||
| struct WriteHelper | |||
| { | |||
| typedef AudioData::Pointer <DestSampleType, DestEndianness, AudioData::Interleaved, AudioData::NonConst> DestType; | |||
| typedef AudioData::Pointer <SourceSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> SourceType; | |||
| using DestType = AudioData::Pointer <DestSampleType, DestEndianness, AudioData::Interleaved, AudioData::NonConst>; | |||
| using SourceType = AudioData::Pointer <SourceSampleType, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const>; | |||
| static void write (void* destData, int numDestChannels, const int* const* source, | |||
| int numSamples, const int sourceOffset = 0) noexcept | |||
| @@ -102,7 +102,7 @@ protected: | |||
| template <typename SampleType, typename Endianness> | |||
| Range<float> scanMinAndMaxInterleaved (int channel, int64 startSampleInFile, int64 numSamples) const noexcept | |||
| { | |||
| typedef AudioData::Pointer <SampleType, Endianness, AudioData::Interleaved, AudioData::Const> SourceType; | |||
| using SourceType = AudioData::Pointer <SampleType, Endianness, AudioData::Interleaved, AudioData::Const>; | |||
| return SourceType (addBytesToPointer (sampleToPointer (startSampleInFile), ((int) bitsPerSample / 8) * channel), (int) numChannels) | |||
| .findMinAndMax ((size_t) numSamples); | |||
| @@ -99,7 +99,7 @@ struct AudioProcessorHolder : public ReferenceCountedObject | |||
| std::unique_ptr<ViewConfig> viewConfiguration; | |||
| typedef ReferenceCountedObjectPtr<AudioProcessorHolder> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<AudioProcessorHolder>; | |||
| private: | |||
| std::unique_ptr<AudioProcessor> processor; | |||
| @@ -58,7 +58,7 @@ public: | |||
| close(); | |||
| } | |||
| typedef ReferenceCountedObjectPtr<LADSPAModuleHandle> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<LADSPAModuleHandle>; | |||
| static Array<LADSPAModuleHandle*>& getActiveModules() | |||
| { | |||
| @@ -577,8 +577,8 @@ private: | |||
| template <typename FloatType> | |||
| struct VST3BufferExchange | |||
| { | |||
| typedef Array<FloatType*> Bus; | |||
| typedef Array<Bus> BusMap; | |||
| using Bus = Array<FloatType*>; | |||
| using BusMap = Array<Bus>; | |||
| static inline void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, float** raw) { vstBuffers.channelBuffers32 = raw; } | |||
| static inline void assignRawPointer (Steinberg::Vst::AudioBusBuffers& vstBuffers, double** raw) { vstBuffers.channelBuffers64 = raw; } | |||
| @@ -648,7 +648,7 @@ private: | |||
| Atomic<int> refCount; | |||
| String appName; | |||
| typedef std::map<Vst::ParamID, int> ParamMapType; | |||
| using ParamMapType = std::map<Vst::ParamID, int>; | |||
| ParamMapType paramToIndexMap; | |||
| int getIndexOfParamID (Vst::ParamID paramID) | |||
| @@ -1219,7 +1219,7 @@ struct VST3ModuleHandle : public ReferenceCountedObject | |||
| } | |||
| //============================================================================== | |||
| typedef ReferenceCountedObjectPtr<VST3ModuleHandle> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<VST3ModuleHandle>; | |||
| static VST3ModuleHandle::Ptr findOrCreateModule (const File& file, const PluginDescription& description) | |||
| { | |||
| @@ -1451,13 +1451,13 @@ private: | |||
| ChildComponent embeddedComponent; | |||
| std::unique_ptr<ComponentPeer> peer; | |||
| typedef HWND HandleFormat; | |||
| using HandleFormat = HWND; | |||
| #elif JUCE_MAC | |||
| AutoResizingNSViewComponentWithParent embeddedComponent; | |||
| typedef NSView* HandleFormat; | |||
| using HandleFormat = NSView*; | |||
| #else | |||
| Component embeddedComponent; | |||
| typedef void* HandleFormat; | |||
| using HandleFormat = void*; | |||
| #endif | |||
| HandleFormat pluginHandle = {}; | |||
| @@ -580,7 +580,7 @@ struct ModuleHandle : public ReferenceCountedObject | |||
| String pluginName; | |||
| std::unique_ptr<XmlElement> vstXml; | |||
| typedef ReferenceCountedObjectPtr<ModuleHandle> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<ModuleHandle>; | |||
| static Array<ModuleHandle*>& getActiveModules() | |||
| { | |||
| @@ -82,10 +82,10 @@ static inline bool arrayContainsPlugin (const OwnedArray<PluginDescription>& lis | |||
| #if JUCE_IOS | |||
| #define JUCE_IOS_MAC_VIEW UIView | |||
| typedef UIViewComponent ViewComponentBaseClass; | |||
| using ViewComponentBaseClass = UIViewComponent; | |||
| #else | |||
| #define JUCE_IOS_MAC_VIEW NSView | |||
| typedef NSViewComponent ViewComponentBaseClass; | |||
| using ViewComponentBaseClass = NSViewComponent; | |||
| #endif | |||
| //============================================================================== | |||
| @@ -348,7 +348,7 @@ struct RenderSequenceBuilder | |||
| } | |||
| //============================================================================== | |||
| typedef AudioProcessorGraph::NodeID NodeID; | |||
| using NodeID = AudioProcessorGraph::NodeID; | |||
| AudioProcessorGraph& graph; | |||
| RenderSequence& sequence; | |||
| @@ -58,7 +58,7 @@ public: | |||
| ~AudioProcessorGraph(); | |||
| /** Each node in the graph has a UID of this type. */ | |||
| typedef uint32 NodeID; | |||
| using NodeID = uint32; | |||
| //============================================================================== | |||
| /** A special index that represents the midi channel of a node. | |||
| @@ -117,7 +117,7 @@ public: | |||
| //============================================================================== | |||
| /** A convenient typedef for referring to a pointer to a node object. */ | |||
| typedef ReferenceCountedObjectPtr<Node> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<Node>; | |||
| private: | |||
| //============================================================================== | |||
| @@ -47,13 +47,12 @@ | |||
| #include <cstdarg> | |||
| typedef juce::int8 int8; | |||
| typedef juce::int16 int16; | |||
| typedef juce::int32 int32; | |||
| typedef juce::uint8 uint8; | |||
| typedef juce::uint16 uint16; | |||
| typedef juce::uint32 uint32; | |||
| using int8 = juce::int8; | |||
| using int16 = juce::int16; | |||
| using int32 = juce::int32; | |||
| using uint8 = juce::uint8; | |||
| using uint16 = juce::uint16; | |||
| using uint32 = juce::uint32; | |||
| #include "box2d/Collision/b2BroadPhase.cpp" | |||
| #include "box2d/Collision/b2CollideCircle.cpp" | |||
| @@ -55,7 +55,7 @@ template <typename ElementType, | |||
| class Array | |||
| { | |||
| private: | |||
| typedef typename TypeHelpers::ParameterType<ElementType>::type ParameterType; | |||
| using ParameterType = typename TypeHelpers::ParameterType<ElementType>::type; | |||
| public: | |||
| //============================================================================== | |||
| @@ -1235,7 +1235,7 @@ public: | |||
| inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return data; } | |||
| /** Returns the type of scoped lock to use for locking this array */ | |||
| typedef typename TypeOfCriticalSectionToUse::ScopedLockType ScopedLockType; | |||
| using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType; | |||
| //============================================================================== | |||
| @@ -44,7 +44,7 @@ public: | |||
| DynamicObject (const DynamicObject&); | |||
| ~DynamicObject(); | |||
| typedef ReferenceCountedObjectPtr<DynamicObject> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<DynamicObject>; | |||
| //============================================================================== | |||
| /** Returns true if the object has a property with this name. | |||
| @@ -185,7 +185,7 @@ template <class ElementType> | |||
| class DefaultElementComparator | |||
| { | |||
| private: | |||
| typedef typename TypeHelpers::ParameterType<ElementType>::type ParameterType; | |||
| using ParameterType = typename TypeHelpers::ParameterType<ElementType>::type; | |||
| public: | |||
| static int compareElements (ParameterType first, ParameterType second) | |||
| @@ -46,7 +46,7 @@ struct DefaultHashFunctions | |||
| /** Generates a simple hash from a variant. */ | |||
| static int generateHash (const var& key, int upperLimit) noexcept { return generateHash (key.toString(), upperLimit); } | |||
| /** Generates a simple hash from a void ptr. */ | |||
| static int generateHash (const void* key, int upperLimit) noexcept { return generateHash ((pointer_sized_uint) key, upperLimit); } | |||
| static int generateHash (const void* key, int upperLimit) noexcept { return generateHash ((uint64) (pointer_sized_uint) key, upperLimit); } | |||
| /** Generates a simple hash from a UUID. */ | |||
| static int generateHash (const Uuid& key, int upperLimit) noexcept { return generateHash (key.hash(), upperLimit); } | |||
| }; | |||
| @@ -103,8 +103,8 @@ template <typename KeyType, | |||
| class HashMap | |||
| { | |||
| private: | |||
| typedef typename TypeHelpers::ParameterType<KeyType>::type KeyTypeParameter; | |||
| typedef typename TypeHelpers::ParameterType<ValueType>::type ValueTypeParameter; | |||
| using KeyTypeParameter = typename TypeHelpers::ParameterType<KeyType>::type; | |||
| using ValueTypeParameter = typename TypeHelpers::ParameterType<ValueType>::type; | |||
| public: | |||
| //============================================================================== | |||
| @@ -182,8 +182,8 @@ public: | |||
| bool shouldBailOut() const noexcept { return false; } | |||
| }; | |||
| typedef ListenerList<ListenerClass, ArrayType> ThisType; | |||
| typedef ListenerClass ListenerType; | |||
| using ThisType = ListenerList<ListenerClass, ArrayType>; | |||
| using ListenerType = ListenerClass; | |||
| //============================================================================== | |||
| /** Iterates the listeners in a ListenerList. */ | |||
| @@ -893,7 +893,7 @@ public: | |||
| inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return data; } | |||
| /** Returns the type of scoped lock to use for locking this array */ | |||
| typedef typename TypeOfCriticalSectionToUse::ScopedLockType ScopedLockType; | |||
| using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType; | |||
| //============================================================================== | |||
| @@ -50,7 +50,7 @@ template <class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSec | |||
| class ReferenceCountedArray | |||
| { | |||
| public: | |||
| typedef ReferenceCountedObjectPtr<ObjectClass> ObjectClassPtr; | |||
| using ObjectClassPtr = ReferenceCountedObjectPtr<ObjectClass>; | |||
| //============================================================================== | |||
| /** Creates an empty array. | |||
| @@ -880,7 +880,7 @@ public: | |||
| inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return data; } | |||
| /** Returns the type of scoped lock to use for locking this array */ | |||
| typedef typename TypeOfCriticalSectionToUse::ScopedLockType ScopedLockType; | |||
| using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType; | |||
| //============================================================================== | |||
| @@ -473,7 +473,7 @@ public: | |||
| inline const TypeOfCriticalSectionToUse& getLock() const noexcept { return data.getLock(); } | |||
| /** Returns the type of scoped lock to use for locking this array */ | |||
| typedef typename TypeOfCriticalSectionToUse::ScopedLockType ScopedLockType; | |||
| using ScopedLockType = typename TypeOfCriticalSectionToUse::ScopedLockType; | |||
| private: | |||
| @@ -75,8 +75,8 @@ struct JavascriptEngine::RootObject : public DynamicObject | |||
| Time timeout; | |||
| typedef const var::NativeFunctionArgs& Args; | |||
| typedef const char* TokenType; | |||
| using Args = const var::NativeFunctionArgs&; | |||
| using TokenType = const char*; | |||
| void execute (const String& code) | |||
| { | |||
| @@ -263,7 +263,7 @@ struct JavascriptEngine::RootObject : public DynamicObject | |||
| ResultCode perform (const Scope& s, var*) const override { getResult (s); return ok; } | |||
| }; | |||
| typedef std::unique_ptr<Expression> ExpPtr; | |||
| using ExpPtr = std::unique_ptr<Expression>; | |||
| struct BlockStatement : public Statement | |||
| { | |||
| @@ -80,9 +80,9 @@ private: | |||
| //============================================================================== | |||
| struct Expression::Helpers | |||
| { | |||
| typedef ReferenceCountedObjectPtr<Term> TermPtr; | |||
| using TermPtr = ReferenceCountedObjectPtr<Term>; | |||
| static void checkRecursionDepth (const int depth) | |||
| static void checkRecursionDepth (int depth) | |||
| { | |||
| if (depth > 256) | |||
| throw EvaluationError ("Recursive symbol references"); | |||
| @@ -32,28 +32,28 @@ namespace juce | |||
| // Definitions for the int8, int16, int32, int64 and pointer_sized_int types. | |||
| /** A platform-independent 8-bit signed integer type. */ | |||
| typedef signed char int8; | |||
| using int8 = signed char; | |||
| /** A platform-independent 8-bit unsigned integer type. */ | |||
| typedef unsigned char uint8; | |||
| using uint8 = unsigned char; | |||
| /** A platform-independent 16-bit signed integer type. */ | |||
| typedef signed short int16; | |||
| using int16 = signed short; | |||
| /** A platform-independent 16-bit unsigned integer type. */ | |||
| typedef unsigned short uint16; | |||
| using uint16 = unsigned short; | |||
| /** A platform-independent 32-bit signed integer type. */ | |||
| typedef signed int int32; | |||
| using int32 = signed int; | |||
| /** A platform-independent 32-bit unsigned integer type. */ | |||
| typedef unsigned int uint32; | |||
| #if JUCE_MSVC | |||
| /** A platform-independent 64-bit integer type. */ | |||
| typedef __int64 int64; | |||
| using int64 = __int64; | |||
| /** A platform-independent 64-bit unsigned integer type. */ | |||
| typedef unsigned __int64 uint64; | |||
| using uint64 = unsigned __int64; | |||
| #else | |||
| /** A platform-independent 64-bit integer type. */ | |||
| typedef long long int64; | |||
| using int64 = long long; | |||
| /** A platform-independent 64-bit unsigned integer type. */ | |||
| typedef unsigned long long uint64; | |||
| using uint64 = unsigned long long; | |||
| #endif | |||
| #ifndef DOXYGEN | |||
| @@ -67,23 +67,23 @@ typedef unsigned int uint32; | |||
| #if JUCE_64BIT | |||
| /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef int64 pointer_sized_int; | |||
| using pointer_sized_int = int64; | |||
| /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef uint64 pointer_sized_uint; | |||
| using pointer_sized_uint = uint64; | |||
| #elif JUCE_MSVC | |||
| /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef _W64 int pointer_sized_int; | |||
| using pointer_sized_int = _W64 int; | |||
| /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef _W64 unsigned int pointer_sized_uint; | |||
| using pointer_sized_uint = _W64 unsigned int; | |||
| #else | |||
| /** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef int pointer_sized_int; | |||
| using pointer_sized_int = int; | |||
| /** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */ | |||
| typedef unsigned int pointer_sized_uint; | |||
| using pointer_sized_uint = unsigned int; | |||
| #endif | |||
| #if JUCE_WINDOWS && ! JUCE_MINGW | |||
| typedef pointer_sized_int ssize_t; | |||
| using ssize_t = pointer_sized_int; | |||
| #endif | |||
| //============================================================================== | |||
| @@ -627,24 +627,24 @@ namespace TypeHelpers | |||
| @tags{Core} | |||
| */ | |||
| template <typename Type> struct ParameterType { typedef const Type& type; }; | |||
| template <typename Type> struct ParameterType { using type = const Type&; }; | |||
| #if ! DOXYGEN | |||
| template <typename Type> struct ParameterType <Type&> { typedef Type& type; }; | |||
| template <typename Type> struct ParameterType <Type*> { typedef Type* type; }; | |||
| template <> struct ParameterType <char> { typedef char type; }; | |||
| template <> struct ParameterType <unsigned char> { typedef unsigned char type; }; | |||
| template <> struct ParameterType <short> { typedef short type; }; | |||
| template <> struct ParameterType <unsigned short> { typedef unsigned short type; }; | |||
| template <> struct ParameterType <int> { typedef int type; }; | |||
| template <> struct ParameterType <unsigned int> { typedef unsigned int type; }; | |||
| template <> struct ParameterType <long> { typedef long type; }; | |||
| template <> struct ParameterType <unsigned long> { typedef unsigned long type; }; | |||
| template <> struct ParameterType <int64> { typedef int64 type; }; | |||
| template <> struct ParameterType <uint64> { typedef uint64 type; }; | |||
| template <> struct ParameterType <bool> { typedef bool type; }; | |||
| template <> struct ParameterType <float> { typedef float type; }; | |||
| template <> struct ParameterType <double> { typedef double type; }; | |||
| template <typename Type> struct ParameterType <Type&> { using type = Type&; }; | |||
| template <typename Type> struct ParameterType <Type*> { using type = Type*; }; | |||
| template <> struct ParameterType <char> { using type = char; }; | |||
| template <> struct ParameterType <unsigned char> { using type = unsigned char; }; | |||
| template <> struct ParameterType <short> { using type = short; }; | |||
| template <> struct ParameterType <unsigned short> { using type = unsigned short; }; | |||
| template <> struct ParameterType <int> { using type = int; }; | |||
| template <> struct ParameterType <unsigned int> { using type = unsigned int; }; | |||
| template <> struct ParameterType <long> { using type = long; }; | |||
| template <> struct ParameterType <unsigned long> { using type = unsigned long; }; | |||
| template <> struct ParameterType <int64> { using type = int64; }; | |||
| template <> struct ParameterType <uint64> { using type = uint64; }; | |||
| template <> struct ParameterType <bool> { using type = bool; }; | |||
| template <> struct ParameterType <float> { using type = float; }; | |||
| template <> struct ParameterType <double> { using type = double; }; | |||
| #endif | |||
| /** These templates are designed to take a type, and if it's a double, they return a double | |||
| @@ -652,10 +652,10 @@ namespace TypeHelpers | |||
| @tags{Core} | |||
| */ | |||
| template <typename Type> struct SmallestFloatType { typedef float type; }; | |||
| template <typename Type> struct SmallestFloatType { using type = float; }; | |||
| #if ! DOXYGEN | |||
| template <> struct SmallestFloatType <double> { typedef double type; }; | |||
| template <> struct SmallestFloatType <double> { using type = double; }; | |||
| #endif | |||
| /** These templates are designed to take an integer type, and return an unsigned int | |||
| @@ -666,10 +666,10 @@ namespace TypeHelpers | |||
| template <int bytes> struct UnsignedTypeWithSize {}; | |||
| #if ! DOXYGEN | |||
| template <> struct UnsignedTypeWithSize<1> { typedef uint8 type; }; | |||
| template <> struct UnsignedTypeWithSize<2> { typedef uint16 type; }; | |||
| template <> struct UnsignedTypeWithSize<4> { typedef uint32 type; }; | |||
| template <> struct UnsignedTypeWithSize<8> { typedef uint64 type; }; | |||
| template <> struct UnsignedTypeWithSize<1> { using type = uint8; }; | |||
| template <> struct UnsignedTypeWithSize<2> { using type = uint16; }; | |||
| template <> struct UnsignedTypeWithSize<4> { using type = uint32; }; | |||
| template <> struct UnsignedTypeWithSize<8> { using type = uint64; }; | |||
| #endif | |||
| } | |||
| @@ -274,7 +274,8 @@ private: | |||
| return clampedValue; | |||
| } | |||
| typedef std::function<ValueType(ValueType, ValueType, ValueType)> ConverstionFunction; | |||
| using ConverstionFunction = std::function<ValueType(ValueType, ValueType, ValueType)>; | |||
| ConverstionFunction convertFrom0To1Function = {}, | |||
| convertTo0To1Function = {}, | |||
| snapToLegalValueFunction = {}; | |||
| @@ -26,8 +26,8 @@ namespace juce | |||
| #ifndef DOXYGEN | |||
| namespace AtomicHelpers | |||
| { | |||
| template <typename T> struct DiffTypeHelper { typedef T Type; }; | |||
| template <typename T> struct DiffTypeHelper<T*> { typedef std::ptrdiff_t Type; }; | |||
| template <typename T> struct DiffTypeHelper { using Type = T; }; | |||
| template <typename T> struct DiffTypeHelper<T*> { using Type = std::ptrdiff_t; }; | |||
| } | |||
| #endif | |||
| @@ -37,7 +37,7 @@ namespace juce | |||
| // This is a neat way of declaring a typedef for a pointer class, | |||
| // rather than typing out the full templated name each time.. | |||
| typedef ReferenceCountedObjectPtr<MyClass> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<MyClass>; | |||
| }; | |||
| MyClass::Ptr p = new MyClass(); | |||
| @@ -228,7 +228,7 @@ private: | |||
| @code | |||
| struct MyClass : public ReferenceCountedObject | |||
| { | |||
| typedef ReferenceCountedObjectPtr<MyClass> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<MyClass>; | |||
| ... | |||
| } | |||
| @endcode | |||
| @@ -242,7 +242,7 @@ class ReferenceCountedObjectPtr | |||
| { | |||
| public: | |||
| /** The class being referenced by this pointer. */ | |||
| typedef ObjectType ReferencedType; | |||
| using ReferencedType = ObjectType; | |||
| //============================================================================== | |||
| /** Creates a pointer to a null object. */ | |||
| @@ -37,7 +37,7 @@ namespace juce | |||
| class CharPointer_ASCII final | |||
| { | |||
| public: | |||
| typedef char CharType; | |||
| using CharType = char; | |||
| inline explicit CharPointer_ASCII (const CharType* rawPointer) noexcept | |||
| : data (const_cast<CharType*> (rawPointer)) | |||
| @@ -35,9 +35,9 @@ class CharPointer_UTF16 final | |||
| { | |||
| public: | |||
| #if JUCE_NATIVE_WCHAR_IS_UTF16 | |||
| typedef wchar_t CharType; | |||
| using CharType = wchar_t; | |||
| #else | |||
| typedef int16 CharType; | |||
| using CharType = int16; | |||
| #endif | |||
| inline explicit CharPointer_UTF16 (const CharType* rawPointer) noexcept | |||
| @@ -34,7 +34,7 @@ namespace juce | |||
| class CharPointer_UTF32 final | |||
| { | |||
| public: | |||
| typedef juce_wchar CharType; | |||
| using CharType = juce_wchar; | |||
| inline explicit CharPointer_UTF32 (const CharType* rawPointer) noexcept | |||
| : data (const_cast<CharType*> (rawPointer)) | |||
| @@ -34,7 +34,7 @@ namespace juce | |||
| class CharPointer_UTF8 final | |||
| { | |||
| public: | |||
| typedef char CharType; | |||
| using CharType = char; | |||
| inline explicit CharPointer_UTF8 (const CharType* rawPointer) noexcept | |||
| : data (const_cast<CharType*> (rawPointer)) | |||
| @@ -122,9 +122,9 @@ public: | |||
| if (n < 0) | |||
| { | |||
| juce_wchar bit = 0x40; | |||
| uint8 bit = 0x40; | |||
| while ((static_cast<juce_wchar> (n) & bit) != 0 && bit > 0x8) | |||
| while ((static_cast<uint8> (n) & bit) != 0 && bit > 0x8) | |||
| { | |||
| ++data; | |||
| bit >>= 1; | |||
| @@ -39,9 +39,9 @@ namespace juce | |||
| #if JUCE_NATIVE_WCHAR_IS_UTF32 || DOXYGEN | |||
| /** A platform-independent 32-bit unicode character type. */ | |||
| typedef wchar_t juce_wchar; | |||
| using juce_wchar = wchar_t; | |||
| #else | |||
| typedef uint32 juce_wchar; | |||
| using juce_wchar = uint32; | |||
| #endif | |||
| #ifndef DOXYGEN | |||
| @@ -66,13 +66,13 @@ namespace juce | |||
| // GNU libstdc++ does not have std::make_unsigned | |||
| namespace internal | |||
| { | |||
| template <typename Type> struct make_unsigned { typedef Type type; }; | |||
| template <> struct make_unsigned<signed char> { typedef unsigned char type; }; | |||
| template <> struct make_unsigned<char> { typedef unsigned char type; }; | |||
| template <> struct make_unsigned<short> { typedef unsigned short type; }; | |||
| template <> struct make_unsigned<int> { typedef unsigned int type; }; | |||
| template <> struct make_unsigned<long> { typedef unsigned long type; }; | |||
| template <> struct make_unsigned<long long> { typedef unsigned long long type; }; | |||
| template <typename Type> struct make_unsigned { using type = Type; }; | |||
| template <> struct make_unsigned<signed char> { using type = unsigned char; }; | |||
| template <> struct make_unsigned<char> { using type = unsigned char; }; | |||
| template <> struct make_unsigned<short> { using type = unsigned short; }; | |||
| template <> struct make_unsigned<int> { using type = unsigned int; }; | |||
| template <> struct make_unsigned<long> { using type = unsigned long; }; | |||
| template <> struct make_unsigned<long long> { using type = unsigned long long; }; | |||
| } | |||
| #endif | |||
| @@ -383,7 +383,7 @@ public: | |||
| template <typename IntType, typename CharPointerType> | |||
| static IntType getIntValue (const CharPointerType text) noexcept | |||
| { | |||
| typedef typename internal::make_unsigned<IntType>::type UIntType; | |||
| using UIntType = typename internal::make_unsigned<IntType>::type; | |||
| UIntType v = 0; | |||
| auto s = text.findEndOfWhitespace(); | |||
| @@ -35,11 +35,11 @@ NewLine newLine; | |||
| #endif | |||
| #if JUCE_NATIVE_WCHAR_IS_UTF8 | |||
| typedef CharPointer_UTF8 CharPointer_wchar_t; | |||
| using CharPointer_wchar_t = CharPointer_UTF8; | |||
| #elif JUCE_NATIVE_WCHAR_IS_UTF16 | |||
| typedef CharPointer_UTF16 CharPointer_wchar_t; | |||
| using CharPointer_wchar_t = CharPointer_UTF16; | |||
| #else | |||
| typedef CharPointer_UTF32 CharPointer_wchar_t; | |||
| using CharPointer_wchar_t = CharPointer_UTF32; | |||
| #endif | |||
| static inline CharPointer_wchar_t castToCharPointer_wchar_t (const void* t) noexcept | |||
| @@ -64,8 +64,8 @@ class StringHolder | |||
| public: | |||
| StringHolder() = delete; | |||
| typedef String::CharPointerType CharPointerType; | |||
| typedef String::CharPointerType::CharType CharType; | |||
| using CharPointerType = String::CharPointerType; | |||
| using CharType = String::CharPointerType::CharType; | |||
| //============================================================================== | |||
| static CharPointerType createUninitialisedBytes (size_t numBytes) | |||
| @@ -768,13 +768,13 @@ void String::appendCharPointer (const CharPointerType startOfTextToAppend, | |||
| } | |||
| } | |||
| String& String::operator+= (const wchar_t* const t) | |||
| String& String::operator+= (const wchar_t* t) | |||
| { | |||
| appendCharPointer (castToCharPointer_wchar_t (t)); | |||
| return *this; | |||
| } | |||
| String& String::operator+= (const char* const t) | |||
| String& String::operator+= (const char* t) | |||
| { | |||
| appendCharPointer (CharPointer_UTF8 (t)); // (using UTF8 here triggers a faster code-path than ascii) | |||
| return *this; | |||
| @@ -797,20 +797,20 @@ String& String::operator+= (StringRef other) | |||
| return operator+= (String (other)); | |||
| } | |||
| String& String::operator+= (const char ch) | |||
| String& String::operator+= (char ch) | |||
| { | |||
| const char asString[] = { ch, 0 }; | |||
| return operator+= (asString); | |||
| } | |||
| String& String::operator+= (const wchar_t ch) | |||
| String& String::operator+= (wchar_t ch) | |||
| { | |||
| const wchar_t asString[] = { ch, 0 }; | |||
| return operator+= (asString); | |||
| } | |||
| #if ! JUCE_NATIVE_WCHAR_IS_UTF32 | |||
| String& String::operator+= (const juce_wchar ch) | |||
| String& String::operator+= (juce_wchar ch) | |||
| { | |||
| const juce_wchar asString[] = { ch, 0 }; | |||
| appendCharPointer (CharPointer_UTF32 (asString)); | |||
| @@ -842,42 +842,42 @@ String& String::operator+= (const int64 number) { return StringHelpers::o | |||
| String& String::operator+= (const uint64 number) { return StringHelpers::operationAddAssign<uint64> (*this, number); } | |||
| //============================================================================== | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const char* const s1, const String& s2) { String s (s1); return s += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const wchar_t* const s1, const String& s2) { String s (s1); return s += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const char* s1, const String& s2) { String s (s1); return s += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const wchar_t* s1, const String& s2) { String s (s1); return s += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const char s1, const String& s2) { return String::charToString ((juce_wchar) (uint8) s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const wchar_t s1, const String& s2) { return String::charToString (s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (char s1, const String& s2) { return String::charToString ((juce_wchar) (uint8) s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (wchar_t s1, const String& s2) { return String::charToString (s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const String& s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const char* const s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const wchar_t* s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const String& s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const char* s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const wchar_t* s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const char s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const wchar_t s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, char s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, wchar_t s2) { return s1 += s2; } | |||
| #if ! JUCE_NATIVE_WCHAR_IS_UTF32 | |||
| JUCE_API String JUCE_CALLTYPE operator+ (const juce_wchar s1, const String& s2) { return String::charToString (s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, const juce_wchar s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const juce_wchar s2) { return s1 += s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (juce_wchar s1, const String& s2) { return String::charToString (s1) + s2; } | |||
| JUCE_API String JUCE_CALLTYPE operator+ (String s1, juce_wchar s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, juce_wchar s2) { return s1 += s2; } | |||
| #endif | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const char s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const wchar_t s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, char s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, wchar_t s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const char* const s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const wchar_t* const s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const String& s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, StringRef s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const char* s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const wchar_t* s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const String& s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, StringRef s2) { return s1 += s2; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, uint8 number) { return s1 += (int) number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const short number) { return s1 += (int) number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const int number) { return s1 += number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const long number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const unsigned long number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const int64 number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const uint64 number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const float number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, const double number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, uint8 number) { return s1 += (int) number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, short number) { return s1 += (int) number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, int number) { return s1 += number; } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, long number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, unsigned long number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, int64 number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, uint64 number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, float number) { return s1 += String (number); } | |||
| JUCE_API String& JUCE_CALLTYPE operator<< (String& s1, double number) { return s1 += String (number); } | |||
| JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, const String& text) | |||
| { | |||
| @@ -902,12 +902,12 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, StringRef | |||
| } | |||
| //============================================================================== | |||
| int String::indexOfChar (const juce_wchar character) const noexcept | |||
| int String::indexOfChar (juce_wchar character) const noexcept | |||
| { | |||
| return text.indexOf (character); | |||
| } | |||
| int String::indexOfChar (const int startIndex, const juce_wchar character) const noexcept | |||
| int String::indexOfChar (int startIndex, juce_wchar character) const noexcept | |||
| { | |||
| auto t = text; | |||
| @@ -927,7 +927,7 @@ int String::indexOfChar (const int startIndex, const juce_wchar character) const | |||
| return -1; | |||
| } | |||
| int String::lastIndexOfChar (const juce_wchar character) const noexcept | |||
| int String::lastIndexOfChar (juce_wchar character) const noexcept | |||
| { | |||
| auto t = text; | |||
| int last = -1; | |||
| @@ -939,7 +939,7 @@ int String::lastIndexOfChar (const juce_wchar character) const noexcept | |||
| return last; | |||
| } | |||
| int String::indexOfAnyOf (StringRef charactersToLookFor, const int startIndex, const bool ignoreCase) const noexcept | |||
| int String::indexOfAnyOf (StringRef charactersToLookFor, int startIndex, bool ignoreCase) const noexcept | |||
| { | |||
| auto t = text; | |||
| @@ -969,7 +969,7 @@ int String::indexOfIgnoreCase (StringRef other) const noexcept | |||
| return other.isEmpty() ? 0 : CharacterFunctions::indexOfIgnoreCase (text, other.text); | |||
| } | |||
| int String::indexOf (const int startIndex, StringRef other) const noexcept | |||
| int String::indexOf (int startIndex, StringRef other) const noexcept | |||
| { | |||
| if (other.isEmpty()) | |||
| return -1; | |||
| @@ -52,7 +52,7 @@ struct CurrentThreadHolder : public ReferenceCountedObject | |||
| { | |||
| CurrentThreadHolder() noexcept {} | |||
| typedef ReferenceCountedObjectPtr<CurrentThreadHolder> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<CurrentThreadHolder>; | |||
| ThreadLocalValue<Thread*> value; | |||
| JUCE_DECLARE_NON_COPYABLE (CurrentThreadHolder) | |||
| @@ -239,7 +239,7 @@ private: | |||
| Options options; | |||
| bool loadedOk = false, needsWriting = false; | |||
| typedef const std::unique_ptr<InterProcessLock::ScopedLockType> ProcessScopedLock; | |||
| using ProcessScopedLock = const std::unique_ptr<InterProcessLock::ScopedLockType>; | |||
| InterProcessLock::ScopedLockType* createProcessLock() const; | |||
| void timerCallback() override; | |||
| @@ -30,7 +30,7 @@ namespace juce | |||
| class ValueTree::SharedObject : public ReferenceCountedObject | |||
| { | |||
| public: | |||
| typedef ReferenceCountedObjectPtr<SharedObject> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<SharedObject>; | |||
| explicit SharedObject (const Identifier& t) noexcept : type (t) {} | |||
| @@ -64,36 +64,36 @@ struct SIMDRegister | |||
| { | |||
| //============================================================================== | |||
| /** The type that represents the individual constituents of the SIMD Register */ | |||
| typedef Type ElementType; | |||
| using ElementType = Type; | |||
| /** STL compatible value_type definition (same as ElementType). */ | |||
| typedef ElementType value_type; | |||
| using value_type = ElementType; | |||
| /** The corresponding primitive integer type, for example, this will be int32_t | |||
| if type is a float. */ | |||
| typedef typename SIMDInternal::MaskTypeFor<ElementType>::type MaskType; | |||
| using MaskType = typename SIMDInternal::MaskTypeFor<ElementType>::type; | |||
| //============================================================================== | |||
| // Here are some types which are needed internally | |||
| /** The native primitive type (used internally). */ | |||
| typedef typename SIMDInternal::PrimitiveType<ElementType>::type PrimitiveType; | |||
| using PrimitiveType = typename SIMDInternal::PrimitiveType<ElementType>::type; | |||
| /** The native operations for this platform and type combination (used internally) */ | |||
| typedef SIMDNativeOps<PrimitiveType> NativeOps; | |||
| using NativeOps = SIMDNativeOps<PrimitiveType>; | |||
| /** The native type (used internally). */ | |||
| typedef typename NativeOps::vSIMDType vSIMDType; | |||
| using vSIMDType = typename NativeOps::vSIMDType; | |||
| /** The corresponding integer SIMDRegister type (used internally). */ | |||
| typedef SIMDRegister<MaskType> vMaskType; | |||
| using vMaskType = SIMDRegister<MaskType>; | |||
| /** The internal native type for the corresponding mask type (used internally). */ | |||
| typedef typename vMaskType::vSIMDType vMaskSIMDType; | |||
| using vMaskSIMDType = typename vMaskType::vSIMDType; | |||
| /** Wrapper for operations which need to be handled differently for complex | |||
| and scalar types (used internally). */ | |||
| typedef CmplxSIMDOps<ElementType> CmplxOps; | |||
| using CmplxOps = CmplxSIMDOps<ElementType>; | |||
| /** Type which is returned when using the subscript operator. The returned type | |||
| should be used just like the type ElementType. */ | |||
| @@ -63,7 +63,7 @@ struct SIMDNativeOps; | |||
| template <> | |||
| struct SIMDNativeOps<float> | |||
| { | |||
| typedef __m256 vSIMDType; | |||
| using vSIMDType = __m256; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -133,7 +133,7 @@ struct SIMDNativeOps<float> | |||
| template <> | |||
| struct SIMDNativeOps<double> | |||
| { | |||
| typedef __m256d vSIMDType; | |||
| using vSIMDType = __m256d; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int64_t, kAllBitsSet); | |||
| @@ -200,7 +200,7 @@ struct SIMDNativeOps<double> | |||
| template <> | |||
| struct SIMDNativeOps<int8_t> | |||
| { | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int8_t, kAllBitsSet); | |||
| @@ -273,7 +273,7 @@ template <> | |||
| struct SIMDNativeOps<uint8_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (uint8_t, kHighBit); | |||
| @@ -348,7 +348,7 @@ template <> | |||
| struct SIMDNativeOps<int16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int16_t, kAllBitsSet); | |||
| @@ -403,7 +403,7 @@ template <> | |||
| struct SIMDNativeOps<uint16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (uint16_t, kHighBit); | |||
| @@ -461,7 +461,7 @@ template <> | |||
| struct SIMDNativeOps<int32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -514,7 +514,7 @@ template <> | |||
| struct SIMDNativeOps<uint32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (uint32_t, kAllBitsSet); | |||
| @@ -570,7 +570,7 @@ template <> | |||
| struct SIMDNativeOps<int64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (int64_t, kAllBitsSet); | |||
| @@ -608,7 +608,7 @@ template <> | |||
| struct SIMDNativeOps<uint64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m256i vSIMDType; | |||
| using vSIMDType = __m256i; | |||
| //============================================================================== | |||
| DECLARE_AVX_SIMD_CONST (uint64_t, kAllBitsSet); | |||
| @@ -32,19 +32,19 @@ namespace dsp | |||
| /** A template specialisation to find corresponding mask type for primitives. */ | |||
| namespace SIMDInternal | |||
| { | |||
| template <typename Primitive> struct MaskTypeFor { typedef Primitive type; }; | |||
| template <> struct MaskTypeFor <float> { typedef uint32_t type; }; | |||
| template <> struct MaskTypeFor <double> { typedef uint64_t type; }; | |||
| template <> struct MaskTypeFor <char> { typedef uint8_t type; }; | |||
| template <> struct MaskTypeFor <int8_t> { typedef uint8_t type; }; | |||
| template <> struct MaskTypeFor <int16_t> { typedef uint16_t type; }; | |||
| template <> struct MaskTypeFor <int32_t> { typedef uint32_t type; }; | |||
| template <> struct MaskTypeFor <int64_t> { typedef uint64_t type; }; | |||
| template <> struct MaskTypeFor <std::complex<float>> { typedef uint32_t type; }; | |||
| template <> struct MaskTypeFor <std::complex<double>> { typedef uint64_t type; }; | |||
| template <typename Primitive> struct PrimitiveType { typedef Primitive type; }; | |||
| template <typename Primitive> struct PrimitiveType<std::complex<Primitive>> { typedef Primitive type; }; | |||
| template <typename Primitive> struct MaskTypeFor { using type = Primitive; }; | |||
| template <> struct MaskTypeFor <float> { using type = uint32_t; }; | |||
| template <> struct MaskTypeFor <double> { using type = uint64_t; }; | |||
| template <> struct MaskTypeFor <char> { using type = uint8_t; }; | |||
| template <> struct MaskTypeFor <int8_t> { using type = uint8_t; }; | |||
| template <> struct MaskTypeFor <int16_t> { using type = uint16_t; }; | |||
| template <> struct MaskTypeFor <int32_t> { using type = uint32_t; }; | |||
| template <> struct MaskTypeFor <int64_t> { using type = uint64_t; }; | |||
| template <> struct MaskTypeFor <std::complex<float>> { using type = uint32_t; }; | |||
| template <> struct MaskTypeFor <std::complex<double>> { using type = uint64_t; }; | |||
| template <typename Primitive> struct PrimitiveType { using type = Primitive; }; | |||
| template <typename Primitive> struct PrimitiveType<std::complex<Primitive>> { using type = Primitive; }; | |||
| template <int n> struct Log2Helper { enum { value = Log2Helper<n/2>::value + 1 }; }; | |||
| template <> struct Log2Helper<1> { enum { value = 0 }; }; | |||
| @@ -64,8 +64,8 @@ template <> | |||
| struct SIMDNativeOps<uint32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef uint32x4_t vSIMDType; | |||
| typedef SIMDFallbackOps<uint32_t, vSIMDType> fb; | |||
| using vSIMDType = uint32x4_t; | |||
| using fb = SIMDFallbackOps<uint32_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (uint32_t, kAllBitsSet); | |||
| @@ -108,8 +108,8 @@ template <> | |||
| struct SIMDNativeOps<int32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef int32x4_t vSIMDType; | |||
| typedef SIMDFallbackOps<int32_t, vSIMDType> fb; | |||
| using vSIMDType = int32x4_t; | |||
| using fb = SIMDFallbackOps<int32_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -153,8 +153,8 @@ template <> | |||
| struct SIMDNativeOps<int8_t> | |||
| { | |||
| //============================================================================== | |||
| typedef int8x16_t vSIMDType; | |||
| typedef SIMDFallbackOps<int8_t, vSIMDType> fb; | |||
| using vSIMDType = int8x16_t; | |||
| using fb = SIMDFallbackOps<int8_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (int8_t, kAllBitsSet); | |||
| @@ -193,8 +193,8 @@ template <> | |||
| struct SIMDNativeOps<uint8_t> | |||
| { | |||
| //============================================================================== | |||
| typedef uint8x16_t vSIMDType; | |||
| typedef SIMDFallbackOps<uint8_t, vSIMDType> fb; | |||
| using vSIMDType = uint8x16_t; | |||
| using fb = SIMDFallbackOps<uint8_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (uint8_t, kAllBitsSet); | |||
| @@ -233,8 +233,8 @@ template <> | |||
| struct SIMDNativeOps<int16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef int16x8_t vSIMDType; | |||
| typedef SIMDFallbackOps<int16_t, vSIMDType> fb; | |||
| using vSIMDType = int16x8_t; | |||
| using fb = SIMDFallbackOps<int16_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (int16_t, kAllBitsSet); | |||
| @@ -274,8 +274,8 @@ template <> | |||
| struct SIMDNativeOps<uint16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef uint16x8_t vSIMDType; | |||
| typedef SIMDFallbackOps<uint16_t, vSIMDType> fb; | |||
| using vSIMDType = uint16x8_t; | |||
| using fb = SIMDFallbackOps<uint16_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (uint16_t, kAllBitsSet); | |||
| @@ -314,8 +314,8 @@ template <> | |||
| struct SIMDNativeOps<int64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef int64x2_t vSIMDType; | |||
| typedef SIMDFallbackOps<int64_t, vSIMDType> fb; | |||
| using vSIMDType = int64x2_t; | |||
| using fb = SIMDFallbackOps<int64_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (int64_t, kAllBitsSet); | |||
| @@ -355,8 +355,8 @@ template <> | |||
| struct SIMDNativeOps<uint64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef uint64x2_t vSIMDType; | |||
| typedef SIMDFallbackOps<uint64_t, vSIMDType> fb; | |||
| using vSIMDType = uint64x2_t; | |||
| using fb = SIMDFallbackOps<uint64_t, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (uint64_t, kAllBitsSet); | |||
| @@ -395,9 +395,9 @@ template <> | |||
| struct SIMDNativeOps<float> | |||
| { | |||
| //============================================================================== | |||
| typedef float32x4_t vSIMDType; | |||
| typedef uint32x4_t vMaskType; | |||
| typedef SIMDFallbackOps<float, vSIMDType> fb; | |||
| using vSIMDType = float32x4_t; | |||
| using vMaskType = uint32x4_t; | |||
| using fb = SIMDFallbackOps<float, vSIMDType>; | |||
| //============================================================================== | |||
| DECLARE_NEON_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -456,33 +456,33 @@ template <> | |||
| struct SIMDNativeOps<double> | |||
| { | |||
| //============================================================================== | |||
| typedef struct { double v[2]; } vSIMDType; | |||
| typedef SIMDFallbackOps<double, vSIMDType> fb; | |||
| static forcedinline vSIMDType expand (double s) noexcept { return {{s, s}}; } | |||
| static forcedinline vSIMDType load (const double* a) noexcept { return {{a[0], a[1]}}; } | |||
| static forcedinline void store (vSIMDType v, double* a) noexcept { a[0] = v.v[0]; a[1] = v.v[1]; } | |||
| static forcedinline double get (vSIMDType v, size_t i) noexcept { return v.v[i]; } | |||
| static forcedinline vSIMDType set (vSIMDType v, size_t i, double s) noexcept { v.v[i] = s; return v; } | |||
| static forcedinline vSIMDType add (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] + b.v[0], a.v[1] + b.v[1]}}; } | |||
| static forcedinline vSIMDType sub (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] - b.v[0], a.v[1] - b.v[1]}}; } | |||
| static forcedinline vSIMDType mul (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] * b.v[0], a.v[1] * b.v[1]}}; } | |||
| static forcedinline vSIMDType bit_and (vSIMDType a, vSIMDType b) noexcept { return fb::bit_and (a, b); } | |||
| static forcedinline vSIMDType bit_or (vSIMDType a, vSIMDType b) noexcept { return fb::bit_or (a, b); } | |||
| static forcedinline vSIMDType bit_xor (vSIMDType a, vSIMDType b) noexcept { return fb::bit_xor (a, b); } | |||
| static forcedinline vSIMDType bit_notand (vSIMDType a, vSIMDType b) noexcept { return fb::bit_notand (a, b); } | |||
| static forcedinline vSIMDType bit_not (vSIMDType a) noexcept { return fb::bit_not (a); } | |||
| static forcedinline vSIMDType min (vSIMDType a, vSIMDType b) noexcept { return fb::min (a, b); } | |||
| static forcedinline vSIMDType max (vSIMDType a, vSIMDType b) noexcept { return fb::max (a, b); } | |||
| static forcedinline vSIMDType equal (vSIMDType a, vSIMDType b) noexcept { return fb::equal (a, b); } | |||
| static forcedinline vSIMDType notEqual (vSIMDType a, vSIMDType b) noexcept { return fb::notEqual (a, b); } | |||
| static forcedinline vSIMDType greaterThan (vSIMDType a, vSIMDType b) noexcept { return fb::greaterThan (a, b); } | |||
| static forcedinline vSIMDType greaterThanOrEqual (vSIMDType a, vSIMDType b) noexcept { return fb::greaterThanOrEqual (a, b); } | |||
| static forcedinline bool allEqual (vSIMDType a, vSIMDType b) noexcept { return fb::allEqual (a, b); } | |||
| using vSIMDType = struct { double v[2]; }; | |||
| using fb = SIMDFallbackOps<double, vSIMDType>; | |||
| static forcedinline vSIMDType expand (double s) noexcept { return {{s, s}}; } | |||
| static forcedinline vSIMDType load (const double* a) noexcept { return {{a[0], a[1]}}; } | |||
| static forcedinline void store (vSIMDType v, double* a) noexcept { a[0] = v.v[0]; a[1] = v.v[1]; } | |||
| static forcedinline double get (vSIMDType v, size_t i) noexcept { return v.v[i]; } | |||
| static forcedinline vSIMDType set (vSIMDType v, size_t i, double s) noexcept { v.v[i] = s; return v; } | |||
| static forcedinline vSIMDType add (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] + b.v[0], a.v[1] + b.v[1]}}; } | |||
| static forcedinline vSIMDType sub (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] - b.v[0], a.v[1] - b.v[1]}}; } | |||
| static forcedinline vSIMDType mul (vSIMDType a, vSIMDType b) noexcept { return {{a.v[0] * b.v[0], a.v[1] * b.v[1]}}; } | |||
| static forcedinline vSIMDType bit_and (vSIMDType a, vSIMDType b) noexcept { return fb::bit_and (a, b); } | |||
| static forcedinline vSIMDType bit_or (vSIMDType a, vSIMDType b) noexcept { return fb::bit_or (a, b); } | |||
| static forcedinline vSIMDType bit_xor (vSIMDType a, vSIMDType b) noexcept { return fb::bit_xor (a, b); } | |||
| static forcedinline vSIMDType bit_notand (vSIMDType a, vSIMDType b) noexcept { return fb::bit_notand (a, b); } | |||
| static forcedinline vSIMDType bit_not (vSIMDType a) noexcept { return fb::bit_not (a); } | |||
| static forcedinline vSIMDType min (vSIMDType a, vSIMDType b) noexcept { return fb::min (a, b); } | |||
| static forcedinline vSIMDType max (vSIMDType a, vSIMDType b) noexcept { return fb::max (a, b); } | |||
| static forcedinline vSIMDType equal (vSIMDType a, vSIMDType b) noexcept { return fb::equal (a, b); } | |||
| static forcedinline vSIMDType notEqual (vSIMDType a, vSIMDType b) noexcept { return fb::notEqual (a, b); } | |||
| static forcedinline vSIMDType greaterThan (vSIMDType a, vSIMDType b) noexcept { return fb::greaterThan (a, b); } | |||
| static forcedinline vSIMDType greaterThanOrEqual (vSIMDType a, vSIMDType b) noexcept { return fb::greaterThanOrEqual (a, b); } | |||
| static forcedinline bool allEqual (vSIMDType a, vSIMDType b) noexcept { return fb::allEqual (a, b); } | |||
| static forcedinline vSIMDType multiplyAdd (vSIMDType a, vSIMDType b, vSIMDType c) noexcept { return fb::multiplyAdd (a, b, c); } | |||
| static forcedinline vSIMDType cmplxmul (vSIMDType a, vSIMDType b) noexcept { return fb::cmplxmul (a, b); } | |||
| static forcedinline double sum (vSIMDType a) noexcept { return fb::sum (a); } | |||
| static forcedinline vSIMDType oddevensum (vSIMDType a) noexcept { return a; } | |||
| static forcedinline vSIMDType cmplxmul (vSIMDType a, vSIMDType b) noexcept { return fb::cmplxmul (a, b); } | |||
| static forcedinline double sum (vSIMDType a) noexcept { return fb::sum (a); } | |||
| static forcedinline vSIMDType oddevensum (vSIMDType a) noexcept { return a; } | |||
| }; | |||
| #endif | |||
| @@ -64,7 +64,7 @@ template <> | |||
| struct SIMDNativeOps<float> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128 vSIMDType; | |||
| using vSIMDType = __m128; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -129,7 +129,7 @@ template <> | |||
| struct SIMDNativeOps<double> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128d vSIMDType; | |||
| using vSIMDType = __m128d; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int64_t, kAllBitsSet); | |||
| @@ -195,7 +195,7 @@ template <> | |||
| struct SIMDNativeOps<int8_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int8_t, kAllBitsSet); | |||
| @@ -266,7 +266,7 @@ template <> | |||
| struct SIMDNativeOps<uint8_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (uint8_t, kHighBit); | |||
| @@ -335,7 +335,7 @@ template <> | |||
| struct SIMDNativeOps<int16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int16_t, kAllBitsSet); | |||
| @@ -388,7 +388,7 @@ template <> | |||
| struct SIMDNativeOps<uint16_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (uint16_t, kHighBit); | |||
| @@ -448,7 +448,7 @@ template <> | |||
| struct SIMDNativeOps<int32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int32_t, kAllBitsSet); | |||
| @@ -527,7 +527,7 @@ template <> | |||
| struct SIMDNativeOps<uint32_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (uint32_t, kAllBitsSet); | |||
| @@ -608,7 +608,7 @@ template <> | |||
| struct SIMDNativeOps<int64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (int64_t, kAllBitsSet); | |||
| @@ -665,7 +665,7 @@ template <> | |||
| struct SIMDNativeOps<uint64_t> | |||
| { | |||
| //============================================================================== | |||
| typedef __m128i vSIMDType; | |||
| using vSIMDType = __m128i; | |||
| //============================================================================== | |||
| DECLARE_SSE_SIMD_CONST (uint64_t, kAllBitsSet); | |||
| @@ -48,7 +48,7 @@ public: | |||
| Message() noexcept; | |||
| ~Message(); | |||
| typedef ReferenceCountedObjectPtr<Message> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<Message>; | |||
| //============================================================================== | |||
| private: | |||
| @@ -182,7 +182,7 @@ public: | |||
| virtual void messageCallback() = 0; | |||
| bool post(); | |||
| typedef ReferenceCountedObjectPtr<MessageBase> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<MessageBase>; | |||
| JUCE_DECLARE_NON_COPYABLE (MessageBase) | |||
| }; | |||
| @@ -49,7 +49,7 @@ class JUCE_API Typeface : public ReferenceCountedObject | |||
| public: | |||
| //============================================================================== | |||
| /** A handy typedef for a pointer to a typeface. */ | |||
| typedef ReferenceCountedObjectPtr<Typeface> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<Typeface>; | |||
| //============================================================================== | |||
| /** Returns the font family of the typeface. | |||
| @@ -448,7 +448,7 @@ public: | |||
| ImagePixelData (Image::PixelFormat, int width, int height); | |||
| ~ImagePixelData(); | |||
| typedef ReferenceCountedObjectPtr<ImagePixelData> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<ImagePixelData>; | |||
| /** Creates a context that will draw into this image. */ | |||
| virtual LowLevelGraphicsContext* createLowLevelContext() = 0; | |||
| @@ -1632,7 +1632,7 @@ struct ClipRegions | |||
| Base() {} | |||
| virtual ~Base() {} | |||
| typedef ReferenceCountedObjectPtr<Base> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<Base>; | |||
| virtual Ptr clone() const = 0; | |||
| virtual Ptr applyClipTo (const Ptr& target) const = 0; | |||
| @@ -1669,7 +1669,7 @@ struct ClipRegions | |||
| EdgeTableRegion (const EdgeTableRegion& other) : Base(), edgeTable (other.edgeTable) {} | |||
| EdgeTableRegion& operator= (const EdgeTableRegion&) = delete; | |||
| typedef typename Base::Ptr Ptr; | |||
| using Ptr = typename Base::Ptr; | |||
| Ptr clone() const override { return new EdgeTableRegion (*this); } | |||
| Ptr applyClipTo (const Ptr& target) const override { return target->clipToEdgeTable (edgeTable); } | |||
| @@ -1850,7 +1850,7 @@ struct ClipRegions | |||
| RectangleListRegion (const RectangleList<int>& r) : clip (r) {} | |||
| RectangleListRegion (const RectangleListRegion& other) : Base(), clip (other.clip) {} | |||
| typedef typename Base::Ptr Ptr; | |||
| using Ptr = typename Base::Ptr; | |||
| Ptr clone() const override { return new RectangleListRegion (*this); } | |||
| Ptr applyClipTo (const Ptr& target) const override { return target->clipToRectangleList (clip); } | |||
| @@ -2080,9 +2080,9 @@ template <class SavedStateType> | |||
| class SavedStateBase | |||
| { | |||
| public: | |||
| typedef typename ClipRegions<SavedStateType>::Base BaseRegionType; | |||
| typedef typename ClipRegions<SavedStateType>::EdgeTableRegion EdgeTableRegionType; | |||
| typedef typename ClipRegions<SavedStateType>::RectangleListRegion RectangleListRegionType; | |||
| using BaseRegionType = typename ClipRegions<SavedStateType>::Base; | |||
| using EdgeTableRegionType = typename ClipRegions<SavedStateType>::EdgeTableRegion; | |||
| using RectangleListRegionType = typename ClipRegions<SavedStateType>::RectangleListRegion; | |||
| SavedStateBase (Rectangle<int> initialClip) | |||
| : clip (new RectangleListRegionType (initialClip)), | |||
| @@ -2516,7 +2516,7 @@ public: | |||
| //============================================================================== | |||
| class SoftwareRendererSavedState : public SavedStateBase<SoftwareRendererSavedState> | |||
| { | |||
| typedef SavedStateBase<SoftwareRendererSavedState> BaseClass; | |||
| using BaseClass = SavedStateBase<SoftwareRendererSavedState>; | |||
| public: | |||
| SoftwareRendererSavedState (const Image& im, Rectangle<int> clipBounds) | |||
| @@ -2564,7 +2564,7 @@ public: | |||
| } | |||
| } | |||
| typedef GlyphCache<CachedGlyphEdgeTable<SoftwareRendererSavedState>, SoftwareRendererSavedState> GlyphCacheType; | |||
| using GlyphCacheType = GlyphCache<CachedGlyphEdgeTable<SoftwareRendererSavedState>, SoftwareRendererSavedState>; | |||
| static void clearGlyphCache() | |||
| { | |||
| @@ -46,7 +46,7 @@ struct FTLibWrapper : public ReferenceCountedObject | |||
| FT_Library library; | |||
| typedef ReferenceCountedObjectPtr<FTLibWrapper> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<FTLibWrapper>; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FTLibWrapper) | |||
| }; | |||
| @@ -79,7 +79,7 @@ struct FTFaceWrapper : public ReferenceCountedObject | |||
| FTLibWrapper::Ptr library; | |||
| MemoryBlock savedFaceData; | |||
| typedef ReferenceCountedObjectPtr<FTFaceWrapper> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<FTFaceWrapper>; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FTFaceWrapper) | |||
| }; | |||
| @@ -39,7 +39,7 @@ class Win32NativeFileChooser : public ReferenceCountedObject, | |||
| private Thread | |||
| { | |||
| public: | |||
| typedef ReferenceCountedObjectPtr<Win32NativeFileChooser> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<Win32NativeFileChooser>; | |||
| enum { charsAvailableForResult = 32768 }; | |||
| @@ -76,7 +76,7 @@ public: | |||
| class SharedKeyWindow : public ReferenceCountedObject | |||
| { | |||
| public: | |||
| typedef ReferenceCountedObjectPtr<SharedKeyWindow> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<SharedKeyWindow>; | |||
| //============================================================================== | |||
| Window getHandle() { return keyProxy; } | |||
| @@ -36,8 +36,8 @@ namespace juce | |||
| class Draggable3DOrientation | |||
| { | |||
| public: | |||
| typedef Vector3D<float> VectorType; | |||
| typedef Quaternion<float> QuaternionType; | |||
| using VectorType = Vector3D<float>; | |||
| using QuaternionType = Quaternion<float>; | |||
| /** Creates a Draggable3DOrientation, initially set up to be aligned along the X axis. */ | |||
| Draggable3DOrientation (float objectRadius = 0.5f) noexcept | |||
| @@ -65,7 +65,7 @@ public: | |||
| rectangle is assumed to be the centre of the object that will be rotated, and | |||
| the size of the rectangle will be used to scale the object radius - see setRadius(). | |||
| */ | |||
| void setViewport (const Rectangle<int>& newArea) noexcept | |||
| void setViewport (Rectangle<int> newArea) noexcept | |||
| { | |||
| area = newArea; | |||
| } | |||
| @@ -95,9 +95,9 @@ public: | |||
| template <typename Type> | |||
| void mouseDrag (Point<Type> mousePos) noexcept | |||
| { | |||
| const VectorType oldPos (projectOnSphere (lastMouse)); | |||
| auto oldPos = projectOnSphere (lastMouse); | |||
| lastMouse = mousePosToProportion (mousePos.toFloat()); | |||
| const VectorType newPos (projectOnSphere (lastMouse)); | |||
| auto newPos = projectOnSphere (lastMouse); | |||
| quaternion *= rotationFromMove (oldPos, newPos); | |||
| } | |||
| @@ -122,36 +122,36 @@ private: | |||
| QuaternionType quaternion; | |||
| Point<float> lastMouse; | |||
| Point<float> mousePosToProportion (const Point<float> mousePos) const noexcept | |||
| Point<float> mousePosToProportion (Point<float> mousePos) const noexcept | |||
| { | |||
| const int scale = (jmin (area.getWidth(), area.getHeight()) / 2); | |||
| auto scale = jmin (area.getWidth(), area.getHeight()) / 2; | |||
| // You must call setViewport() to give this object a valid window size before | |||
| // calling any of the mouse input methods! | |||
| jassert (scale > 0); | |||
| return Point<float> ((mousePos.x - (float) area.getCentreX()) / (float) scale, | |||
| ((float) area.getCentreY() - mousePos.y) / (float) scale); | |||
| return { (mousePos.x - (float) area.getCentreX()) / (float) scale, | |||
| ((float) area.getCentreY() - mousePos.y) / (float) scale }; | |||
| } | |||
| VectorType projectOnSphere (const Point<float> pos) const noexcept | |||
| VectorType projectOnSphere (Point<float> pos) const noexcept | |||
| { | |||
| const float radiusSquared = radius * radius; | |||
| const float xySquared = pos.x * pos.x + pos.y * pos.y; | |||
| auto radiusSquared = radius * radius; | |||
| auto xySquared = pos.x * pos.x + pos.y * pos.y; | |||
| return VectorType (pos.x, pos.y, | |||
| xySquared < radiusSquared * 0.5f ? std::sqrt (radiusSquared - xySquared) | |||
| : (radiusSquared / (2.0f * std::sqrt (xySquared)))); | |||
| return { pos.x, pos.y, | |||
| xySquared < radiusSquared * 0.5f ? std::sqrt (radiusSquared - xySquared) | |||
| : (radiusSquared / (2.0f * std::sqrt (xySquared))) }; | |||
| } | |||
| QuaternionType rotationFromMove (const VectorType& from, const VectorType& to) const noexcept | |||
| { | |||
| VectorType rotationAxis (to ^ from); | |||
| auto rotationAxis = (to ^ from); | |||
| if (rotationAxis.lengthIsBelowEpsilon()) | |||
| rotationAxis = VectorType::xAxis(); | |||
| const float d = jlimit (-1.0f, 1.0f, (from - to).length() / (2.0f * radius)); | |||
| auto d = jlimit (-1.0f, 1.0f, (from - to).length() / (2.0f * radius)); | |||
| return QuaternionType::fromAngle (2.0f * std::asin (d), rotationAxis); | |||
| } | |||
| @@ -334,7 +334,7 @@ private: | |||
| //============================================================================== | |||
| struct AsyncWorker : public ReferenceCountedObject | |||
| { | |||
| typedef ReferenceCountedObjectPtr<AsyncWorker> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<AsyncWorker>; | |||
| virtual void operator() (OpenGLContext&) = 0; | |||
| virtual ~AsyncWorker() {} | |||
| }; | |||
| @@ -140,7 +140,7 @@ struct CachedImageList : public ReferenceCountedObject, | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CachedImage) | |||
| }; | |||
| typedef ReferenceCountedObjectPtr<CachedImageList> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<CachedImageList>; | |||
| private: | |||
| OpenGLContext& context; | |||
| @@ -375,7 +375,7 @@ struct ShaderPrograms : public ReferenceCountedObject | |||
| maskTexture (context) | |||
| {} | |||
| typedef ReferenceCountedObjectPtr<ShaderPrograms> Ptr; | |||
| using Ptr = ReferenceCountedObjectPtr<ShaderPrograms>; | |||
| //============================================================================== | |||
| struct ShaderProgramHolder | |||
| @@ -1579,7 +1579,7 @@ private: | |||
| //============================================================================== | |||
| struct SavedState : public RenderingHelpers::SavedStateBase<SavedState> | |||
| { | |||
| typedef RenderingHelpers::SavedStateBase<SavedState> BaseClass; | |||
| using BaseClass = RenderingHelpers::SavedStateBase<SavedState>; | |||
| SavedState (GLState* s) : BaseClass (s->target.bounds), state (s) | |||
| {} | |||
| @@ -1630,7 +1630,7 @@ struct SavedState : public RenderingHelpers::SavedStateBase<SavedState> | |||
| } | |||
| } | |||
| typedef RenderingHelpers::GlyphCache<RenderingHelpers::CachedGlyphEdgeTable<SavedState>, SavedState> GlyphCacheType; | |||
| using GlyphCacheType = RenderingHelpers::GlyphCache<RenderingHelpers::CachedGlyphEdgeTable<SavedState>, SavedState>; | |||
| void drawGlyph (int glyphNumber, const AffineTransform& trans) | |||
| { | |||
| @@ -33,7 +33,7 @@ namespace | |||
| template <typename CharPointerType> | |||
| class OSCPatternMatcherImpl | |||
| { | |||
| typedef CharPointerType CharPtr; | |||
| using CharPtr = CharPointerType; | |||
| public: | |||
| //============================================================================== | |||
| @@ -266,7 +266,7 @@ namespace | |||
| template <typename OSCAddressType> | |||
| struct OSCAddressTokeniser | |||
| { | |||
| typedef OSCAddressTokeniserTraits<OSCAddressType> Traits; | |||
| using Traits = OSCAddressTokeniserTraits<OSCAddressType>; | |||
| //============================================================================== | |||
| static bool isPrintableASCIIChar (juce_wchar c) noexcept | |||
| @@ -525,7 +525,7 @@ private: | |||
| //============================================================================== | |||
| void callListeners (const OSCBundle::Element& content) | |||
| { | |||
| typedef OSCReceiver::Listener<OSCReceiver::MessageLoopCallback> Listener; | |||
| using Listener = OSCReceiver::Listener<OSCReceiver::MessageLoopCallback>; | |||
| if (content.isMessage()) | |||
| { | |||
| @@ -541,7 +541,7 @@ private: | |||
| void callRealtimeListeners (const OSCBundle::Element& content) | |||
| { | |||
| typedef OSCReceiver::Listener<OSCReceiver::RealtimeCallback> Listener; | |||
| using Listener = OSCReceiver::Listener<OSCReceiver::RealtimeCallback>; | |||
| if (content.isMessage()) | |||
| { | |||
| @@ -200,7 +200,7 @@ public: | |||
| The arguments passed are the pointer to and the data of the buffer that | |||
| the OSCReceiver has failed to parse. | |||
| */ | |||
| typedef std::function<void (const char* data, int dataSize)> FormatErrorHandler; | |||
| using FormatErrorHandler = std::function<void (const char* data, int dataSize)>; | |||
| /** Installs a custom error handler which is called in case the receiver | |||
| encounters a stream it cannot parse as an OSC bundle or OSC message. | |||