89 bool read (
float*
const* destChannels,
int numDestChannels,
90 int64 startSampleInSource,
int numSamplesToRead);
130 bool read (
int*
const* destChannels,
132 int64 startSampleInSource,
133 int numSamplesToRead,
134 bool fillLeftoverChannelsWithCopies);
148 int startSampleInDestBuffer,
150 int64 readerStartSample,
151 bool useReaderLeftChan,
152 bool useReaderRightChan);
170 virtual void readMaxLevels (int64 startSample, int64 numSamples,
190 virtual void readMaxLevels (int64 startSample, int64 numSamples,
191 float& lowestLeft,
float& highestLeft,
192 float& lowestRight,
float& highestRight);
216 int64 searchForLevel (int64 startSample,
217 int64 numSamplesToSearch,
218 double magnitudeRangeMinimum,
219 double magnitudeRangeMaximum,
220 int minimumConsecutiveSamples);
225 double sampleRate = 0;
228 unsigned int bitsPerSample = 0;
231 int64 lengthInSamples = 0;
234 unsigned int numChannels = 0;
237 bool usesFloatingPointData =
false;
272 int startOffsetInDestBuffer,
273 int64 startSampleInFile,
280 template <
class DestSampleType,
class SourceSampleType,
class SourceEndianness>
286 template <
typename TargetType>
287 static void read (TargetType*
const* destData,
int destOffset,
int numDestChannels,
288 const void* sourceData,
int numSourceChannels,
int numSamples)
noexcept
290 for (
int i = 0; i < numDestChannels; ++i)
292 if (
void* targetChan = destData[i])
297 if (i < numSourceChannels)
298 dest.
convertSamples (
SourceType (addBytesToPointer (sourceData, i * SourceType::getBytesPerSample()), numSourceChannels), numSamples);
310 int startOffsetInDestBuffer, int64 startSampleInFile,
311 int& numSamples, int64 fileLengthInSamples)
313 if (destChannels ==
nullptr)
319 const int64 samplesAvailable = fileLengthInSamples - startSampleInFile;
321 if (samplesAvailable < numSamples)
323 for (
int i = numDestChannels; --i >= 0;)
324 if (destChannels[i] !=
nullptr)
325 zeromem (destChannels[i] + startOffsetInDestBuffer, (
size_t) numSamples *
sizeof (
int));
327 numSamples = (int) samplesAvailable;
void clearSamples(int numSamples) const noexcept
void convertSamples(Pointer source, int numSamples) const noexcept