#include <FileIO.h>

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) |
| Buffer & | getInput () throw (CException) |
| Buffer & | getInput (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 |
| Thread * | mThread |
| Buffer | mInBuffer |
| Buffer | mOutBuffer |
| FileIO::FileIO | ( | char * | path = DEFAULT_SND_FILE_NAME |
) |
| void FileIO::open | ( | ) | throw (CException) [virtual] |
Reimplemented from csl::IO.
References csl::Buffer::allocateBuffers(), csl::CGestalt::blockSize(), csl::CGestalt::frameRate(), csl::Buffer::freeBuffers(), csl::kLogError, kSoundFileFormatAIFF, kSoundFileFormatSND, kSoundFileFormatWAV, csl::logMsg(), csl::Thread::MakeThread(), csl::Buffer::mAreBuffersAllocated, mDuration, mFile, mInBuffer, mOutBuffer, mPath, csl::IO::mThisSec, mThread, csl::IO::mTimeSum, csl::IO::mTimeVals, csl::CGestalt::numOutChannels(), and csl::Buffer::setSize().
| 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] |
| 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] |
References mFile, csl::IO::mGraph, csl::Buffer::mNumFrames, csl::IO::mNumFramesPlayed, mOutBuffer, csl::UnitGenerator::nextBuffer(), and csl::Buffer::zeroBuffers().
Referenced by threadFunction().
| unsigned csl::FileIO::mDuration |
char* csl::FileIO::mPath [protected] |
SoundFile csl::FileIO::mFile [protected] |
Referenced by close(), open(), and writeNextBuffer().
Thread* csl::FileIO::mThread [protected] |
Buffer csl::FileIO::mInBuffer [protected] |
Referenced by close(), getInput(), and open().
Buffer csl::FileIO::mOutBuffer [protected] |
Referenced by close(), open(), and writeNextBuffer().
1.5.8