BufferedSDIFFileReader is an SDIFFileReader that preloads some SDIF frames into an internal buffer so that real-time audio applications won't stall while waiting for disk reading operations. More...
#include <BufferedSDIFFileReader.hxx>
Public Member Functions | |
BufferedSDIFFileReader (const SDIFInConfig &argSDIFInConfig) | |
You MUST give the instance the filename of the SDIF file to read. | |
virtual | ~BufferedSDIFFileReader () |
bool | Configure (const SDIFInConfig &c) |
You MUST to give the instance the filename of the SDIF file to read. | |
const SDIFInConfig | GetConfig () |
virtual Frame * | ReadFrame () |
This method returns the next frame from the internal buffer. | |
void | LoadFramesIntoBufferOnThread (Thread *argThread) |
Use this method to give the instance a thread which it can use to load the SDIF file in the background. | |
void | StopLoadingFramesIntoBufferOnThread () |
This method stops the thread given to this object. | |
bool | IsThreaded () |
True if and only if this has a thread. | |
int | GetNumberOfFramesLoaded () |
The number of frames that have been read into the buffer. | |
Protected Member Functions | |
int | GetFrameBufferPosition () |
void | SetFrameBufferPosition (int frameBufferPosition) |
Frame * | GetFrame (int frameBufferPosition) |
BufferedSDIFFileReader is an SDIFFileReader that preloads some SDIF frames into an internal buffer so that real-time audio applications won't stall while waiting for disk reading operations.
Instances can be given a thread (presumably from a thread pool) so that the SDIF frames will be loaded in the background.
Definition at line 38 of file BufferedSDIFFileReader.hxx.
CLAM::BufferedSDIFFileReader::BufferedSDIFFileReader | ( | const SDIFInConfig & | argSDIFInConfig | ) |
You MUST give the instance the filename of the SDIF file to read.
in the SDIFInConfig object.
Definition at line 5 of file BufferedSDIFFileReader.cxx.
References DEFAULT_FRAME_LOAD_CHUNK_SIZE, DEFAULT_THRESHHOLD_FOR_PRELOADING, DEFAULT_THRESHHOLD_FOR_PRELOADING_ON_THREAD, and Run().
CLAM::BufferedSDIFFileReader::~BufferedSDIFFileReader | ( | ) | [virtual] |
Definition at line 20 of file BufferedSDIFFileReader.cxx.
bool CLAM::BufferedSDIFFileReader::Configure | ( | const SDIFInConfig & | c | ) |
You MUST to give the instance the filename of the SDIF file to read.
in the SDIFInConfig object. You can further specify which kinds of objects to read from the SDIFFile. See the doc for SDIFInConfig.
Reimplemented in CLAM::LoopingSDIFFileReader.
Definition at line 28 of file BufferedSDIFFileReader.cxx.
const SDIFInConfig CLAM::BufferedSDIFFileReader::GetConfig | ( | ) |
Definition at line 61 of file BufferedSDIFFileReader.cxx.
Definition at line 76 of file BufferedSDIFFileReader.cxx.
int CLAM::BufferedSDIFFileReader::GetFrameBufferPosition | ( | ) | [protected] |
Definition at line 66 of file BufferedSDIFFileReader.cxx.
int CLAM::BufferedSDIFFileReader::GetNumberOfFramesLoaded | ( | ) |
The number of frames that have been read into the buffer.
Definition at line 172 of file BufferedSDIFFileReader.cxx.
bool CLAM::BufferedSDIFFileReader::IsThreaded | ( | ) |
True if and only if this has a thread.
Definition at line 217 of file BufferedSDIFFileReader.cxx.
void CLAM::BufferedSDIFFileReader::LoadFramesIntoBufferOnThread | ( | Thread * | argThread | ) |
Use this method to give the instance a thread which it can use to load the SDIF file in the background.
Definition at line 178 of file BufferedSDIFFileReader.cxx.
Frame * CLAM::BufferedSDIFFileReader::ReadFrame | ( | ) | [virtual] |
This method returns the next frame from the internal buffer.
Reimplemented in CLAM::LoopingSDIFFileReader.
Definition at line 85 of file BufferedSDIFFileReader.cxx.
void CLAM::BufferedSDIFFileReader::SetFrameBufferPosition | ( | int | frameBufferPosition | ) | [protected] |
Definition at line 71 of file BufferedSDIFFileReader.cxx.
void CLAM::BufferedSDIFFileReader::StopLoadingFramesIntoBufferOnThread | ( | ) |
This method stops the thread given to this object.
This should never (?) be called however by a client because this class knows when it no longer needs its thread uses this method to stop the thread itself.
TODO should this be protected?
Definition at line 200 of file BufferedSDIFFileReader.cxx.