@@ -58,7 +58,7 @@ bool AudioFormatReader::read (float* const* destChannels, int numDestChannels, | |||||
return true; | return true; | ||||
} | } | ||||
bool AudioFormatReader::read (int* const* destSamples, | |||||
bool AudioFormatReader::read (int* const* destChannels, | |||||
int numDestChannels, | int numDestChannels, | ||||
int64 startSampleInSource, | int64 startSampleInSource, | ||||
int numSamplesToRead, | int numSamplesToRead, | ||||
@@ -74,7 +74,7 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
auto silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead); | auto silence = (int) jmin (-startSampleInSource, (int64) numSamplesToRead); | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (auto d = destSamples[i]) | |||||
if (auto d = destChannels[i]) | |||||
zeromem (d, sizeof (int) * (size_t) silence); | zeromem (d, sizeof (int) * (size_t) silence); | ||||
startOffsetInDestBuffer += silence; | startOffsetInDestBuffer += silence; | ||||
@@ -85,7 +85,7 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
if (numSamplesToRead <= 0) | if (numSamplesToRead <= 0) | ||||
return true; | return true; | ||||
if (! readSamples (const_cast<int**> (destSamples), | |||||
if (! readSamples (const_cast<int**> (destChannels), | |||||
jmin ((int) numChannels, numDestChannels), startOffsetInDestBuffer, | jmin ((int) numChannels, numDestChannels), startOffsetInDestBuffer, | ||||
startSampleInSource, numSamplesToRead)) | startSampleInSource, numSamplesToRead)) | ||||
return false; | return false; | ||||
@@ -94,26 +94,26 @@ bool AudioFormatReader::read (int* const* destSamples, | |||||
{ | { | ||||
if (fillLeftoverChannelsWithCopies) | if (fillLeftoverChannelsWithCopies) | ||||
{ | { | ||||
auto lastFullChannel = destSamples[0]; | |||||
auto lastFullChannel = destChannels[0]; | |||||
for (int i = (int) numChannels; --i > 0;) | for (int i = (int) numChannels; --i > 0;) | ||||
{ | { | ||||
if (destSamples[i] != nullptr) | |||||
if (destChannels[i] != nullptr) | |||||
{ | { | ||||
lastFullChannel = destSamples[i]; | |||||
lastFullChannel = destChannels[i]; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (lastFullChannel != nullptr) | if (lastFullChannel != nullptr) | ||||
for (int i = (int) numChannels; i < numDestChannels; ++i) | for (int i = (int) numChannels; i < numDestChannels; ++i) | ||||
if (auto d = destSamples[i]) | |||||
if (auto d = destChannels[i]) | |||||
memcpy (d, lastFullChannel, sizeof (int) * originalNumSamplesToRead); | memcpy (d, lastFullChannel, sizeof (int) * originalNumSamplesToRead); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
for (int i = (int) numChannels; i < numDestChannels; ++i) | for (int i = (int) numChannels; i < numDestChannels; ++i) | ||||
if (auto d = destSamples[i]) | |||||
if (auto d = destChannels[i]) | |||||
zeromem (d, sizeof (int) * originalNumSamplesToRead); | zeromem (d, sizeof (int) * originalNumSamplesToRead); | ||||
} | } | ||||
} | } | ||||
@@ -71,7 +71,7 @@ public: | |||||
//============================================================================== | //============================================================================== | ||||
/** Reads samples from the stream. | /** Reads samples from the stream. | ||||
@param destSamples an array of float buffers into which the sample data for each | |||||
@param destChannels an array of float buffers into which the sample data for each | |||||
channel will be written. Channels that aren't needed can be null | channel will be written. Channels that aren't needed can be null | ||||
@param numDestChannels the number of array elements in the destChannels array | @param numDestChannels the number of array elements in the destChannels array | ||||
@param startSampleInSource the position in the audio file or stream at which the samples | @param startSampleInSource the position in the audio file or stream at which the samples | ||||
@@ -92,7 +92,7 @@ public: | |||||
/** Reads samples from the stream. | /** Reads samples from the stream. | ||||
@param destSamples an array of buffers into which the sample data for each | |||||
@param destChannels an array of buffers into which the sample data for each | |||||
channel will be written. | channel will be written. | ||||
If the format is fixed-point, each channel will be written | If the format is fixed-point, each channel will be written | ||||
as an array of 32-bit signed integers using the full | as an array of 32-bit signed integers using the full | ||||
@@ -100,8 +100,8 @@ public: | |||||
bit-depth. If it is a floating-point format, you should cast | bit-depth. If it is a floating-point format, you should cast | ||||
the resulting array to a (float**) to get the values (in the | the resulting array to a (float**) to get the values (in the | ||||
range -1.0 to 1.0 or beyond) | range -1.0 to 1.0 or beyond) | ||||
If the format is stereo, then destSamples[0] is the left channel | |||||
data, and destSamples[1] is the right channel. | |||||
If the format is stereo, then destChannels[0] is the left channel | |||||
data, and destChannels[1] is the right channel. | |||||
The numDestChannels parameter indicates how many pointers this array | The numDestChannels parameter indicates how many pointers this array | ||||
contains, but some of these pointers can be null if you don't want to | contains, but some of these pointers can be null if you don't want to | ||||
read data for some of the channels | read data for some of the channels | ||||
@@ -128,7 +128,7 @@ public: | |||||
error - the reader should just return zeros for these regions | error - the reader should just return zeros for these regions | ||||
@see readMaxLevels | @see readMaxLevels | ||||
*/ | */ | ||||
bool read (int* const* destSamples, | |||||
bool read (int* const* destChannels, | |||||
int numDestChannels, | int numDestChannels, | ||||
int64 startSampleInSource, | int64 startSampleInSource, | ||||
int numSamplesToRead, | int numSamplesToRead, | ||||
@@ -253,18 +253,18 @@ public: | |||||
Callers should use read() instead of calling this directly. | Callers should use read() instead of calling this directly. | ||||
@param destSamples the array of destination buffers to fill. Some of these | |||||
pointers may be null | |||||
@param numDestChannels the number of items in the destSamples array. This | |||||
value is guaranteed not to be greater than the number of | |||||
channels that this reader object contains | |||||
@param startOffsetInDestBuffer the number of samples from the start of the | |||||
dest data at which to begin writing | |||||
@param startSampleInFile the number of samples into the source data at which | |||||
to begin reading. This value is guaranteed to be >= 0. | |||||
@param numSamples the number of samples to read | |||||
@param destChannels the array of destination buffers to fill. Some of these | |||||
pointers may be null | |||||
@param numDestChannels the number of items in the destChannels array. This | |||||
value is guaranteed not to be greater than the number of | |||||
channels that this reader object contains | |||||
@param startOffsetInDestBuffer the number of samples from the start of the | |||||
dest data at which to begin writing | |||||
@param startSampleInFile the number of samples into the source data at which | |||||
to begin reading. This value is guaranteed to be >= 0. | |||||
@param numSamples the number of samples to read | |||||
*/ | */ | ||||
virtual bool readSamples (int** destSamples, | |||||
virtual bool readSamples (int** destChannels, | |||||
int numDestChannels, | int numDestChannels, | ||||
int startOffsetInDestBuffer, | int startOffsetInDestBuffer, | ||||
int64 startSampleInFile, | int64 startSampleInFile, | ||||
@@ -303,18 +303,18 @@ protected: | |||||
/** Used by AudioFormatReader subclasses to clear any parts of the data blocks that lie | /** Used by AudioFormatReader subclasses to clear any parts of the data blocks that lie | ||||
beyond the end of their available length. | beyond the end of their available length. | ||||
*/ | */ | ||||
static void clearSamplesBeyondAvailableLength (int** destSamples, int numDestChannels, | |||||
static void clearSamplesBeyondAvailableLength (int** destChannels, int numDestChannels, | |||||
int startOffsetInDestBuffer, int64 startSampleInFile, | int startOffsetInDestBuffer, int64 startSampleInFile, | ||||
int& numSamples, int64 fileLengthInSamples) | int& numSamples, int64 fileLengthInSamples) | ||||
{ | { | ||||
jassert (destSamples != nullptr); | |||||
jassert (destChannels != nullptr); | |||||
const int64 samplesAvailable = fileLengthInSamples - startSampleInFile; | const int64 samplesAvailable = fileLengthInSamples - startSampleInFile; | ||||
if (samplesAvailable < numSamples) | if (samplesAvailable < numSamples) | ||||
{ | { | ||||
for (int i = numDestChannels; --i >= 0;) | for (int i = numDestChannels; --i >= 0;) | ||||
if (destSamples[i] != nullptr) | |||||
zeromem (destSamples[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||||
if (destChannels[i] != nullptr) | |||||
zeromem (destChannels[i] + startOffsetInDestBuffer, sizeof (int) * (size_t) numSamples); | |||||
numSamples = (int) samplesAvailable; | numSamples = (int) samplesAvailable; | ||||
} | } | ||||
@@ -978,6 +978,7 @@ public: | |||||
decimal places, adding trailing zeros as required, and | decimal places, adding trailing zeros as required, and | ||||
will not use exponent notation. If 0 or less, it will use | will not use exponent notation. If 0 or less, it will use | ||||
exponent notation if necessary. | exponent notation if necessary. | ||||
@param useScientificNotation if the number should be formatted using scientific notation | |||||
@see getFloatValue, getIntValue | @see getFloatValue, getIntValue | ||||
*/ | */ | ||||
String (double doubleValue, int numberOfDecimalPlaces, bool useScientificNotation = false); | String (double doubleValue, int numberOfDecimalPlaces, bool useScientificNotation = false); | ||||
@@ -85,7 +85,6 @@ public: | |||||
@param samples the destination buffer pointer | @param samples the destination buffer pointer | ||||
@param size the size of the destination buffer allocated in the object | @param size the size of the destination buffer allocated in the object | ||||
@param type the type of windowing method being used | |||||
@param normalise if the result must be normalised, creating a DC amplitude | @param normalise if the result must be normalised, creating a DC amplitude | ||||
response of one | response of one | ||||
@param beta an optional argument useful only for Kaiser's method, | @param beta an optional argument useful only for Kaiser's method, | ||||
@@ -92,8 +92,6 @@ public: | |||||
/** Set a new ramp length directly in samples. | /** Set a new ramp length directly in samples. | ||||
@param numSteps The number of samples over which the ramp should be active | @param numSteps The number of samples over which the ramp should be active | ||||
@param increasingRateOfChange If the log behaviour makes the ramp increase | |||||
slowly at the beginning, rather than at the end | |||||
*/ | */ | ||||
void reset (int numSteps) noexcept | void reset (int numSteps) noexcept | ||||
{ | { | ||||
@@ -108,7 +106,6 @@ public: | |||||
/** Set a new target value. | /** Set a new target value. | ||||
@param newValue The new target value | @param newValue The new target value | ||||
@param force If true, the value will be set immediately, bypassing the ramp | |||||
*/ | */ | ||||
void setTargetValue (FloatType newValue) noexcept | void setTargetValue (FloatType newValue) noexcept | ||||
{ | { | ||||
@@ -146,8 +146,6 @@ public: | |||||
content created by the oversampled process, so usually the attenuation is | content created by the oversampled process, so usually the attenuation is | ||||
increased when upsampling compared to downsampling. | increased when upsampling compared to downsampling. | ||||
@param type the type of filter design employed for filtering | |||||
during oversampling | |||||
@param normalisedTransitionWidthUp a value between 0 and 0.5 which specifies how much | @param normalisedTransitionWidthUp a value between 0 and 0.5 which specifies how much | ||||
the transition between passband and stopband is | the transition between passband and stopband is | ||||
steep, for upsampling filtering (the lower the better) | steep, for upsampling filtering (the lower the better) | ||||