Browse Source

Improved some const-ness in AudioSampleBuffer.

tags/2021-05-28
jules 13 years ago
parent
commit
08539ed83e
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp
  2. +3
    -3
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h

+ 3
- 3
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.cpp View File

@@ -62,7 +62,7 @@ void AudioSampleBuffer::allocateData()
channels [numChannels] = 0; channels [numChannels] = 0;
} }
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo,
const int numChannels_, const int numChannels_,
const int numSamples) noexcept const int numSamples) noexcept
: numChannels (numChannels_), : numChannels (numChannels_),
@@ -73,7 +73,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
allocateChannels (dataToReferTo, 0); allocateChannels (dataToReferTo, 0);
} }
AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo,
const int numChannels_, const int numChannels_,
const int startSample, const int startSample,
const int numSamples) noexcept const int numSamples) noexcept
@@ -100,7 +100,7 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
allocateChannels (dataToReferTo, 0); allocateChannels (dataToReferTo, 0);
} }
void AudioSampleBuffer::allocateChannels (float** const dataToReferTo, int offset)
void AudioSampleBuffer::allocateChannels (float* const* const dataToReferTo, int offset)
{ {
// (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools) // (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools)
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))


+ 3
- 3
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h View File

@@ -63,7 +63,7 @@ public:
@param numSamples the number of samples to use - this must correspond to the @param numSamples the number of samples to use - this must correspond to the
size of the arrays passed in size of the arrays passed in
*/ */
AudioSampleBuffer (float** dataToReferTo,
AudioSampleBuffer (float* const* dataToReferTo,
int numChannels, int numChannels,
int numSamples) noexcept; int numSamples) noexcept;
@@ -83,7 +83,7 @@ public:
@param numSamples the number of samples to use - this must correspond to the @param numSamples the number of samples to use - this must correspond to the
size of the arrays passed in size of the arrays passed in
*/ */
AudioSampleBuffer (float** dataToReferTo,
AudioSampleBuffer (float* const* dataToReferTo,
int numChannels, int numChannels,
int startSample, int startSample,
int numSamples) noexcept; int numSamples) noexcept;
@@ -421,7 +421,7 @@ private:
float* preallocatedChannelSpace [32]; float* preallocatedChannelSpace [32];
void allocateData(); void allocateData();
void allocateChannels (float** dataToReferTo, int offset);
void allocateChannels (float* const* dataToReferTo, int offset);
JUCE_LEAK_DETECTOR (AudioSampleBuffer); JUCE_LEAK_DETECTOR (AudioSampleBuffer);
}; };


Loading…
Cancel
Save