90 bool read (
float*
const* destChannels,
int numDestChannels,
91 int64 startSampleInSource,
int numSamplesToRead);
131 bool read (
int*
const* destChannels,
133 int64 startSampleInSource,
134 int numSamplesToRead,
135 bool fillLeftoverChannelsWithCopies);
145 int startSampleInDestBuffer,
147 int64 readerStartSample,
148 bool useReaderLeftChan,
149 bool useReaderRightChan);
167 virtual void readMaxLevels (int64 startSample, int64 numSamples,
187 virtual void readMaxLevels (int64 startSample, int64 numSamples,
188 float& lowestLeft,
float& highestLeft,
189 float& lowestRight,
float& highestRight);
213 int64 searchForLevel (int64 startSample,
214 int64 numSamplesToSearch,
215 double magnitudeRangeMinimum,
216 double magnitudeRangeMaximum,
217 int minimumConsecutiveSamples);
222 double sampleRate = 0;
225 unsigned int bitsPerSample = 0;
228 int64 lengthInSamples = 0;
231 unsigned int numChannels = 0;
234 bool usesFloatingPointData =
false;
267 virtual bool readSamples (
int** destChannels,
269 int startOffsetInDestBuffer,
270 int64 startSampleInFile,
277 template <
class DestSampleType,
class SourceSampleType,
class SourceEndianness>
283 template <
typename TargetType>
284 static void read (TargetType*
const* destData,
int destOffset,
int numDestChannels,
285 const void* sourceData,
int numSourceChannels,
int numSamples) noexcept
287 for (
int i = 0; i < numDestChannels; ++i)
289 if (
void* targetChan = destData[i])
294 if (i < numSourceChannels)
295 dest.
convertSamples (
SourceType (addBytesToPointer (sourceData, i * SourceType::getBytesPerSample()), numSourceChannels), numSamples);
307 int startOffsetInDestBuffer, int64 startSampleInFile,
308 int& numSamples, int64 fileLengthInSamples)
310 jassert (destChannels !=
nullptr);
311 const int64 samplesAvailable = fileLengthInSamples - startSampleInFile;
313 if (samplesAvailable < numSamples)
315 for (
int i = numDestChannels; --i >= 0;)
316 if (destChannels[i] !=
nullptr)
317 zeromem (destChannels[i] + startOffsetInDestBuffer, (
size_t) numSamples *
sizeof (
int));
319 numSamples = (int) samplesAvailable;
void clearSamples(int numSamples) const noexcept
void convertSamples(Pointer source, int numSamples) const noexcept