tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
tracktion::engine::BufferedFileReader Class Reference
Inheritance diagram for tracktion::engine::BufferedFileReader:
juce::AudioFormatReader juce::TimeSliceClient

Public Member Functions

 BufferedFileReader (juce::AudioFormatReader *sourceReader, juce::TimeSliceThread &timeSliceThread, int samplesToBuffer)
 Creates a reader.
 
 ~BufferedFileReader () override
 Destructor.
 
void setReadTimeout (int timeoutMilliseconds) noexcept
 Sets a number of milliseconds that the reader can block for in its readSamples() method before giving up and returning silence.
 
bool isFullyBuffered () const
 Returns true if this has been initialised to buffer the whole file once that is complete, false otherwise.
 
bool readSamples (int *const *destSamples, int numDestChannels, int startOffsetInDestBuffer, juce::int64 startSampleInFile, int numSamples) override
 
- Public Member Functions inherited from juce::AudioFormatReader
const StringgetFormatName () const noexcept
 
bool read (float *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead)
 
bool read (int *const *destChannels, int numDestChannels, int64 startSampleInSource, int numSamplesToRead, bool fillLeftoverChannelsWithCopies)
 
bool read (AudioBuffer< float > *buffer, int startSampleInDestBuffer, int numSamples, int64 readerStartSample, bool useReaderLeftChan, bool useReaderRightChan)
 
virtual void readMaxLevels (int64 startSample, int64 numSamples, Range< float > *results, int numChannelsToRead)
 
virtual void readMaxLevels (int64 startSample, int64 numSamples, float &lowestLeft, float &highestLeft, float &lowestRight, float &highestRight)
 
int64 searchForLevel (int64 startSample, int64 numSamplesToSearch, double magnitudeRangeMinimum, double magnitudeRangeMaximum, int minimumConsecutiveSamples)
 
virtual AudioChannelSet getChannelLayout ()
 

Additional Inherited Members

- Public Attributes inherited from juce::AudioFormatReader
double sampleRate
 
unsigned int bitsPerSample
 
int64 lengthInSamples
 
unsigned int numChannels
 
bool usesFloatingPointData
 
StringPairArray metadataValues
 
InputStreaminput
 
- Protected Member Functions inherited from juce::AudioFormatReader
 AudioFormatReader (InputStream *sourceStream, const String &formatName)
 
- Static Protected Member Functions inherited from juce::AudioFormatReader
static void clearSamplesBeyondAvailableLength (int *const *destChannels, int numDestChannels, int startOffsetInDestBuffer, int64 startSampleInFile, int &numSamples, int64 fileLengthInSamples)
 

Detailed Description

Definition at line 22 of file tracktion_BufferedFileReader.h.

Constructor & Destructor Documentation

◆ BufferedFileReader()

tracktion::engine::BufferedFileReader::BufferedFileReader ( juce::AudioFormatReader sourceReader,
juce::TimeSliceThread timeSliceThread,
int  samplesToBuffer 
)

Creates a reader.

Parameters
sourceReaderthe source reader to wrap. This BufferingAudioReader takes ownership of this object and will delete it later when no longer needed
timeSliceThreadthe thread that should be used to do the background reading. Make sure that the thread you supply is running, and won't be deleted while the reader object still exists.
samplesToBufferthe total number of samples to buffer ahead. Pass -1 to buffer the whole source

Definition at line 14 of file tracktion_BufferedFileReader.cpp.

◆ ~BufferedFileReader()

tracktion::engine::BufferedFileReader::~BufferedFileReader ( )
override

Destructor.

Definition at line 55 of file tracktion_BufferedFileReader.cpp.

Member Function Documentation

◆ isFullyBuffered()

bool tracktion::engine::BufferedFileReader::isFullyBuffered ( ) const

Returns true if this has been initialised to buffer the whole file once that is complete, false otherwise.

Definition at line 65 of file tracktion_BufferedFileReader.cpp.

◆ readSamples()

bool tracktion::engine::BufferedFileReader::readSamples ( int *const *  destSamples,
int  numDestChannels,
int  startOffsetInDestBuffer,
juce::int64  startSampleInFile,
int  numSamples 
)
overridevirtual

Implements juce::AudioFormatReader.

Definition at line 71 of file tracktion_BufferedFileReader.cpp.

◆ setReadTimeout()

void tracktion::engine::BufferedFileReader::setReadTimeout ( int  timeoutMilliseconds)
noexcept

Sets a number of milliseconds that the reader can block for in its readSamples() method before giving up and returning silence.

A value of less that 0 means "wait forever". The default timeout is 0 which means don't wait at all.

Definition at line 60 of file tracktion_BufferedFileReader.cpp.


The documentation for this class was generated from the following files: