csl::FileIO Class Reference

#include <FileIO.h>

Inheritance diagram for csl::FileIO:

csl::IO

List of all members.

Public Member Functions

 FileIO (char *path=DEFAULT_SND_FILE_NAME)
 < the path name determines the file type, e.g., xx.aiff, zz.snd, or yy.wav
 ~FileIO ()
void open () throw (CException)
void start (float seconds=0) throw (CException)
void stop () throw (CException)
void close () throw (CException)
 open/close start/stop methods
void test () throw (CException)
BuffergetInput () throw (CException)
BuffergetInput (unsigned numFrames, unsigned numChannels) throw (CException)

Public Attributes

bool mIsPlaying
 whether or not it's playing
bool mIsThreadRunning
 is the background thread running?
unsigned mDuration
 the file's buffer rate;

Protected Member Functions

void writeNextBuffer ()

Static Protected Member Functions

static void * threadFunction (void *)

Protected Attributes

char * mPath
SoundFile mFile
ThreadmThread
Buffer mInBuffer
Buffer mOutBuffer


Detailed Description

FileIO.h -- IO using a sound file for storing output sample data

Constructor & Destructor Documentation

FileIO::FileIO ( char *  path = DEFAULT_SND_FILE_NAME  ) 

< the path name determines the file type, e.g., xx.aiff, zz.snd, or yy.wav

References mPath.

FileIO::~FileIO (  ) 

References mPath, and mThread.


Member Function Documentation

void FileIO::open (  )  throw (CException) [virtual]

void FileIO::start ( float  seconds = 0  )  throw (CException)

seconds is optional. If not passed, starts a background thread, playing and writing, otherwise run for x seconds (so it doesn't return until done).

References csl::CGestalt::frameRate(), and csl::logMsg().

void FileIO::stop ( void   )  throw (CException) [virtual]

Reimplemented from csl::IO.

References mDuration, mIsPlaying, mIsThreadRunning, and csl::sleepUsec().

void FileIO::close (  )  throw (CException) [virtual]

open/close start/stop methods

Reimplemented from csl::IO.

References csl::Buffer::freeBuffers(), csl::Buffer::mAreBuffersAllocated, mFile, mInBuffer, and mOutBuffer.

void csl::FileIO::test (  )  throw (CException) [inline, virtual]

Reimplemented from csl::IO.

Buffer& csl::FileIO::getInput (  )  throw (CException) [inline, virtual]

test the IO's graph Get the current input from the sound card

Reimplemented from csl::IO.

References mInBuffer.

Buffer& csl::FileIO::getInput ( unsigned  numFrames,
unsigned  numChannels 
) throw (CException) [inline, virtual]

Reimplemented from csl::IO.

void * FileIO::threadFunction ( void *  ptr  )  [static, protected]

void FileIO::writeNextBuffer (  )  [protected]


Member Data Documentation

whether or not it's playing

Referenced by stop(), and threadFunction().

is the background thread running?

Referenced by stop(), and threadFunction().

the file's buffer rate;

Referenced by open(), stop(), and threadFunction().

char* csl::FileIO::mPath [protected]

Referenced by FileIO(), open(), and ~FileIO().

SoundFile csl::FileIO::mFile [protected]

Referenced by close(), open(), and writeNextBuffer().

Referenced by open(), and ~FileIO().

Referenced by close(), getInput(), and open().

Referenced by close(), open(), and writeNextBuffer().


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

Generated on Thu Sep 17 23:14:17 2009 for CSL by  doxygen 1.5.8