csl::IO Class Reference

#include <CSL_Core.h>

Inheritance diagram for csl::IO:

csl::AUIO csl::FileIO csl::JackIO csl::JUCEIO csl::NullIO csl::PAIO csl::RemoteIO csl::VSTIO

List of all members.

Public Member Functions

 IO (unsigned s_rate=44100, unsigned b_size=CGestalt::blockSize(), int in_device=-1, int out_device=-1, unsigned in_chans=0, unsigned out_chans=2)
virtual ~IO ()
 default is stereo output
virtual void open () throw (CException)
virtual void close () throw (CException)
 open/close start/stop methods
virtual void start () throw (CException)
virtual void stop () throw (CException)
virtual void test () throw (CException)
void setRoot (UnitGenerator &root)
 test the IO's graph
void clearRoot ()
 set/clear my graph root generator
void pullInput (Buffer &outBuffer, SampleBuffer out=0) throw (CException)
 get a buffer from the CSL graph
virtual BuffergetInput () throw (CException)
 Get the current input from the sound card.
virtual BuffergetInput (unsigned numFrames, unsigned numChannels) throw (CException)
unsigned getAndIncrementSequence ()
 increment and answer my seq #
void printTimeStatistics (struct timeval *tthen, struct timeval *tnow, long *tsecond, long *ttimeSum, long *ttimeVals)

Public Attributes

 the root of my client DSP graph, often a mixer or panner
Buffer mInputBuffer
 the most recent input buffer (if it's turned on)
Buffer mOutputBuffer
 the output buffer I use (passed to nextBuffer calls)
SampleBuffer mInputPointer
 the buffer for holding the sound card input (if open)
unsigned * mChannelMap
 the output channel remapping array
unsigned mNumFramesPlayed
 counter of frames I've played
unsigned mSequence
 sequence counter
unsigned mLoggingPeriod
 logging period in seconds
unsigned mNumInChannels
 # inputs
unsigned mNumOutChannels
 # outputs
unsigned mNumRealInChannels
 # physical inputs
unsigned mNumRealOutChannels
 # physical outputs
IO_Status mStatus
 status flag
struct timeval mThen mNow
 used for getting the real time
long mTimeVals
long mThisSec
long mTimeSum

Protected Member Functions

virtual void initialize (unsigned sr, unsigned bs, int is, int os, unsigned ic, unsigned oc)
 initialize overridden in subclasses

Detailed Description

IO -- the abstract I/O scheduling class; subclasses interface to specific I/O APIs. An IO object has a graph (a ptr to a UGen), and it registers itself with some call-back API (like PortAudio, CoreAudio, Jack, VST, JUCE), setting up a callback function that in turn calls the nextBuffer() method of its graph root. One creates an IO with the desired rate, block size (optional) I/O device keys, and the number of in and out channels; you then set its root to be your DSP graph and send it start/stop messages.

All this is public because it's used by static call-back functions.

Constructor & Destructor Documentation

IO::IO ( unsigned  s_rate = 44100,
unsigned  b_size = CGestalt::blockSize(),
int  in_device = -1,
int  out_device = -1,
unsigned  in_chans = 0,
unsigned  out_chans = 2 

References csl::logMsg().

virtual csl::IO::~IO (  )  [inline, virtual]

default is stereo output

Member Function Documentation

virtual void csl::IO::open (  )  throw (CException) [inline, virtual]

virtual void csl::IO::close (  )  throw (CException) [inline, virtual]

open/close start/stop methods

Reimplemented in csl::AUIO, csl::CAIO, csl::FileIO, csl::JackIO, csl::JUCEIO, csl::PAIO, csl::RemoteIO, and csl::VSTIO.

References csl::kIOClosed.

Referenced by main(), and csl::CSLService::stop().

virtual void csl::IO::start ( void   )  throw (CException) [inline, virtual]

virtual void csl::IO::stop ( void   )  throw (CException) [inline, virtual]

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

Reimplemented in csl::FileIO, and csl::PAIO.

void IO::setRoot ( UnitGenerator root  ) 

void IO::clearRoot (  ) 

set/clear my graph root generator

References mGraph, and csl::UnitGenerator::removeOutput().

Referenced by dumpTest(), runTest(), testMultiTap(), testReverb(), and testStereoverb().

void IO::pullInput ( Buffer outBuffer,
SampleBuffer  out = 0 
) throw (CException)

Buffer & IO::getInput (  )  throw (CException) [virtual]

Get the current input from the sound card.

Reimplemented in csl::AUIO, csl::FileIO, and csl::NullIO.

References mInputBuffer, csl::Buffer::mNumChannels, and csl::Buffer::mNumFrames.

Buffer & IO::getInput ( unsigned  numFrames,
unsigned  numChannels 
) throw (CException) [virtual]

unsigned IO::getAndIncrementSequence (  ) 

increment and answer my seq #

References mSequence.

void IO::printTimeStatistics ( struct timeval *  tthen,
struct timeval *  tnow,
long *  tsecond,
long *  ttimeSum,
long *  ttimeVals 

virtual void csl::IO::initialize ( unsigned  sr,
unsigned  bs,
int  is,
int  os,
unsigned  ic,
unsigned  oc 
) [inline, protected, virtual]

initialize overridden in subclasses

Reimplemented in csl::PAIO.

Member Data Documentation

the root of my client DSP graph, often a mixer or panner

Referenced by csl::JUCEIO::audioDeviceIOCallback(), clearRoot(), pa_callback(), setRoot(), csl::PAIO::test(), and csl::FileIO::writeNextBuffer().

the buffer for holding the sound card input (if open)

Referenced by pa_callback().

the output channel remapping array

Referenced by csl::PAIO::initialize().

sequence counter

Referenced by getAndIncrementSequence().

logging period in seconds

Referenced by printTimeStatistics().

# physical inputs

Referenced by csl::PAIO::initialize().

# physical outputs

Referenced by csl::PAIO::initialize().

struct timeval mThen csl::IO::mNow [read]

used for getting the real time

Referenced by csl::FileIO::threadFunction().

for printing run-time statistics print the CPU usage message

Referenced by csl::PAIO::open(), csl::FileIO::open(), csl::AUIO::open(), and csl::FileIO::threadFunction().

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