CLAM-Development  1.4.0
Public Member Functions | Protected Member Functions
CLAM::BufferedSDIFFileReader Class Reference

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>

List of all members.

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)

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 [gkell.nosp@m.um@i.nosp@m.ua.up.nosp@m.f.ed.nosp@m.u] 7/6/07
Since:
CLAM v1.1

Definition at line 38 of file BufferedSDIFFileReader.hxx.


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::GetFrame ( int  frameBufferPosition)
protected

Definition at line 79 of file BufferedSDIFFileReader.cxx.

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

int CLAM::BufferedSDIFFileReader::GetFrameBufferPosition ( )
protected

Definition at line 69 of file BufferedSDIFFileReader.cxx.

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

int CLAM::BufferedSDIFFileReader::GetNumberOfFramesLoaded ( )

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

Definition at line 175 of file BufferedSDIFFileReader.cxx.

bool CLAM::BufferedSDIFFileReader::IsThreaded ( )

True if and only if this has a thread.

Definition at line 220 of file BufferedSDIFFileReader.cxx.

References NULL.

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().

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.

void CLAM::BufferedSDIFFileReader::SetFrameBufferPosition ( int  frameBufferPosition)
protected
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.


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