#include <SoundFileL.h>

Public Member Functions | |
| LSoundFile (string path, int start=-1, int stop=-1) | |
| Constructor. Values not passed default to null. | |
| LSoundFile (string folder, string path, int start=-1, int stop=-1) | |
| LSoundFile (LSoundFile &otherSndFile) | |
| Copy constructor -- shares sample buffer. | |
| ~LSoundFile () | |
| SoundFileFormat | format () |
| get format | |
| void | openForRead () throw (CException) |
| void | openForWrite (SoundFileFormat format=kSoundFileFormatAIFF, unsigned channels=1, unsigned rate=44100, unsigned bitDepth=16) throw (CException) |
| void | openForReadWrite () throw (CException) |
| open r/w | |
| void | close () |
| unsigned | seekTo (int position, SeekPosition whence=kPositionStart) throw (CException) |
| seek to some position | |
| void | readBufferFromFile (unsigned numFrames) |
| read a buffer from the file (possibly all of it) | |
| void | nextBuffer (Buffer &outB) throw (CException) |
| UGen operations. | |
| void | writeBuffer (Buffer &inputBuffer) throw (CException) |
| write a buffer of data into the file | |
| SF_INFO * | sfInfo () |
| perform sample-rate conversion | |
| SNDFILE * | sndFile () |
| libsndfile handle | |
Protected Member Functions | |
| void | initFromSndfile () |
| read SF header | |
| void | checkBuffer (unsigned numFrames) |
| allocate buffer lazily | |
Protected Attributes | |
| SF_INFO * | mSFInfo |
| libsndfile sf-info struct | |
| SNDFILE * | mSndfile |
| libsndfile handle | |
| Interleaver | mInterleaver |
| File IO interleaver/deinterleaver. | |
| LSoundFile::LSoundFile | ( | string | path, | |
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
Constructor. Values not passed default to null.
References csl::Abst_SoundFile::mNumFrames, and mSFInfo.
| LSoundFile::LSoundFile | ( | string | folder, | |
| string | path, | |||
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
References csl::Abst_SoundFile::mNumFrames, csl::Abst_SoundFile::mPath, and mSFInfo.
| LSoundFile::LSoundFile | ( | LSoundFile & | otherSndFile | ) |
Copy constructor -- shares sample buffer.
References csl::Abst_SoundFile::isCached(), csl::kLogError, csl::logMsg(), and csl::Abst_SoundFile::mPath.
| LSoundFile::~LSoundFile | ( | ) |
References csl::Abst_SoundFile::freeBuffer(), and mSndfile.
| SoundFileFormat LSoundFile::format | ( | ) | [virtual] |
get format
Implements csl::Abst_SoundFile.
References kSoundFileFormatAIFF, kSoundFileFormatRaw, kSoundFileFormatSND, kSoundFileFormatWAV, csl::logMsg(), and mSFInfo.
| void LSoundFile::openForRead | ( | ) | throw (CException) [virtual] |
open file and get stats
Implements csl::Abst_SoundFile.
References initFromSndfile(), csl::kLogError, kSoundFileRead, csl::logMsg(), csl::CGestalt::maxSndFileFrames(), csl::Seekable::mCurrentFrame, csl::Buffer::mDidIAllocateBuffers, csl::Abst_SoundFile::mMode, csl::Abst_SoundFile::mNumFrames, csl::Abst_SoundFile::mPath, mSFInfo, mSndfile, csl::Abst_SoundFile::mStart, csl::WavetableOscillator::mWavetable, and readBufferFromFile().
| void LSoundFile::openForWrite | ( | SoundFileFormat | format = kSoundFileFormatAIFF, |
|
| unsigned | channels = 1, |
|||
| unsigned | rate = 44100, |
|||
| unsigned | bitDepth = 16 | |||
| ) | throw (CException) [virtual] |
Open a file for write. Default values are some common format.
Implements csl::Abst_SoundFile.
References csl::kLogError, kSoundFileFormatAIFF, kSoundFileFormatRaw, kSoundFileFormatSND, kSoundFileFormatWAV, kSoundFileWrite, and csl::logMsg().
| void LSoundFile::openForReadWrite | ( | ) | throw (CException) |
open r/w
References initFromSndfile(), kSoundFileReadWrite, csl::Abst_SoundFile::mMode, csl::Abst_SoundFile::mPath, mSFInfo, and mSndfile.
| void LSoundFile::close | ( | ) | [virtual] |
close file
Implements csl::Abst_SoundFile.
References csl::Abst_SoundFile::freeBuffer(), and mSndfile.
| unsigned LSoundFile::seekTo | ( | int | position, | |
| SeekPosition | whence = kPositionStart | |||
| ) | throw (CException) [virtual] |
seek to some position
Implements csl::Abst_SoundFile.
References csl::kPositionCurrent, csl::kPositionEnd, csl::kPositionStart, and csl::logMsg().
Referenced by initFromSndfile().
| void LSoundFile::readBufferFromFile | ( | unsigned | numFrames | ) | [virtual] |
read a buffer from the file (possibly all of it)
Implements csl::Abst_SoundFile.
References checkBuffer(), csl::Interleaver::deinterleave(), csl::Seekable::mCurrentFrame, mInterleaver, csl::Abst_SoundFile::mIsLooping, csl::UnitGenerator::mNumChannels, csl::Buffer::monoBuffer(), mSFInfo, mSndfile, csl::Abst_SoundFile::mStop, csl::WavetableOscillator::mWavetable, SAFE_FREE, and SAFE_MALLOC.
Referenced by openForRead().
| void LSoundFile::nextBuffer | ( | Buffer & | outB | ) | throw (CException) [virtual] |
UGen operations.
copy next buffer from cache
Reimplemented from csl::Abst_SoundFile.
References csl_min, DECLARE_SCALABLE_CONTROLS, csl::kLogError, LOAD_SCALABLE_CONTROLS, csl::logMsg(), csl::WavetableOscillator::nextBuffer(), and UPDATE_SCALABLE_CONTROLS.
| void LSoundFile::writeBuffer | ( | Buffer & | inputBuffer | ) | throw (CException) [virtual] |
| SF_INFO* csl::LSoundFile::sfInfo | ( | ) | [inline] |
| SNDFILE* csl::LSoundFile::sndFile | ( | ) | [inline] |
| void LSoundFile::initFromSndfile | ( | ) | [protected, virtual] |
read SF header
Implements csl::Abst_SoundFile.
References csl::kLogError, kSoundFileRead, csl::logMsg(), csl::Abst_SoundFile::mBytesPerSample, csl::UnitGenerator::mFrameRate, csl::Abst_SoundFile::mIsValid, csl::Abst_SoundFile::mMode, csl::UnitGenerator::mNumChannels, csl::Abst_SoundFile::mNumFrames, mSFInfo, mSndfile, csl::Abst_SoundFile::mStart, csl::Abst_SoundFile::mStop, and seekTo().
Referenced by openForRead(), and openForReadWrite().
| void LSoundFile::checkBuffer | ( | unsigned | numFrames | ) | [protected, virtual] |
allocate buffer lazily
Reimplemented from csl::Abst_SoundFile.
References csl::CGestalt::maxBufferFrames(), and csl::UnitGenerator::mNumChannels.
Referenced by readBufferFromFile().
SF_INFO* csl::LSoundFile::mSFInfo [protected] |
libsndfile sf-info struct
Referenced by format(), initFromSndfile(), LSoundFile(), openForRead(), openForReadWrite(), readBufferFromFile(), and sfInfo().
SNDFILE* csl::LSoundFile::mSndfile [protected] |
libsndfile handle
Referenced by close(), initFromSndfile(), openForRead(), openForReadWrite(), readBufferFromFile(), sndFile(), and ~LSoundFile().
Interleaver csl::LSoundFile::mInterleaver [protected] |
1.5.8