| @@ -57,9 +57,7 @@ public: | |||||
| : numChannels (numChannelsToAllocate), | : numChannels (numChannelsToAllocate), | ||||
| size (numSamplesToAllocate) | size (numSamplesToAllocate) | ||||
| { | { | ||||
| jassert (size >= 0); | |||||
| jassert (numChannels >= 0); | |||||
| jassert (size >= 0 && numChannels >= 0); | |||||
| allocateData(); | allocateData(); | ||||
| } | } | ||||
| @@ -233,7 +231,7 @@ public: | |||||
| const Type* getReadPointer (int channelNumber) const noexcept | const Type* getReadPointer (int channelNumber) const noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
| return channels [channelNumber]; | |||||
| return channels[channelNumber]; | |||||
| } | } | ||||
| /** Returns a pointer to an array of read-only samples in one of the buffer's channels. | /** Returns a pointer to an array of read-only samples in one of the buffer's channels. | ||||
| @@ -247,7 +245,7 @@ public: | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
| jassert (isPositiveAndBelow (sampleIndex, size)); | jassert (isPositiveAndBelow (sampleIndex, size)); | ||||
| return channels [channelNumber] + sampleIndex; | |||||
| return channels[channelNumber] + sampleIndex; | |||||
| } | } | ||||
| /** Returns a writeable pointer to one of the buffer's channels. | /** Returns a writeable pointer to one of the buffer's channels. | ||||
| @@ -260,7 +258,7 @@ public: | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
| isClear = false; | isClear = false; | ||||
| return channels [channelNumber]; | |||||
| return channels[channelNumber]; | |||||
| } | } | ||||
| /** Returns a writeable pointer to one of the buffer's channels. | /** Returns a writeable pointer to one of the buffer's channels. | ||||
| @@ -274,7 +272,7 @@ public: | |||||
| jassert (isPositiveAndBelow (channelNumber, numChannels)); | jassert (isPositiveAndBelow (channelNumber, numChannels)); | ||||
| jassert (isPositiveAndBelow (sampleIndex, size)); | jassert (isPositiveAndBelow (sampleIndex, size)); | ||||
| isClear = false; | isClear = false; | ||||
| return channels [channelNumber] + sampleIndex; | |||||
| return channels[channelNumber] + sampleIndex; | |||||
| } | } | ||||
| /** Returns an array of pointers to the channels in the buffer. | /** Returns an array of pointers to the channels in the buffer. | ||||
| @@ -322,20 +320,20 @@ public: | |||||
| if (newNumSamples != size || newNumChannels != numChannels) | if (newNumSamples != size || newNumChannels != numChannels) | ||||
| { | { | ||||
| const size_t allocatedSamplesPerChannel = ((size_t) newNumSamples + 3) & ~3u; | |||||
| const size_t channelListSize = ((sizeof (Type*) * (size_t) (newNumChannels + 1)) + 15) & ~15u; | |||||
| const size_t newTotalBytes = ((size_t) newNumChannels * (size_t) allocatedSamplesPerChannel * sizeof (Type)) | |||||
| + channelListSize + 32; | |||||
| const auto allocatedSamplesPerChannel = ((size_t) newNumSamples + 3) & ~3u; | |||||
| const auto channelListSize = ((sizeof (Type*) * (size_t) (newNumChannels + 1)) + 15) & ~15u; | |||||
| const auto newTotalBytes = ((size_t) newNumChannels * (size_t) allocatedSamplesPerChannel * sizeof (Type)) | |||||
| + channelListSize + 32; | |||||
| if (keepExistingContent) | if (keepExistingContent) | ||||
| { | { | ||||
| HeapBlock<char, true> newData; | HeapBlock<char, true> newData; | ||||
| newData.allocate (newTotalBytes, clearExtraSpace || isClear); | newData.allocate (newTotalBytes, clearExtraSpace || isClear); | ||||
| const size_t numSamplesToCopy = (size_t) jmin (newNumSamples, size); | |||||
| auto numSamplesToCopy = (size_t) jmin (newNumSamples, size); | |||||
| Type** const newChannels = reinterpret_cast<Type**> (newData.getData()); | |||||
| Type* newChan = reinterpret_cast<Type*> (newData + channelListSize); | |||||
| auto newChannels = reinterpret_cast<Type**> (newData.getData()); | |||||
| auto newChan = reinterpret_cast<Type*> (newData + channelListSize); | |||||
| for (int j = 0; j < newNumChannels; ++j) | for (int j = 0; j < newNumChannels; ++j) | ||||
| { | { | ||||
| @@ -345,7 +343,8 @@ public: | |||||
| if (! isClear) | if (! isClear) | ||||
| { | { | ||||
| const int numChansToCopy = jmin (numChannels, newNumChannels); | |||||
| auto numChansToCopy = jmin (numChannels, newNumChannels); | |||||
| for (int i = 0; i < numChansToCopy; ++i) | for (int i = 0; i < numChansToCopy; ++i) | ||||
| FloatVectorOperations::copy (newChannels[i], channels[i], (int) numSamplesToCopy); | FloatVectorOperations::copy (newChannels[i], channels[i], (int) numSamplesToCopy); | ||||
| } | } | ||||
| @@ -368,7 +367,8 @@ public: | |||||
| channels = reinterpret_cast<Type**> (allocatedData.getData()); | channels = reinterpret_cast<Type**> (allocatedData.getData()); | ||||
| } | } | ||||
| Type* chan = reinterpret_cast<Type*> (allocatedData + channelListSize); | |||||
| auto* chan = reinterpret_cast<Type*> (allocatedData + channelListSize); | |||||
| for (int i = 0; i < newNumChannels; ++i) | for (int i = 0; i < newNumChannels; ++i) | ||||
| { | { | ||||
| channels[i] = chan; | channels[i] = chan; | ||||
| @@ -376,7 +376,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| channels [newNumChannels] = 0; | |||||
| channels[newNumChannels] = 0; | |||||
| size = newNumSamples; | size = newNumSamples; | ||||
| numChannels = newNumChannels; | numChannels = newNumChannels; | ||||
| } | } | ||||
| @@ -466,8 +466,8 @@ public: | |||||
| for (int chan = 0; chan < numChannels; ++chan) | for (int chan = 0; chan < numChannels; ++chan) | ||||
| { | { | ||||
| Type* const dest = channels[chan]; | |||||
| const OtherType* const src = other.getReadPointer (chan); | |||||
| auto* dest = channels[chan]; | |||||
| auto* src = other.getReadPointer (chan); | |||||
| for (int i = 0; i < size; ++i) | for (int i = 0; i < size; ++i) | ||||
| dest[i] = static_cast<Type> (src[i]); | dest[i] = static_cast<Type> (src[i]); | ||||
| @@ -495,7 +495,7 @@ public: | |||||
| */ | */ | ||||
| void clear (int startSample, int numSamples) noexcept | void clear (int startSample, int numSamples) noexcept | ||||
| { | { | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (! isClear) | if (! isClear) | ||||
| { | { | ||||
| @@ -515,10 +515,10 @@ public: | |||||
| void clear (int channel, int startSample, int numSamples) noexcept | void clear (int channel, int startSample, int numSamples) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (! isClear) | if (! isClear) | ||||
| FloatVectorOperations::clear (channels [channel] + startSample, numSamples); | |||||
| FloatVectorOperations::clear (channels[channel] + startSample, numSamples); | |||||
| } | } | ||||
| /** Returns true if the buffer has been entirely cleared. | /** Returns true if the buffer has been entirely cleared. | ||||
| @@ -539,7 +539,7 @@ public: | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (isPositiveAndBelow (sampleIndex, size)); | jassert (isPositiveAndBelow (sampleIndex, size)); | ||||
| return *(channels [channel] + sampleIndex); | |||||
| return *(channels[channel] + sampleIndex); | |||||
| } | } | ||||
| /** Sets a sample in the buffer. | /** Sets a sample in the buffer. | ||||
| @@ -551,7 +551,7 @@ public: | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (isPositiveAndBelow (destSample, size)); | jassert (isPositiveAndBelow (destSample, size)); | ||||
| *(channels [destChannel] + destSample) = newValue; | |||||
| *(channels[destChannel] + destSample) = newValue; | |||||
| isClear = false; | isClear = false; | ||||
| } | } | ||||
| @@ -564,7 +564,7 @@ public: | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (isPositiveAndBelow (destSample, size)); | jassert (isPositiveAndBelow (destSample, size)); | ||||
| *(channels [destChannel] + destSample) += valueToAdd; | |||||
| *(channels[destChannel] + destSample) += valueToAdd; | |||||
| isClear = false; | isClear = false; | ||||
| } | } | ||||
| @@ -576,11 +576,11 @@ public: | |||||
| void applyGain (int channel, int startSample, int numSamples, Type gain) noexcept | void applyGain (int channel, int startSample, int numSamples, Type gain) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (gain != (Type) 1 && ! isClear) | if (gain != (Type) 1 && ! isClear) | ||||
| { | { | ||||
| Type* const d = channels [channel] + startSample; | |||||
| auto* d = channels[channel] + startSample; | |||||
| if (gain == 0) | if (gain == 0) | ||||
| FloatVectorOperations::clear (d, numSamples); | FloatVectorOperations::clear (d, numSamples); | ||||
| @@ -627,10 +627,10 @@ public: | |||||
| else | else | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| const Type increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels [channel] + startSample; | |||||
| const auto increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels[channel] + startSample; | |||||
| while (--numSamples >= 0) | while (--numSamples >= 0) | ||||
| { | { | ||||
| @@ -680,14 +680,14 @@ public: | |||||
| { | { | ||||
| jassert (&source != this || sourceChannel != destChannel); | jassert (&source != this || sourceChannel != destChannel); | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (isPositiveAndBelow (sourceChannel, source.numChannels)); | jassert (isPositiveAndBelow (sourceChannel, source.numChannels)); | ||||
| jassert (sourceStartSample >= 0 && sourceStartSample + numSamples <= source.size); | jassert (sourceStartSample >= 0 && sourceStartSample + numSamples <= source.size); | ||||
| if (gainToApplyToSource != 0 && numSamples > 0 && ! source.isClear) | if (gainToApplyToSource != 0 && numSamples > 0 && ! source.isClear) | ||||
| { | { | ||||
| auto* d = channels [destChannel] + destStartSample; | |||||
| const Type* const s = source.channels [sourceChannel] + sourceStartSample; | |||||
| auto* d = channels[destChannel] + destStartSample; | |||||
| auto* s = source.channels[sourceChannel] + sourceStartSample; | |||||
| if (isClear) | if (isClear) | ||||
| { | { | ||||
| @@ -727,12 +727,12 @@ public: | |||||
| Type gainToApplyToSource = (Type) 1) noexcept | Type gainToApplyToSource = (Type) 1) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | jassert (source != nullptr); | ||||
| if (gainToApplyToSource != 0 && numSamples > 0) | if (gainToApplyToSource != 0 && numSamples > 0) | ||||
| { | { | ||||
| auto* d = channels [destChannel] + destStartSample; | |||||
| auto* d = channels[destChannel] + destStartSample; | |||||
| if (isClear) | if (isClear) | ||||
| { | { | ||||
| @@ -772,21 +772,21 @@ public: | |||||
| Type startGain, | Type startGain, | ||||
| Type endGain) noexcept | Type endGain) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | |||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | |||||
| if (startGain == endGain) | if (startGain == endGain) | ||||
| { | { | ||||
| addFrom (destChannel, destStartSample, source, numSamples, startGain); | addFrom (destChannel, destStartSample, source, numSamples, startGain); | ||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if (numSamples > 0 && (startGain != 0 || endGain != 0)) | |||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | |||||
| if (numSamples > 0) | |||||
| { | { | ||||
| isClear = false; | isClear = false; | ||||
| const Type increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels [destChannel] + destStartSample; | |||||
| const auto increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels[destChannel] + destStartSample; | |||||
| while (--numSamples >= 0) | while (--numSamples >= 0) | ||||
| { | { | ||||
| @@ -819,20 +819,20 @@ public: | |||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | ||||
| jassert (isPositiveAndBelow (sourceChannel, source.numChannels)); | jassert (isPositiveAndBelow (sourceChannel, source.numChannels)); | ||||
| jassert (sourceStartSample >= 0 && sourceStartSample + numSamples <= source.size); | |||||
| jassert (sourceStartSample >= 0 && numSamples >= 0 && sourceStartSample + numSamples <= source.size); | |||||
| if (numSamples > 0) | if (numSamples > 0) | ||||
| { | { | ||||
| if (source.isClear) | if (source.isClear) | ||||
| { | { | ||||
| if (! isClear) | if (! isClear) | ||||
| FloatVectorOperations::clear (channels [destChannel] + destStartSample, numSamples); | |||||
| FloatVectorOperations::clear (channels[destChannel] + destStartSample, numSamples); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| isClear = false; | isClear = false; | ||||
| FloatVectorOperations::copy (channels [destChannel] + destStartSample, | |||||
| source.channels [sourceChannel] + sourceStartSample, | |||||
| FloatVectorOperations::copy (channels[destChannel] + destStartSample, | |||||
| source.channels[sourceChannel] + sourceStartSample, | |||||
| numSamples); | numSamples); | ||||
| } | } | ||||
| } | } | ||||
| @@ -853,13 +853,13 @@ public: | |||||
| int numSamples) noexcept | int numSamples) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | jassert (source != nullptr); | ||||
| if (numSamples > 0) | if (numSamples > 0) | ||||
| { | { | ||||
| isClear = false; | isClear = false; | ||||
| FloatVectorOperations::copy (channels [destChannel] + destStartSample, source, numSamples); | |||||
| FloatVectorOperations::copy (channels[destChannel] + destStartSample, source, numSamples); | |||||
| } | } | ||||
| } | } | ||||
| @@ -880,12 +880,12 @@ public: | |||||
| Type gain) noexcept | Type gain) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | jassert (isPositiveAndBelow (destChannel, numChannels)); | ||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | jassert (source != nullptr); | ||||
| if (numSamples > 0) | if (numSamples > 0) | ||||
| { | { | ||||
| auto* d = channels [destChannel] + destStartSample; | |||||
| auto* d = channels[destChannel] + destStartSample; | |||||
| if (gain != (Type) 1) | if (gain != (Type) 1) | ||||
| { | { | ||||
| @@ -928,21 +928,21 @@ public: | |||||
| Type startGain, | Type startGain, | ||||
| Type endGain) noexcept | Type endGain) noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | |||||
| jassert (destStartSample >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | |||||
| if (startGain == endGain) | if (startGain == endGain) | ||||
| { | { | ||||
| copyFrom (destChannel, destStartSample, source, numSamples, startGain); | copyFrom (destChannel, destStartSample, source, numSamples, startGain); | ||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if (numSamples > 0 && (startGain != 0 || endGain != 0)) | |||||
| jassert (isPositiveAndBelow (destChannel, numChannels)); | |||||
| jassert (destStartSample >= 0 && numSamples >= 0 && destStartSample + numSamples <= size); | |||||
| jassert (source != nullptr); | |||||
| if (numSamples > 0) | |||||
| { | { | ||||
| isClear = false; | isClear = false; | ||||
| const Type increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels [destChannel] + destStartSample; | |||||
| const auto increment = (endGain - startGain) / numSamples; | |||||
| auto* d = channels[destChannel] + destStartSample; | |||||
| while (--numSamples >= 0) | while (--numSamples >= 0) | ||||
| { | { | ||||
| @@ -962,19 +962,19 @@ public: | |||||
| Range<Type> findMinMax (int channel, int startSample, int numSamples) const noexcept | Range<Type> findMinMax (int channel, int startSample, int numSamples) const noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (isClear) | if (isClear) | ||||
| return {}; | return {}; | ||||
| return FloatVectorOperations::findMinAndMax (channels [channel] + startSample, numSamples); | |||||
| return FloatVectorOperations::findMinAndMax (channels[channel] + startSample, numSamples); | |||||
| } | } | ||||
| /** Finds the highest absolute sample value within a region of a channel. */ | /** Finds the highest absolute sample value within a region of a channel. */ | ||||
| Type getMagnitude (int channel, int startSample, int numSamples) const noexcept | Type getMagnitude (int channel, int startSample, int numSamples) const noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (isClear) | if (isClear) | ||||
| return {}; | return {}; | ||||
| @@ -1000,17 +1000,17 @@ public: | |||||
| Type getRMSLevel (int channel, int startSample, int numSamples) const noexcept | Type getRMSLevel (int channel, int startSample, int numSamples) const noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (numSamples <= 0 || channel < 0 || channel >= numChannels || isClear) | if (numSamples <= 0 || channel < 0 || channel >= numChannels || isClear) | ||||
| return {}; | return {}; | ||||
| const Type* const data = channels [channel] + startSample; | |||||
| auto* data = channels[channel] + startSample; | |||||
| double sum = 0.0; | double sum = 0.0; | ||||
| for (int i = 0; i < numSamples; ++i) | for (int i = 0; i < numSamples; ++i) | ||||
| { | { | ||||
| const Type sample = data [i]; | |||||
| const Type sample = data[i]; | |||||
| sum += sample * sample; | sum += sample * sample; | ||||
| } | } | ||||
| @@ -1021,7 +1021,7 @@ public: | |||||
| void reverse (int channel, int startSample, int numSamples) const noexcept | void reverse (int channel, int startSample, int numSamples) const noexcept | ||||
| { | { | ||||
| jassert (isPositiveAndBelow (channel, numChannels)); | jassert (isPositiveAndBelow (channel, numChannels)); | ||||
| jassert (startSample >= 0 && startSample + numSamples <= size); | |||||
| jassert (startSample >= 0 && numSamples >= 0 && startSample + numSamples <= size); | |||||
| if (! isClear) | if (! isClear) | ||||
| std::reverse (channels[channel] + startSample, | std::reverse (channels[channel] + startSample, | ||||
| @@ -1047,7 +1047,8 @@ private: | |||||
| void allocateData() | void allocateData() | ||||
| { | { | ||||
| const size_t channelListSize = sizeof (Type*) * (size_t) (numChannels + 1); | |||||
| jassert (size >= 0); | |||||
| auto channelListSize = sizeof (Type*) * (size_t) (numChannels + 1); | |||||
| 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.getData()); | channels = reinterpret_cast<Type**> (allocatedData.getData()); | ||||
| @@ -1059,11 +1060,11 @@ private: | |||||
| chan += size; | chan += size; | ||||
| } | } | ||||
| channels [numChannels] = nullptr; | |||||
| channels[numChannels] = nullptr; | |||||
| isClear = false; | isClear = false; | ||||
| } | } | ||||
| void allocateChannels (Type* const* const dataToReferTo, int offset) | |||||
| void allocateChannels (Type* const* dataToReferTo, int offset) | |||||
| { | { | ||||
| jassert (offset >= 0); | jassert (offset >= 0); | ||||
| @@ -1086,7 +1087,7 @@ private: | |||||
| channels[i] = dataToReferTo[i] + offset; | channels[i] = dataToReferTo[i] + offset; | ||||
| } | } | ||||
| channels [numChannels] = nullptr; | |||||
| channels[numChannels] = nullptr; | |||||
| isClear = false; | isClear = false; | ||||
| } | } | ||||