CLAM::BufferedSDIFFileReader Class Reference

#include <BufferedSDIFFileReader.hxx>

Inheritance diagram for CLAM::BufferedSDIFFileReader:

CLAM::LoopingSDIFFileReader

List of all members.


Detailed Description

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.

Author:
greg kellum [gkellum@iua.upf.edu] 7/6/07
Since:
CLAM v1.1

Definition at line 38 of file 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 FrameReadFrame ()
 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)
FrameGetFrame (int frameBufferPosition)

Constructor & Destructor Documentation

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 8 of file BufferedSDIFFileReader.cxx.

References Configure().

CLAM::BufferedSDIFFileReader::~BufferedSDIFFileReader (  )  [virtual]

Definition at line 23 of file BufferedSDIFFileReader.cxx.


Member Function Documentation

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 31 of file BufferedSDIFFileReader.cxx.

References CLAM::SDIFFileReader::Configure(), and DEFAULT_INITIAL_NUMBER_OF_FRAMES_TO_BUFFER.

Referenced by BufferedSDIFFileReader().

const SDIFInConfig CLAM::BufferedSDIFFileReader::GetConfig (  ) 

Definition at line 64 of file BufferedSDIFFileReader.cxx.

References CLAM::SDIFFileReader::GetConfig().

Frame * CLAM::BufferedSDIFFileReader::ReadFrame (  )  [virtual]

This method returns the next frame from the internal buffer.

Reimplemented in CLAM::LoopingSDIFFileReader.

Definition at line 88 of file BufferedSDIFFileReader.cxx.

References NULL.

Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().

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 181 of file BufferedSDIFFileReader.cxx.

References CLAM_ASSERT, NULL, CLAM::Thread::SetThreadCode(), and CLAM::Thread::Start().

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 203 of file BufferedSDIFFileReader.cxx.

References NULL.

bool CLAM::BufferedSDIFFileReader::IsThreaded (  ) 

True if and only if this has a thread.

Definition at line 220 of file BufferedSDIFFileReader.cxx.

References NULL.

int CLAM::BufferedSDIFFileReader::GetNumberOfFramesLoaded (  ) 

The number of frames that have been read into the buffer.

Definition at line 175 of file BufferedSDIFFileReader.cxx.

int CLAM::BufferedSDIFFileReader::GetFrameBufferPosition (  )  [protected]

Definition at line 69 of file BufferedSDIFFileReader.cxx.

Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().

void CLAM::BufferedSDIFFileReader::SetFrameBufferPosition ( int  frameBufferPosition  )  [protected]

Frame * CLAM::BufferedSDIFFileReader::GetFrame ( int  frameBufferPosition  )  [protected]

Definition at line 79 of file BufferedSDIFFileReader.cxx.

Referenced by CLAM::LoopingSDIFFileReader::ReadFrame().


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

Generated on Tue Aug 12 22:33:49 2008 for CLAM by  doxygen 1.5.5