| @@ -23,16 +23,16 @@ | |||||
| namespace juce | namespace juce | ||||
| { | { | ||||
| void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(uint16*) intData = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| intData += destBytesPerSample; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -43,21 +43,21 @@ void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | intData -= destBytesPerSample; | ||||
| *(uint16*) intData = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfBigEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(uint16*) intData = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| intData += destBytesPerSample; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -68,15 +68,15 @@ void AudioDataConverters::convertFloatToInt16BE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | intData -= destBytesPerSample; | ||||
| *(uint16*) intData = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint16*> (intData) = ByteOrder::swapIfLittleEndian ((uint16) (short) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fffff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fffff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| @@ -98,10 +98,10 @@ void AudioDataConverters::convertFloatToInt24LE (const float* source, void* dest | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fffff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fffff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| @@ -123,16 +123,16 @@ void AudioDataConverters::convertFloatToInt24BE (const float* source, void* dest | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fffffff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fffffff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(uint32*)intData = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| intData += destBytesPerSample; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -143,21 +143,21 @@ void AudioDataConverters::convertFloatToInt32LE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | intData -= destBytesPerSample; | ||||
| *(uint32*)intData = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfBigEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| const double maxVal = (double) 0x7fffffff; | |||||
| char* intData = static_cast<char*> (dest); | |||||
| auto maxVal = (double) 0x7fffffff; | |||||
| auto intData = static_cast<char*> (dest); | |||||
| if (dest != (void*) source || destBytesPerSample <= 4) | if (dest != (void*) source || destBytesPerSample <= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(uint32*)intData = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| intData += destBytesPerSample; | intData += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -168,12 +168,12 @@ void AudioDataConverters::convertFloatToInt32BE (const float* source, void* dest | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= destBytesPerSample; | intData -= destBytesPerSample; | ||||
| *(uint32*)intData = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| *reinterpret_cast<uint32*> (intData) = ByteOrder::swapIfLittleEndian ((uint32) roundToInt (jlimit (-maxVal, maxVal, maxVal * source[i]))); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! | jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! | ||||
| @@ -181,28 +181,28 @@ void AudioDataConverters::convertFloatToFloat32LE (const float* source, void* de | |||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(float*) d = source[i]; | |||||
| *reinterpret_cast<float*> (d) = source[i]; | |||||
| #if JUCE_BIG_ENDIAN | #if JUCE_BIG_ENDIAN | ||||
| *(uint32*) d = ByteOrder::swap (*(uint32*) d); | |||||
| *reinterpret_cast<uint32*> (d) = ByteOrder::swap (*reinterpret_cast<uint32*> (d)); | |||||
| #endif | #endif | ||||
| d += destBytesPerSample; | d += destBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* dest, int numSamples, const int destBytesPerSample) | |||||
| void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* dest, int numSamples, int destBytesPerSample) | |||||
| { | { | ||||
| jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! | jassert (dest != (void*) source || destBytesPerSample <= 4); // This op can't be performed on in-place data! | ||||
| char* d = static_cast<char*> (dest); | |||||
| auto d = static_cast<char*> (dest); | |||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| *(float*) d = source[i]; | |||||
| *reinterpret_cast<float*> (d) = source[i]; | |||||
| #if JUCE_LITTLE_ENDIAN | #if JUCE_LITTLE_ENDIAN | ||||
| *(uint32*) d = ByteOrder::swap (*(uint32*) d); | |||||
| *reinterpret_cast<uint32*> (d) = ByteOrder::swap (*reinterpret_cast<uint32*> (d)); | |||||
| #endif | #endif | ||||
| d += destBytesPerSample; | d += destBytesPerSample; | ||||
| @@ -210,16 +210,16 @@ void AudioDataConverters::convertFloatToFloat32BE (const float* source, void* de | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| void AudioDataConverters::convertInt16LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt16LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const float scale = 1.0f / 0x7fff; | const float scale = 1.0f / 0x7fff; | ||||
| const char* intData = static_cast<const char*> (source); | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*(uint16*)intData); | |||||
| dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint16*> (intData)); | |||||
| intData += srcBytesPerSample; | intData += srcBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -230,21 +230,21 @@ void AudioDataConverters::convertInt16LEToFloat (const void* const source, float | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= srcBytesPerSample; | intData -= srcBytesPerSample; | ||||
| dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*(uint16*)intData); | |||||
| dest[i] = scale * (short) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint16*> (intData)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertInt16BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt16BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const float scale = 1.0f / 0x7fff; | const float scale = 1.0f / 0x7fff; | ||||
| const char* intData = static_cast<const char*> (source); | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*(uint16*)intData); | |||||
| dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint16*> (intData)); | |||||
| intData += srcBytesPerSample; | intData += srcBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -255,15 +255,15 @@ void AudioDataConverters::convertInt16BEToFloat (const void* const source, float | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= srcBytesPerSample; | intData -= srcBytesPerSample; | ||||
| dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*(uint16*)intData); | |||||
| dest[i] = scale * (short) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint16*> (intData)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertInt24LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt24LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const float scale = 1.0f / 0x7fffff; | const float scale = 1.0f / 0x7fffff; | ||||
| const char* intData = static_cast<const char*> (source); | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| @@ -285,10 +285,10 @@ void AudioDataConverters::convertInt24LEToFloat (const void* const source, float | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertInt24BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt24BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const float scale = 1.0f / 0x7fffff; | const float scale = 1.0f / 0x7fffff; | ||||
| const char* intData = static_cast<const char*> (source); | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| @@ -310,16 +310,16 @@ void AudioDataConverters::convertInt24BEToFloat (const void* const source, float | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertInt32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const auto scale = 1.0f / (float) 0x7fffffff; | |||||
| const char* intData = static_cast<const char*> (source); | |||||
| const float scale = 1.0f / (float) 0x7fffffff; | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*(uint32*) intData); | |||||
| dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint32*> (intData)); | |||||
| intData += srcBytesPerSample; | intData += srcBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -330,21 +330,21 @@ void AudioDataConverters::convertInt32LEToFloat (const void* const source, float | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= srcBytesPerSample; | intData -= srcBytesPerSample; | ||||
| dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*(uint32*) intData); | |||||
| dest[i] = scale * (int) ByteOrder::swapIfBigEndian (*reinterpret_cast<const uint32*> (intData)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertInt32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertInt32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const auto scale = 1.0f / (float) 0x7fffffff; | |||||
| const char* intData = static_cast<const char*> (source); | |||||
| const float scale = 1.0f / (float) 0x7fffffff; | |||||
| auto intData = static_cast<const char*> (source); | |||||
| if (source != (void*) dest || srcBytesPerSample >= 4) | if (source != (void*) dest || srcBytesPerSample >= 4) | ||||
| { | { | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*(uint32*) intData); | |||||
| dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint32*> (intData)); | |||||
| intData += srcBytesPerSample; | intData += srcBytesPerSample; | ||||
| } | } | ||||
| } | } | ||||
| @@ -355,21 +355,21 @@ void AudioDataConverters::convertInt32BEToFloat (const void* const source, float | |||||
| for (int i = numSamples; --i >= 0;) | for (int i = numSamples; --i >= 0;) | ||||
| { | { | ||||
| intData -= srcBytesPerSample; | intData -= srcBytesPerSample; | ||||
| dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*(uint32*) intData); | |||||
| dest[i] = scale * (int) ByteOrder::swapIfLittleEndian (*reinterpret_cast<const uint32*> (intData)); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloat32LEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertFloat32LEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const char* s = static_cast<const char*> (source); | |||||
| auto s = static_cast<const char*> (source); | |||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = *(float*)s; | |||||
| dest[i] = *reinterpret_cast<const float*> (s); | |||||
| #if JUCE_BIG_ENDIAN | #if JUCE_BIG_ENDIAN | ||||
| uint32* const d = (uint32*) (dest + i); | |||||
| auto d = reinterpret_cast<uint32*> (dest + i); | |||||
| *d = ByteOrder::swap (*d); | *d = ByteOrder::swap (*d); | ||||
| #endif | #endif | ||||
| @@ -377,16 +377,16 @@ void AudioDataConverters::convertFloat32LEToFloat (const void* const source, flo | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFloat32BEToFloat (const void* const source, float* const dest, int numSamples, const int srcBytesPerSample) | |||||
| void AudioDataConverters::convertFloat32BEToFloat (const void* source, float* dest, int numSamples, int srcBytesPerSample) | |||||
| { | { | ||||
| const char* s = static_cast<const char*> (source); | |||||
| auto s = static_cast<const char*> (source); | |||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| dest[i] = *(float*)s; | |||||
| dest[i] = *reinterpret_cast<const float*> (s); | |||||
| #if JUCE_LITTLE_ENDIAN | #if JUCE_LITTLE_ENDIAN | ||||
| uint32* const d = (uint32*) (dest + i); | |||||
| auto d = reinterpret_cast<uint32*> (dest + i); | |||||
| *d = ByteOrder::swap (*d); | *d = ByteOrder::swap (*d); | ||||
| #endif | #endif | ||||
| @@ -396,10 +396,7 @@ void AudioDataConverters::convertFloat32BEToFloat (const void* const source, flo | |||||
| //============================================================================== | //============================================================================== | ||||
| void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat, | |||||
| const float* const source, | |||||
| void* const dest, | |||||
| const int numSamples) | |||||
| void AudioDataConverters::convertFloatToFormat (DataFormat destFormat, const float* source, void* dest, int numSamples) | |||||
| { | { | ||||
| switch (destFormat) | switch (destFormat) | ||||
| { | { | ||||
| @@ -415,10 +412,7 @@ void AudioDataConverters::convertFloatToFormat (const DataFormat destFormat, | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat, | |||||
| const void* const source, | |||||
| float* const dest, | |||||
| const int numSamples) | |||||
| void AudioDataConverters::convertFormatToFloat (DataFormat sourceFormat, const void* source, float* dest, int numSamples) | |||||
| { | { | ||||
| switch (sourceFormat) | switch (sourceFormat) | ||||
| { | { | ||||
| @@ -435,15 +429,12 @@ void AudioDataConverters::convertFormatToFloat (const DataFormat sourceFormat, | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| void AudioDataConverters::interleaveSamples (const float** const source, | |||||
| float* const dest, | |||||
| const int numSamples, | |||||
| const int numChannels) | |||||
| void AudioDataConverters::interleaveSamples (const float** source, float* dest, int numSamples, int numChannels) | |||||
| { | { | ||||
| for (int chan = 0; chan < numChannels; ++chan) | for (int chan = 0; chan < numChannels; ++chan) | ||||
| { | { | ||||
| int i = chan; | |||||
| const float* src = source [chan]; | |||||
| auto i = chan; | |||||
| auto src = source [chan]; | |||||
| for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
| { | { | ||||
| @@ -453,15 +444,12 @@ void AudioDataConverters::interleaveSamples (const float** const source, | |||||
| } | } | ||||
| } | } | ||||
| void AudioDataConverters::deinterleaveSamples (const float* const source, | |||||
| float** const dest, | |||||
| const int numSamples, | |||||
| const int numChannels) | |||||
| void AudioDataConverters::deinterleaveSamples (const float* source, float** dest, int numSamples, int numChannels) | |||||
| { | { | ||||
| for (int chan = 0; chan < numChannels; ++chan) | for (int chan = 0; chan < numChannels; ++chan) | ||||
| { | { | ||||
| int i = chan; | |||||
| float* dst = dest [chan]; | |||||
| auto i = chan; | |||||
| auto dst = dest [chan]; | |||||
| for (int j = 0; j < numSamples; ++j) | for (int j = 0; j < numSamples; ++j) | ||||
| { | { | ||||
| @@ -491,8 +479,8 @@ public: | |||||
| static void test (UnitTest& unitTest, bool inPlace, Random& r) | static void test (UnitTest& unitTest, bool inPlace, Random& r) | ||||
| { | { | ||||
| const int numSamples = 2048; | |||||
| int32 original [numSamples], converted [numSamples], reversed [numSamples]; | |||||
| constexpr int numSamples = 2048; | |||||
| int32 original[numSamples], converted[numSamples], reversed[numSamples]; | |||||
| { | { | ||||
| AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original); | AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst> d (original); | ||||
| @@ -514,13 +502,13 @@ public: | |||||
| } | } | ||||
| // convert data from the source to dest format.. | // convert data from the source to dest format.. | ||||
| std::unique_ptr<AudioData::Converter> conv (new AudioData::ConverterInstance <AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::Const>, | |||||
| AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::NonConst>>()); | |||||
| std::unique_ptr<AudioData::Converter> conv (new AudioData::ConverterInstance<AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::Const>, | |||||
| AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::NonConst>>()); | |||||
| conv->convertSamples (inPlace ? reversed : converted, original, numSamples); | conv->convertSamples (inPlace ? reversed : converted, original, numSamples); | ||||
| // ..and back again.. | // ..and back again.. | ||||
| conv.reset (new AudioData::ConverterInstance <AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::Const>, | |||||
| AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst>>()); | |||||
| conv.reset (new AudioData::ConverterInstance<AudioData::Pointer<F2, E2, AudioData::NonInterleaved, AudioData::Const>, | |||||
| AudioData::Pointer<F1, E1, AudioData::NonInterleaved, AudioData::NonConst>>()); | |||||
| if (! inPlace) | if (! inPlace) | ||||
| zeromem (reversed, sizeof (reversed)); | zeromem (reversed, sizeof (reversed)); | ||||
| @@ -582,7 +570,7 @@ public: | |||||
| void runTest() override | void runTest() override | ||||
| { | { | ||||
| Random r = getRandom(); | |||||
| auto r = getRandom(); | |||||
| beginTest ("Round-trip conversion: Int8"); | beginTest ("Round-trip conversion: Int8"); | ||||
| Test1 <AudioData::Int8>::test (*this, r); | Test1 <AudioData::Int8>::test (*this, r); | ||||
| beginTest ("Round-trip conversion: Int16"); | beginTest ("Round-trip conversion: Int16"); | ||||
| @@ -1080,7 +1080,7 @@ private: | |||||
| allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32; | allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (Type) + channelListSize + 32; | ||||
| allocatedData.malloc (allocatedBytes); | allocatedData.malloc (allocatedBytes); | ||||
| channels = reinterpret_cast<Type**> (allocatedData.get()); | channels = reinterpret_cast<Type**> (allocatedData.get()); | ||||
| auto* chan = (Type*) (allocatedData + channelListSize); | |||||
| auto chan = reinterpret_cast<Type*> (allocatedData + channelListSize); | |||||
| for (int i = 0; i < numChannels; ++i) | for (int i = 0; i < numChannels; ++i) | ||||
| { | { | ||||
| @@ -878,7 +878,7 @@ void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, cons | |||||
| JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, ) | JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, ) | ||||
| #else | #else | ||||
| JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = (float) src[i] * multiplier, | JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = (float) src[i] * multiplier, | ||||
| Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 ((const __m128i*) src))), | |||||
| Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 (reinterpret_cast<const __m128i*> (src)))), | |||||
| JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, | JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, | ||||
| const Mode::ParallelType mult = Mode::load1 (multiplier);) | const Mode::ParallelType mult = Mode::load1 (multiplier);) | ||||
| #endif | #endif | ||||
| @@ -72,7 +72,7 @@ public: | |||||
| MPESynthesiser (MPEInstrument* instrument); | MPESynthesiser (MPEInstrument* instrument); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~MPESynthesiser(); | |||||
| ~MPESynthesiser() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Deletes all voices. */ | /** Deletes all voices. */ | ||||
| @@ -66,7 +66,7 @@ public: | |||||
| The input source may be deleted depending on whether the deleteSourceWhenDeleted | The input source may be deleted depending on whether the deleteSourceWhenDeleted | ||||
| flag was set in the constructor. | flag was set in the constructor. | ||||
| */ | */ | ||||
| ~BufferingAudioSource(); | |||||
| ~BufferingAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Implementation of the AudioSource method. */ | /** Implementation of the AudioSource method. */ | ||||
| @@ -56,7 +56,7 @@ public: | |||||
| bool deleteSourceWhenDeleted); | bool deleteSourceWhenDeleted); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~ChannelRemappingAudioSource(); | |||||
| ~ChannelRemappingAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Specifies a number of channels that this audio source must produce from its | /** Specifies a number of channels that this audio source must produce from its | ||||
| @@ -43,7 +43,7 @@ public: | |||||
| bool deleteInputWhenDeleted); | bool deleteInputWhenDeleted); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~IIRFilterAudioSource(); | |||||
| ~IIRFilterAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Changes the filter to use the same parameters as the one being passed in. */ | /** Changes the filter to use the same parameters as the one being passed in. */ | ||||
| @@ -41,7 +41,7 @@ public: | |||||
| MixerAudioSource(); | MixerAudioSource(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~MixerAudioSource(); | |||||
| ~MixerAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Adds an input source to the mixer. | /** Adds an input source to the mixer. | ||||
| @@ -47,7 +47,7 @@ public: | |||||
| int numChannels = 2); | int numChannels = 2); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~ResamplingAudioSource(); | |||||
| ~ResamplingAudioSource() override; | |||||
| /** Changes the resampling ratio. | /** Changes the resampling ratio. | ||||
| @@ -44,7 +44,7 @@ public: | |||||
| bool deleteInputWhenDeleted); | bool deleteInputWhenDeleted); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~ReverbAudioSource(); | |||||
| ~ReverbAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Returns the parameters from the reverb. */ | /** Returns the parameters from the reverb. */ | ||||
| @@ -38,7 +38,7 @@ public: | |||||
| ToneGeneratorAudioSource(); | ToneGeneratorAudioSource(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~ToneGeneratorAudioSource(); | |||||
| ~ToneGeneratorAudioSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Sets the signal's amplitude. */ | /** Sets the signal's amplitude. */ | ||||
| @@ -217,6 +217,18 @@ void Synthesiser::processNextBlock (AudioBuffer<floatType>& outputAudio, | |||||
| template void Synthesiser::processNextBlock<float> (AudioBuffer<float>&, const MidiBuffer&, int, int); | template void Synthesiser::processNextBlock<float> (AudioBuffer<float>&, const MidiBuffer&, int, int); | ||||
| template void Synthesiser::processNextBlock<double> (AudioBuffer<double>&, const MidiBuffer&, int, int); | template void Synthesiser::processNextBlock<double> (AudioBuffer<double>&, const MidiBuffer&, int, int); | ||||
| void Synthesiser::renderNextBlock (AudioBuffer<float>& outputAudio, const MidiBuffer& inputMidi, | |||||
| int startSample, int numSamples) | |||||
| { | |||||
| processNextBlock (outputAudio, inputMidi, startSample, numSamples); | |||||
| } | |||||
| void Synthesiser::renderNextBlock (AudioBuffer<double>& outputAudio, const MidiBuffer& inputMidi, | |||||
| int startSample, int numSamples) | |||||
| { | |||||
| processNextBlock (outputAudio, inputMidi, startSample, numSamples); | |||||
| } | |||||
| void Synthesiser::renderVoices (AudioBuffer<float>& buffer, int startSample, int numSamples) | void Synthesiser::renderVoices (AudioBuffer<float>& buffer, int startSample, int numSamples) | ||||
| { | { | ||||
| for (auto* voice : voices) | for (auto* voice : voices) | ||||
| @@ -525,21 +525,15 @@ public: | |||||
| both to the audio output buffer and the midi input buffer, so any midi events | both to the audio output buffer and the midi input buffer, so any midi events | ||||
| with timestamps outside the specified region will be ignored. | with timestamps outside the specified region will be ignored. | ||||
| */ | */ | ||||
| inline void renderNextBlock (AudioBuffer<float>& outputAudio, | |||||
| const MidiBuffer& inputMidi, | |||||
| int startSample, | |||||
| int numSamples) | |||||
| { | |||||
| processNextBlock (outputAudio, inputMidi, startSample, numSamples); | |||||
| } | |||||
| void renderNextBlock (AudioBuffer<float>& outputAudio, | |||||
| const MidiBuffer& inputMidi, | |||||
| int startSample, | |||||
| int numSamples); | |||||
| inline void renderNextBlock (AudioBuffer<double>& outputAudio, | |||||
| const MidiBuffer& inputMidi, | |||||
| int startSample, | |||||
| int numSamples) | |||||
| { | |||||
| processNextBlock (outputAudio, inputMidi, startSample, numSamples); | |||||
| } | |||||
| void renderNextBlock (AudioBuffer<double>& outputAudio, | |||||
| const MidiBuffer& inputMidi, | |||||
| int startSample, | |||||
| int numSamples); | |||||
| /** Returns the current target sample rate at which rendering is being done. | /** Returns the current target sample rate at which rendering is being done. | ||||
| Subclasses may need to know this so that they can pitch things correctly. | Subclasses may need to know this so that they can pitch things correctly. | ||||
| @@ -632,12 +626,6 @@ protected: | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| template <typename floatType> | |||||
| void processNextBlock (AudioBuffer<floatType>& outputAudio, | |||||
| const MidiBuffer& inputMidi, | |||||
| int startSample, | |||||
| int numSamples); | |||||
| //============================================================================== | |||||
| double sampleRate = 0; | double sampleRate = 0; | ||||
| uint32 lastNoteOnCounter = 0; | uint32 lastNoteOnCounter = 0; | ||||
| int minimumSubBlockSize = 32; | int minimumSubBlockSize = 32; | ||||
| @@ -645,6 +633,9 @@ private: | |||||
| bool shouldStealNotes = true; | bool shouldStealNotes = true; | ||||
| BigInteger sustainPedalsDown; | BigInteger sustainPedalsDown; | ||||
| template <typename floatType> | |||||
| void processNextBlock (AudioBuffer<floatType>&, const MidiBuffer&, int startSample, int numSamples); | |||||
| #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | #if JUCE_CATCH_DEPRECATED_CODE_MISUSE | ||||
| // Note the new parameters for these methods. | // Note the new parameters for these methods. | ||||
| virtual int findFreeVoice (const bool) const { return 0; } | virtual int findFreeVoice (const bool) const { return 0; } | ||||
| @@ -44,7 +44,7 @@ public: | |||||
| MidiMessageCollector(); | MidiMessageCollector(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~MidiMessageCollector(); | |||||
| ~MidiMessageCollector() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Clears any messages from the queue. | /** Clears any messages from the queue. | ||||
| @@ -81,7 +81,7 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~MidiOutput(); | |||||
| ~MidiOutput() override; | |||||
| /** Returns the name of this device. */ | /** Returns the name of this device. */ | ||||
| const String& getName() const noexcept { return name; } | const String& getName() const noexcept { return name; } | ||||
| @@ -181,7 +181,7 @@ public: | |||||
| AudioObjectAddPropertyListener (deviceID, &pa, deviceListenerProc, this); | AudioObjectAddPropertyListener (deviceID, &pa, deviceListenerProc, this); | ||||
| } | } | ||||
| ~CoreAudioInternal() | |||||
| ~CoreAudioInternal() override | |||||
| { | { | ||||
| AudioObjectPropertyAddress pa; | AudioObjectPropertyAddress pa; | ||||
| pa.mSelector = kAudioObjectPropertySelectorWildcard; | pa.mSelector = kAudioObjectPropertySelectorWildcard; | ||||
| @@ -980,7 +980,7 @@ public: | |||||
| AudioObjectAddPropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, internal.get()); | AudioObjectAddPropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, internal.get()); | ||||
| } | } | ||||
| ~CoreAudioIODevice() | |||||
| ~CoreAudioIODevice() override | |||||
| { | { | ||||
| close(); | close(); | ||||
| @@ -1217,7 +1217,7 @@ public: | |||||
| { | { | ||||
| } | } | ||||
| ~AudioIODeviceCombiner() | |||||
| ~AudioIODeviceCombiner() override | |||||
| { | { | ||||
| close(); | close(); | ||||
| devices.clear(); | devices.clear(); | ||||
| @@ -1806,7 +1806,7 @@ private: | |||||
| d->setDeviceWrapperRestartCallback ([this] { owner.restartAsync(); }); | d->setDeviceWrapperRestartCallback ([this] { owner.restartAsync(); }); | ||||
| } | } | ||||
| ~DeviceWrapper() | |||||
| ~DeviceWrapper() override | |||||
| { | { | ||||
| close(); | close(); | ||||
| } | } | ||||
| @@ -2018,7 +2018,7 @@ public: | |||||
| AudioObjectAddPropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, this); | AudioObjectAddPropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, this); | ||||
| } | } | ||||
| ~CoreAudioIODeviceType() | |||||
| ~CoreAudioIODeviceType() override | |||||
| { | { | ||||
| AudioObjectPropertyAddress pa; | AudioObjectPropertyAddress pa; | ||||
| pa.mSelector = kAudioHardwarePropertyDevices; | pa.mSelector = kAudioHardwarePropertyDevices; | ||||
| @@ -45,7 +45,7 @@ public: | |||||
| Make sure this object isn't still being used by an AudioIODevice before | Make sure this object isn't still being used by an AudioIODevice before | ||||
| deleting it! | deleting it! | ||||
| */ | */ | ||||
| virtual ~AudioSourcePlayer(); | |||||
| ~AudioSourcePlayer() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Changes the current audio source to play from. | /** Changes the current audio source to play from. | ||||
| @@ -49,7 +49,7 @@ public: | |||||
| AudioTransportSource(); | AudioTransportSource(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioTransportSource(); | |||||
| ~AudioTransportSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Sets the reader that is being used as the input source. | /** Sets the reader that is being used as the input source. | ||||
| @@ -651,7 +651,7 @@ public: | |||||
| writeHeader(); | writeHeader(); | ||||
| } | } | ||||
| ~AiffAudioFormatWriter() | |||||
| ~AiffAudioFormatWriter() override | |||||
| { | { | ||||
| if ((bytesWritten & 1) != 0) | if ((bytesWritten & 1) != 0) | ||||
| output->writeByte (0); | output->writeByte (0); | ||||
| @@ -43,7 +43,7 @@ public: | |||||
| AiffAudioFormat(); | AiffAudioFormat(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AiffAudioFormat(); | |||||
| ~AiffAudioFormat() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Metadata property name used when reading a aiff file with a basc chunk. */ | /** Metadata property name used when reading a aiff file with a basc chunk. */ | ||||
| @@ -447,7 +447,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| ~CoreAudioReader() | |||||
| ~CoreAudioReader() override | |||||
| { | { | ||||
| ExtAudioFileDispose (audioFileRef); | ExtAudioFileDispose (audioFileRef); | ||||
| AudioFileClose (audioFileID); | AudioFileClose (audioFileID); | ||||
| @@ -48,7 +48,7 @@ public: | |||||
| CoreAudioFormat(); | CoreAudioFormat(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~CoreAudioFormat(); | |||||
| ~CoreAudioFormat() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Metadata property name used when reading a caf file with a MIDI chunk. */ | /** Metadata property name used when reading a caf file with a MIDI chunk. */ | ||||
| @@ -204,7 +204,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| ~FlacReader() | |||||
| ~FlacReader() override | |||||
| { | { | ||||
| FlacNamespace::FLAC__stream_decoder_delete (decoder); | FlacNamespace::FLAC__stream_decoder_delete (decoder); | ||||
| } | } | ||||
| @@ -404,7 +404,7 @@ public: | |||||
| this) == FlacNamespace::FLAC__STREAM_ENCODER_INIT_STATUS_OK; | this) == FlacNamespace::FLAC__STREAM_ENCODER_INIT_STATUS_OK; | ||||
| } | } | ||||
| ~FlacWriter() | |||||
| ~FlacWriter() override | |||||
| { | { | ||||
| if (ok) | if (ok) | ||||
| { | { | ||||
| @@ -44,7 +44,7 @@ class JUCE_API FlacAudioFormat : public AudioFormat | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| FlacAudioFormat(); | FlacAudioFormat(); | ||||
| ~FlacAudioFormat(); | |||||
| ~FlacAudioFormat() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| Array<int> getPossibleSampleRates() override; | Array<int> getPossibleSampleRates() override; | ||||
| @@ -149,7 +149,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| ~OggReader() | |||||
| ~OggReader() override | |||||
| { | { | ||||
| ov_clear (&ovFile); | ov_clear (&ovFile); | ||||
| } | } | ||||
| @@ -322,7 +322,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| ~OggWriter() | |||||
| ~OggWriter() override | |||||
| { | { | ||||
| if (ok) | if (ok) | ||||
| { | { | ||||
| @@ -44,7 +44,7 @@ class JUCE_API OggVorbisAudioFormat : public AudioFormat | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| OggVorbisAudioFormat(); | OggVorbisAudioFormat(); | ||||
| ~OggVorbisAudioFormat(); | |||||
| ~OggVorbisAudioFormat() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| Array<int> getPossibleSampleRates() override; | Array<int> getPossibleSampleRates() override; | ||||
| @@ -1319,7 +1319,7 @@ public: | |||||
| writeHeader(); | writeHeader(); | ||||
| } | } | ||||
| ~WavAudioFormatWriter() | |||||
| ~WavAudioFormatWriter() override | |||||
| { | { | ||||
| writeHeader(); | writeHeader(); | ||||
| } | } | ||||
| @@ -43,7 +43,7 @@ public: | |||||
| WavAudioFormat(); | WavAudioFormat(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~WavAudioFormat(); | |||||
| ~WavAudioFormat() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| // BWAV chunk properties: | // BWAV chunk properties: | ||||
| @@ -1949,7 +1949,7 @@ long ov_read_filter(OggVorbis_File *vf,char *buffer,int length, | |||||
| vorbis_fpu_setround(&fpu); | vorbis_fpu_setround(&fpu); | ||||
| for(i=0;i<channels;i++) { /* It's faster in this order */ | for(i=0;i<channels;i++) { /* It's faster in this order */ | ||||
| float *src=pcm[i]; | float *src=pcm[i]; | ||||
| short *dest=((short *)buffer)+i; | |||||
| short *dest=(reinterpret_cast<short*> (buffer))+i; | |||||
| for(j=0;j<samples;j++) { | for(j=0;j<samples;j++) { | ||||
| val=vorbis_ftoi(src[j]*32768.f); | val=vorbis_ftoi(src[j]*32768.f); | ||||
| if(val>32767)val=32767; | if(val>32767)val=32767; | ||||
| @@ -1965,7 +1965,7 @@ long ov_read_filter(OggVorbis_File *vf,char *buffer,int length, | |||||
| vorbis_fpu_setround(&fpu); | vorbis_fpu_setround(&fpu); | ||||
| for(i=0;i<channels;i++) { | for(i=0;i<channels;i++) { | ||||
| float *src=pcm[i]; | float *src=pcm[i]; | ||||
| short *dest=((short *)buffer)+i; | |||||
| short *dest=(reinterpret_cast<short*> (buffer))+i; | |||||
| for(j=0;j<samples;j++) { | for(j=0;j<samples;j++) { | ||||
| val=vorbis_ftoi(src[j]*32768.f); | val=vorbis_ftoi(src[j]*32768.f); | ||||
| if(val>32767)val=32767; | if(val>32767)val=32767; | ||||
| @@ -51,7 +51,7 @@ public: | |||||
| bool deleteReaderWhenThisIsDeleted); | bool deleteReaderWhenThisIsDeleted); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioFormatReaderSource(); | |||||
| ~AudioFormatReaderSource() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Toggles loop-mode. | /** Toggles loop-mode. | ||||
| @@ -222,7 +222,7 @@ public: | |||||
| timeSliceThread.addTimeSliceClient (this); | timeSliceThread.addTimeSliceClient (this); | ||||
| } | } | ||||
| ~Buffer() | |||||
| ~Buffer() override | |||||
| { | { | ||||
| isRunning = false; | isRunning = false; | ||||
| timeSliceThread.removeTimeSliceClient (this); | timeSliceThread.removeTimeSliceClient (this); | ||||
| @@ -63,7 +63,7 @@ public: | |||||
| bool deleteSourceWhenDeleted); | bool deleteSourceWhenDeleted); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioSubsectionReader(); | |||||
| ~AudioSubsectionReader() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -54,7 +54,7 @@ public: | |||||
| TimeSliceThread& timeSliceThread, | TimeSliceThread& timeSliceThread, | ||||
| int samplesToBuffer); | int samplesToBuffer); | ||||
| ~BufferingAudioReader(); | |||||
| ~BufferingAudioReader() override; | |||||
| /** Sets a number of milliseconds that the reader can block for in its readSamples() | /** Sets a number of milliseconds that the reader can block for in its readSamples() | ||||
| method before giving up and returning silence. | method before giving up and returning silence. | ||||
| @@ -72,7 +72,7 @@ public: | |||||
| double maxSampleLengthSeconds); | double maxSampleLengthSeconds); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~SamplerSound(); | |||||
| ~SamplerSound() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Returns the sample's name */ | /** Returns the sample's name */ | ||||
| @@ -126,7 +126,7 @@ public: | |||||
| SamplerVoice(); | SamplerVoice(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~SamplerVoice(); | |||||
| ~SamplerVoice() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| bool canPlaySound (SynthesiserSound*) override; | bool canPlaySound (SynthesiserSound*) override; | ||||
| @@ -59,7 +59,7 @@ public: | |||||
| Make sure that you delete any UI components that belong to this plugin before | Make sure that you delete any UI components that belong to this plugin before | ||||
| deleting the plugin. | deleting the plugin. | ||||
| */ | */ | ||||
| virtual ~AudioPluginInstance() {} | |||||
| ~AudioPluginInstance() override {} | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Fills-in the appropriate parts of this plugin description object. */ | /** Fills-in the appropriate parts of this plugin description object. */ | ||||
| @@ -110,10 +110,10 @@ protected: | |||||
| struct Parameter : public AudioProcessorParameter | struct Parameter : public AudioProcessorParameter | ||||
| { | { | ||||
| Parameter(); | Parameter(); | ||||
| virtual ~Parameter(); | |||||
| ~Parameter() override; | |||||
| virtual String getText (float value, int maximumStringLength) const override; | |||||
| virtual float getValueForText (const String& text) const override; | |||||
| String getText (float value, int maximumStringLength) const override; | |||||
| float getValueForText (const String& text) const override; | |||||
| StringArray onStrings, offStrings; | StringArray onStrings, offStrings; | ||||
| }; | }; | ||||
| @@ -53,7 +53,7 @@ protected: | |||||
| public: | public: | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioProcessorEditor(); | |||||
| ~AudioProcessorEditor() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -55,7 +55,7 @@ public: | |||||
| /** Destructor. | /** Destructor. | ||||
| Any processor objects that have been added to the graph will also be deleted. | Any processor objects that have been added to the graph will also be deleted. | ||||
| */ | */ | ||||
| ~AudioProcessorGraph(); | |||||
| ~AudioProcessorGraph() override; | |||||
| /** Each node in the graph has a UID of this type. */ | /** Each node in the graph has a UID of this type. */ | ||||
| struct NodeID | struct NodeID | ||||
| @@ -322,7 +322,7 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| AudioGraphIOProcessor (IODeviceType); | AudioGraphIOProcessor (IODeviceType); | ||||
| ~AudioGraphIOProcessor(); | |||||
| ~AudioGraphIOProcessor() override; | |||||
| const String getName() const override; | const String getName() const override; | ||||
| void fillInPluginDescription (PluginDescription&) const override; | void fillInPluginDescription (PluginDescription&) const override; | ||||
| @@ -43,7 +43,7 @@ public: | |||||
| startTimer (100); | startTimer (100); | ||||
| } | } | ||||
| virtual ~ParameterListener() | |||||
| ~ParameterListener() override | |||||
| { | { | ||||
| if (LegacyAudioParameter::isLegacy (¶meter)) | if (LegacyAudioParameter::isLegacy (¶meter)) | ||||
| processor.removeListener (this); | processor.removeListener (this); | ||||
| @@ -44,7 +44,7 @@ class JUCE_API GenericAudioProcessorEditor : public AudioProcessorEditor | |||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| GenericAudioProcessorEditor (AudioProcessor* owner); | GenericAudioProcessorEditor (AudioProcessor* owner); | ||||
| ~GenericAudioProcessorEditor(); | |||||
| ~GenericAudioProcessorEditor() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| void paint (Graphics&) override; | void paint (Graphics&) override; | ||||
| @@ -379,7 +379,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| ~Scanner() | |||||
| ~Scanner() override | |||||
| { | { | ||||
| if (pool != nullptr) | if (pool != nullptr) | ||||
| { | { | ||||
| @@ -53,7 +53,7 @@ public: | |||||
| bool allowPluginsWhichRequireAsynchronousInstantiation = false); | bool allowPluginsWhichRequireAsynchronousInstantiation = false); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~PluginListComponent(); | |||||
| ~PluginListComponent() override; | |||||
| /** Changes the text in the panel's options button. */ | /** Changes the text in the panel's options button. */ | ||||
| void setOptionsButtonText (const String& newText); | void setOptionsButtonText (const String& newText); | ||||
| @@ -56,7 +56,7 @@ public: | |||||
| std::function<bool (const String& text)> boolFromString = nullptr); | std::function<bool (const String& text)> boolFromString = nullptr); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioParameterBool(); | |||||
| ~AudioParameterBool() override; | |||||
| /** Returns the parameter's current boolean value. */ | /** Returns the parameter's current boolean value. */ | ||||
| bool get() const noexcept { return value >= 0.5f; } | bool get() const noexcept { return value >= 0.5f; } | ||||
| @@ -60,7 +60,7 @@ public: | |||||
| std::function<int (const String& text)> indexFromString = nullptr); | std::function<int (const String& text)> indexFromString = nullptr); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioParameterChoice(); | |||||
| ~AudioParameterChoice() override; | |||||
| /** Returns the current index of the selected item. */ | /** Returns the current index of the selected item. */ | ||||
| int getIndex() const noexcept { return roundToInt (value); } | int getIndex() const noexcept { return roundToInt (value); } | ||||
| @@ -74,7 +74,7 @@ public: | |||||
| float defaultValue); | float defaultValue); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioParameterFloat(); | |||||
| ~AudioParameterFloat() override; | |||||
| /** Returns the parameter's current value. */ | /** Returns the parameter's current value. */ | ||||
| float get() const noexcept { return value; } | float get() const noexcept { return value; } | ||||
| @@ -61,7 +61,7 @@ public: | |||||
| std::function<int (const String& text)> intFromString = nullptr); | std::function<int (const String& text)> intFromString = nullptr); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioParameterInt(); | |||||
| ~AudioParameterInt() override; | |||||
| /** Returns the parameter's current value as an integer. */ | /** Returns the parameter's current value as an integer. */ | ||||
| int get() const noexcept { return roundToInt (value); } | int get() const noexcept { return roundToInt (value); } | ||||
| @@ -46,7 +46,7 @@ public: | |||||
| Category category = AudioProcessorParameter::genericParameter); | Category category = AudioProcessorParameter::genericParameter); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioProcessorParameterWithID(); | |||||
| ~AudioProcessorParameterWithID() override; | |||||
| /** Provides access to the parameter's ID string. */ | /** Provides access to the parameter's ID string. */ | ||||
| const String paramID; | const String paramID; | ||||
| @@ -80,7 +80,7 @@ public: | |||||
| parameter.addListener (this); | parameter.addListener (this); | ||||
| } | } | ||||
| ~ParameterAdapter() noexcept { parameter.removeListener (this); } | |||||
| ~ParameterAdapter() override { parameter.removeListener (this); } | |||||
| void addListener (Listener* l) { listeners.add (l); } | void addListener (Listener* l) { listeners.add (l); } | ||||
| void removeListener (Listener* l) { listeners.remove (l); } | void removeListener (Listener* l) { listeners.remove (l); } | ||||
| @@ -586,7 +586,7 @@ struct AudioProcessorValueTreeState::SliderAttachment::Pimpl : private Attached | |||||
| slider.addListener (this); | slider.addListener (this); | ||||
| } | } | ||||
| ~Pimpl() | |||||
| ~Pimpl() override | |||||
| { | { | ||||
| slider.removeListener (this); | slider.removeListener (this); | ||||
| removeListener(); | removeListener(); | ||||
| @@ -638,7 +638,7 @@ struct AudioProcessorValueTreeState::ComboBoxAttachment::Pimpl : private Attach | |||||
| combo.addListener (this); | combo.addListener (this); | ||||
| } | } | ||||
| ~Pimpl() | |||||
| ~Pimpl() override | |||||
| { | { | ||||
| combo.removeListener (this); | combo.removeListener (this); | ||||
| removeListener(); | removeListener(); | ||||
| @@ -707,7 +707,7 @@ struct AudioProcessorValueTreeState::ButtonAttachment::Pimpl : private Attached | |||||
| button.addListener (this); | button.addListener (this); | ||||
| } | } | ||||
| ~Pimpl() | |||||
| ~Pimpl() override | |||||
| { | { | ||||
| button.removeListener (this); | button.removeListener (this); | ||||
| removeListener(); | removeListener(); | ||||
| @@ -220,7 +220,7 @@ public: | |||||
| AudioProcessorValueTreeState (AudioProcessor& processorToConnectTo, UndoManager* undoManagerToUse); | AudioProcessorValueTreeState (AudioProcessor& processorToConnectTo, UndoManager* undoManagerToUse); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioProcessorValueTreeState(); | |||||
| ~AudioProcessorValueTreeState() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** This function is deprecated and will be removed in a future version of JUCE! | /** This function is deprecated and will be removed in a future version of JUCE! | ||||
| @@ -36,7 +36,7 @@ struct SimpleDeviceManagerInputLevelMeter : public Component, | |||||
| inputLevelGetter = manager.getInputLevelGetter(); | inputLevelGetter = manager.getInputLevelGetter(); | ||||
| } | } | ||||
| ~SimpleDeviceManagerInputLevelMeter() | |||||
| ~SimpleDeviceManagerInputLevelMeter() override | |||||
| { | { | ||||
| } | } | ||||
| @@ -218,7 +218,7 @@ public: | |||||
| setup.manager->addChangeListener (this); | setup.manager->addChangeListener (this); | ||||
| } | } | ||||
| ~AudioDeviceSettingsPanel() | |||||
| ~AudioDeviceSettingsPanel() override | |||||
| { | { | ||||
| setup.manager->removeChangeListener (this); | setup.manager->removeChangeListener (this); | ||||
| } | } | ||||
| @@ -73,7 +73,7 @@ public: | |||||
| bool hideAdvancedOptionsWithButton); | bool hideAdvancedOptionsWithButton); | ||||
| /** Destructor */ | /** Destructor */ | ||||
| ~AudioDeviceSelectorComponent(); | |||||
| ~AudioDeviceSelectorComponent() override; | |||||
| /** The device manager that this component is controlling */ | /** The device manager that this component is controlling */ | ||||
| AudioDeviceManager& deviceManager; | AudioDeviceManager& deviceManager; | ||||
| @@ -98,7 +98,7 @@ public: | |||||
| { | { | ||||
| } | } | ||||
| ~LevelDataSource() | |||||
| ~LevelDataSource() override | |||||
| { | { | ||||
| owner.cache.getTimeSliceThread().removeTimeSliceClient (this); | owner.cache.getTimeSliceThread().removeTimeSliceClient (this); | ||||
| } | } | ||||
| @@ -68,7 +68,7 @@ public: | |||||
| AudioThumbnailCache& cacheToUse); | AudioThumbnailCache& cacheToUse); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioThumbnail(); | |||||
| ~AudioThumbnail() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Clears and resets the thumbnail. */ | /** Clears and resets the thumbnail. */ | ||||
| @@ -51,7 +51,7 @@ public: | |||||
| AudioVisualiserComponent (int initialNumChannels); | AudioVisualiserComponent (int initialNumChannels); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~AudioVisualiserComponent(); | |||||
| ~AudioVisualiserComponent() override; | |||||
| /** Changes the number of channels that the visualiser stores. */ | /** Changes the number of channels that the visualiser stores. */ | ||||
| void setNumChannels (int numChannels); | void setNumChannels (int numChannels); | ||||
| @@ -73,7 +73,7 @@ public: | |||||
| Orientation orientation); | Orientation orientation); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| ~MidiKeyboardComponent(); | |||||
| ~MidiKeyboardComponent() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Changes the velocity used in midi note-on messages that are triggered by clicking | /** Changes the velocity used in midi note-on messages that are triggered by clicking | ||||
| @@ -50,7 +50,7 @@ public: | |||||
| AudioProcessorPlayer (bool doDoublePrecisionProcessing = false); | AudioProcessorPlayer (bool doDoublePrecisionProcessing = false); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| virtual ~AudioProcessorPlayer(); | |||||
| ~AudioProcessorPlayer() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Sets the processor that should be played. | /** Sets the processor that should be played. | ||||
| @@ -67,7 +67,7 @@ struct AutoRemovingTransportSource : public AudioTransportSource, | |||||
| startTimerHz (10); | startTimerHz (10); | ||||
| } | } | ||||
| ~AutoRemovingTransportSource() | |||||
| ~AutoRemovingTransportSource() override | |||||
| { | { | ||||
| setSource (nullptr); | setSource (nullptr); | ||||
| } | } | ||||
| @@ -36,14 +36,14 @@ namespace juce | |||||
| @tags{Audio} | @tags{Audio} | ||||
| */ | */ | ||||
| class JUCE_API SoundPlayer : public AudioIODeviceCallback | |||||
| class JUCE_API SoundPlayer : public AudioIODeviceCallback | |||||
| { | { | ||||
| public: | public: | ||||
| //============================================================================== | //============================================================================== | ||||
| SoundPlayer(); | SoundPlayer(); | ||||
| /** Destructor. */ | /** Destructor. */ | ||||
| virtual ~SoundPlayer(); | |||||
| ~SoundPlayer() override; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Plays a sound from a file. */ | /** Plays a sound from a file. */ | ||||