#include <SoundFile.h>

Public Member Functions | |
| Abst_SoundFile (string path, int start=-1, int stop=-1) | |
| Constructor. Values not passed default to null. | |
| Abst_SoundFile (string folder, string path, int start=-1, int stop=-1) | |
| Copy constructor -- shares sample buffer. | |
| Abst_SoundFile (Abst_SoundFile &otherSndFile) | |
| Copy constructor -- shares sample buffer. | |
| ~Abst_SoundFile () | |
| unsigned | channels () const |
| accessors | |
| unsigned | duration () const |
| number of frames in the sound file | |
| float | durationInSecs () |
| actual duration of the selected portion in sec | |
| virtual SoundFileFormat | format ()=0 |
| get format | |
| bool | isValid () |
| answer if a valid file/buffer | |
| bool | isActive () |
| answer if currently active | |
| unsigned | sampleSize () |
| virtual void | setPath (string path) |
| get the bytes-per-sample | |
| string | path () |
| file name | |
| virtual void | dump () |
| log snd file props | |
| SoundFileMode | mode () |
| r/w mode | |
| int | startFrame () |
| get/set start frame | |
| void | setStart (int val) |
| void | setStartSec (float val) |
| void | setStartRatio (float val) |
| int | stopFrame () |
| get/set stop frame | |
| void | setStop (int val) |
| void | setStopSec (float val) |
| void | setStopRatio (float val) |
| double | playbackRate () |
| playback rate (pitch ratio) | |
| void | setRate (UnitGenerator &frequency) |
| set the receiver's playback rate (pitch ratio) | |
| void | setRate (float frequency) |
| bool | isLooping () |
| get/set looping state | |
| void | setIsLooping (bool tLooping) |
| virtual bool | isCached () |
| answer if file is loaded into RAM | |
| virtual void | openForRead ()=0 throw (CException) |
| virtual void | openForWrite (SoundFileFormat format=kSoundFileFormatAIFF, unsigned channels=1, unsigned rate=44100, unsigned bitDepth=16)=0 throw (CException) |
| Open a file for write. Default values are some common format. | |
| virtual unsigned | seekTo (int position, SeekPosition whence)=0 throw (CException) |
| seek to some position | |
| unsigned | seekTo (int position) throw (CException) |
| virtual void | readBufferFromFile (unsigned numFr)=0 |
| read a buffer from the file (possibly all of it) | |
| void | mergeToMono () |
| average all the channels to mono | |
| virtual void | setToEnd () |
| set to end position | |
| virtual void | trigger () |
| reset to start | |
| virtual void | close ()=0 |
| close file | |
| virtual void | freeBuffer () |
| free the file cache | |
| virtual void | nextBuffer (Buffer &outB) throw (CException) |
| UGen operations. | |
| virtual void | writeBuffer (Buffer &inB)=0 throw (CException) |
| write a buffer of data into the file | |
Protected Member Functions | |
| virtual void | initFromSndfile ()=0 |
| read SF header | |
| virtual void | checkBuffer (unsigned numFrames) |
| allocate buffer lazily | |
Protected Attributes | |
| string | mPath |
| file name | |
| SoundFileMode | mMode |
| r/w mode | |
| bool | mIsValid |
| is my file valid? | |
| bool | mIsLooping |
| am i looping start-stop? | |
| int | mStart |
| int | mStop |
| starting/ending frames (or -1 if not used) | |
| double | mRate |
| sample rate ratio | |
| unsigned | mNumFrames |
| # sample frames | |
| unsigned | mBytesPerSample |
| the # of bytes per sample | |
| Abst_SoundFile::Abst_SoundFile | ( | string | path, | |
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
| Abst_SoundFile::Abst_SoundFile | ( | string | folder, | |
| string | path, | |||
| int | start = -1, |
|||
| int | stop = -1 | |||
| ) |
Copy constructor -- shares sample buffer.
| Abst_SoundFile::Abst_SoundFile | ( | Abst_SoundFile & | otherSndFile | ) |
Copy constructor -- shares sample buffer.
References isCached(), csl::kLogError, csl::logMsg(), mPath, csl::WavetableOscillator::mWavetable, path(), setPath(), and csl::WavetableOscillator::setWaveform().
| Abst_SoundFile::~Abst_SoundFile | ( | ) |
| unsigned Abst_SoundFile::channels | ( | ) | const |
accessors
# chans
References mIsValid, and csl::UnitGenerator::mNumChannels.
Referenced by csl::SoundCue::channels(), csl::CASoundFile::dump(), csl::SoundCue::dump(), and dump().
| unsigned Abst_SoundFile::duration | ( | ) | const [virtual] |
number of frames in the sound file
Implements csl::Seekable.
Reimplemented in csl::JSoundFile.
References mNumFrames.
Referenced by isCached(), setStart(), setStartRatio(), setStop(), and setStopRatio().
| float Abst_SoundFile::durationInSecs | ( | ) |
actual duration of the selected portion in sec
References csl::UnitGenerator::mFrameRate, mIsValid, mStart, and mStop.
Referenced by csl::CASoundFile::dump(), and dump().
| virtual SoundFileFormat csl::Abst_SoundFile::format | ( | ) | [pure virtual] |
| bool csl::Abst_SoundFile::isValid | ( | ) | [inline] |
| bool Abst_SoundFile::isActive | ( | ) | [virtual] |
answer if currently active
Reimplemented from csl::UnitGenerator.
References csl::Seekable::mCurrentFrame, mIsValid, and mStop.
| unsigned csl::Abst_SoundFile::sampleSize | ( | ) | [inline] |
References mBytesPerSample.
| void Abst_SoundFile::setPath | ( | string | path | ) | [virtual] |
get the bytes-per-sample
set file name path string
References mPath.
Referenced by Abst_SoundFile().
| string csl::Abst_SoundFile::path | ( | ) | [inline] |
| void Abst_SoundFile::dump | ( | void | ) | [virtual] |
log snd file props
Reimplemented from csl::Oscillator.
Reimplemented in csl::CASoundFile.
References channels(), durationInSecs(), csl::UnitGenerator::frameRate(), csl::logMsg(), and path().
| SoundFileMode csl::Abst_SoundFile::mode | ( | ) | [inline] |
| int csl::Abst_SoundFile::startFrame | ( | ) | [inline] |
| void Abst_SoundFile::setStart | ( | int | val | ) |
References duration(), mIsValid, mStart, and seekTo().
Referenced by setStartRatio(), and setStartSec().
| void Abst_SoundFile::setStartSec | ( | float | val | ) |
References csl::UnitGenerator::mFrameRate, and setStart().
| void Abst_SoundFile::setStartRatio | ( | float | val | ) |
References duration(), and setStart().
| int csl::Abst_SoundFile::stopFrame | ( | ) | [inline] |
| void Abst_SoundFile::setStop | ( | int | val | ) |
| void Abst_SoundFile::setStopSec | ( | float | val | ) |
References csl::UnitGenerator::mFrameRate, and setStop().
| void Abst_SoundFile::setStopRatio | ( | float | val | ) |
References duration(), and setStop().
| double csl::Abst_SoundFile::playbackRate | ( | ) | [inline] |
| void Abst_SoundFile::setRate | ( | UnitGenerator & | frequency | ) |
set the receiver's playback rate (pitch ratio)
References csl::Controllable::addInput(), CSL_RATE, and csl::Controllable::mInputs.
| void Abst_SoundFile::setRate | ( | float | frequency | ) |
References csl::logMsg(), and mRate.
| bool csl::Abst_SoundFile::isLooping | ( | ) | [inline] |
| void csl::Abst_SoundFile::setIsLooping | ( | bool | tLooping | ) | [inline] |
References mIsLooping.
| bool Abst_SoundFile::isCached | ( | ) | [virtual] |
answer if file is loaded into RAM
References duration(), csl::Buffer::mNumFrames, and csl::WavetableOscillator::mWavetable.
Referenced by Abst_SoundFile(), and csl::LSoundFile::LSoundFile().
| virtual void csl::Abst_SoundFile::openForRead | ( | ) | throw (CException) [pure virtual] |
open file and get stats
Implemented in csl::CASoundFile, csl::JSoundFile, and csl::LSoundFile.
| virtual void csl::Abst_SoundFile::openForWrite | ( | SoundFileFormat | format = kSoundFileFormatAIFF, |
|
| unsigned | channels = 1, |
|||
| unsigned | rate = 44100, |
|||
| unsigned | bitDepth = 16 | |||
| ) | throw (CException) [pure virtual] |
Open a file for write. Default values are some common format.
Implemented in csl::CASoundFile, csl::JSoundFile, and csl::LSoundFile.
| virtual unsigned csl::Abst_SoundFile::seekTo | ( | int | position, | |
| SeekPosition | whence | |||
| ) | throw (CException) [pure virtual] |
seek to some position
Implements csl::Seekable.
Implemented in csl::CASoundFile, csl::JSoundFile, and csl::LSoundFile.
Referenced by setStart(), and trigger().
| unsigned csl::Abst_SoundFile::seekTo | ( | int | position | ) | throw (CException) [inline] |
| virtual void csl::Abst_SoundFile::readBufferFromFile | ( | unsigned | numFr | ) | [pure virtual] |
read a buffer from the file (possibly all of it)
Implemented in csl::CASoundFile, csl::JSoundFile, and csl::LSoundFile.
| void Abst_SoundFile::mergeToMono | ( | ) |
average all the channels to mono
References csl::Buffer::allocateBuffers(), csl::Buffer::copyFrom(), testkiss::j, csl::Buffer::mAreBuffersAllocated, csl::Buffer::mBuffers, csl::Buffer::mDidIAllocateBuffers, csl::UnitGenerator::mNumChannels, csl::Buffer::mNumFrames, and csl::WavetableOscillator::mWavetable.
| void Abst_SoundFile::setToEnd | ( | ) | [virtual] |
| void Abst_SoundFile::trigger | ( | ) | [virtual] |
| virtual void csl::Abst_SoundFile::close | ( | ) | [pure virtual] |
| void Abst_SoundFile::freeBuffer | ( | ) | [virtual] |
free the file cache
References csl::Buffer::freeBuffers(), csl::Buffer::mAreBuffersAllocated, and csl::WavetableOscillator::mWavetable.
Referenced by csl::LSoundFile::close(), csl::JSoundFile::close(), csl::CASoundFile::close(), and csl::LSoundFile::~LSoundFile().
| void Abst_SoundFile::nextBuffer | ( | Buffer & | outB | ) | throw (CException) [virtual] |
UGen operations.
copy next buffer from cache
Reimplemented from csl::UnitGenerator.
Reimplemented in csl::LSoundFile.
References csl_min, DECLARE_SCALABLE_CONTROLS, LOAD_SCALABLE_CONTROLS, csl::WavetableOscillator::nextBuffer(), and UPDATE_SCALABLE_CONTROLS.
| virtual void csl::Abst_SoundFile::writeBuffer | ( | Buffer & | inB | ) | throw (CException) [pure virtual] |
write a buffer of data into the file
Reimplemented from csl::Writeable.
Implemented in csl::CASoundFile, csl::JSoundFile, and csl::LSoundFile.
| virtual void csl::Abst_SoundFile::initFromSndfile | ( | ) | [protected, pure virtual] |
| void Abst_SoundFile::checkBuffer | ( | unsigned | numFrames | ) | [protected, virtual] |
allocate buffer lazily
Reimplemented in csl::LSoundFile.
References csl::Buffer::allocateBuffers(), csl::Buffer::freeBuffers(), csl::logMsg(), csl::Buffer::mAreBuffersAllocated, csl::UnitGenerator::mNumChannels, csl::Buffer::mNumFrames, csl::WavetableOscillator::mWavetable, and csl::Buffer::setSize().
Referenced by csl::JSoundFile::readBufferFromFile(), and csl::CASoundFile::readBufferFromFile().
string csl::Abst_SoundFile::mPath [protected] |
file name
Referenced by Abst_SoundFile(), csl::CASoundFile::CASoundFile(), csl::LSoundFile::LSoundFile(), csl::LSoundFile::openForRead(), csl::JSoundFile::openForRead(), csl::CASoundFile::openForRead(), csl::LSoundFile::openForReadWrite(), path(), csl::CASoundFile::readBufferFromFile(), and setPath().
SoundFileMode csl::Abst_SoundFile::mMode [protected] |
bool csl::Abst_SoundFile::mIsValid [protected] |
is my file valid?
Referenced by channels(), durationInSecs(), csl::LSoundFile::initFromSndfile(), csl::JSoundFile::initFromSndfile(), csl::CASoundFile::initFromSndfile(), isActive(), isValid(), csl::JSoundFile::openForRead(), csl::CASoundFile::openForRead(), and setStart().
bool csl::Abst_SoundFile::mIsLooping [protected] |
am i looping start-stop?
Referenced by isLooping(), csl::LSoundFile::readBufferFromFile(), csl::JSoundFile::readBufferFromFile(), csl::CASoundFile::readBufferFromFile(), and setIsLooping().
int csl::Abst_SoundFile::mStart [protected] |
int csl::Abst_SoundFile::mStop [protected] |
starting/ending frames (or -1 if not used)
Referenced by durationInSecs(), csl::LSoundFile::initFromSndfile(), csl::JSoundFile::initFromSndfile(), csl::CASoundFile::initFromSndfile(), isActive(), csl::LSoundFile::readBufferFromFile(), csl::JSoundFile::readBufferFromFile(), csl::CASoundFile::readBufferFromFile(), setStop(), setToEnd(), and stopFrame().
double csl::Abst_SoundFile::mRate [protected] |
unsigned csl::Abst_SoundFile::mNumFrames [protected] |
unsigned csl::Abst_SoundFile::mBytesPerSample [protected] |
the # of bytes per sample
Referenced by csl::LSoundFile::initFromSndfile(), csl::JSoundFile::initFromSndfile(), csl::CASoundFile::openForRead(), csl::CASoundFile::readBufferFromFile(), and sampleSize().
1.5.8