CSL  6.0
csl::StdIO Class Reference

StdIO reads/write the UNIX Standard IO pipes. More...

#include <NullIO.h>

+ Inheritance diagram for csl::StdIO:

Public Member Functions

 StdIO ()
 Constructor. More...
 
 StdIO (unsigned s_rate, unsigned b_size, int in_device=0, int out_device=0, unsigned in_chans=0, unsigned out_chans=2)
 
virtual ~StdIO ()
 
void start () throw (CException)
 start my timer thread More...
 
void stop () throw (CException)
 stop the timer thread More...
 
virtual BuffergetInput () throw (CException)
 Get the current input from the sound card. More...
 
virtual BuffergetInput (unsigned numFrames, unsigned numChannels) throw (CException)
 
virtual void open () throw (CException)
 
virtual void close () throw (CException)
 open/close start/stop methods More...
 
virtual void test () throw (CException)
 
virtual void capture_on (float dur)
 test the IO's graph More...
 
virtual void capture_off ()
 end output capture More...
 
virtual Bufferget_capture ()
 answer the capture buffer More...
 
void setRoot (UnitGenerator &root)
 set/clear my graph root generator More...
 
void clearRoot ()
 
void pullInput (Buffer &outBuffer, SampleBuffer out=0) throw (CException)
 get a buffer from the CSL graph More...
 
unsigned getAndIncrementSequence ()
 increment and answer my seq # More...
 
void printTimeStatistics (struct timeval *tthen, struct timeval *tnow, long *tsecond, long *ttimeSum, long *ttimeVals)
 
void attachObserver (Observer *)
 (possibly notify obersvers on my death) More...
 
void detachObserver (Observer *)
 
void changed (void *argument)
 this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map More...
 
virtual int evaluate (void *argument)
 
int createThread (VoidFcnPtr *func, void *args)
 
void stopThread (int timeOutMilliseconds)
 

Static Public Member Functions

static CThreadMakeThread ()
 factory method More...
 

Public Attributes

UnitGeneratormGraph
 the root of my client DSP graph, often a mixer or panner More...
 
Buffer mInputBuffer
 the most recent input buffer (if it's turned on) More...
 
Buffer mOutputBuffer
 the output buffer I use (passed to nextBuffer calls) More...
 
Buffer mCaptureBuffer
 the output buffer I use for capturing output (for testing) More...
 
SampleBuffer mInputPointer
 the buffer for holding the sound card input (if open) More...
 
unsigned * mChannelMap
 the output channel remapping array More...
 
unsigned mNumFramesPlayed
 counter of frames I've played More...
 
unsigned mSequence
 sequence counter More...
 
unsigned mLoggingPeriod
 logging period in seconds More...
 
unsigned mNumInChannels
 

inputs

More...
 
unsigned mNumOutChannels
 

outputs

More...
 
unsigned mNumRealInChannels
 

physical inputs

More...
 
unsigned mNumRealOutChannels
 

physical outputs

More...
 
IO_Status mStatus
 status flag More...
 
bool mInterleaved
 flag if IO is interleaved More...
 
unsigned mOffset
 used for capture offset More...
 
struct timeval mThen mNow
 used for getting the real time More...
 
long mTimeVals
 
long mThisSec
 
long mTimeSum
 for printing run-time statistics More...
 
float mUsage
 cpu usage % print the CPU usage message More...
 
pthread_attr_t mAttributes
 

Protected Member Functions

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

Static Protected Member Functions

static void * FeederFunction (void *arg)
 shared init function More...
 

Protected Attributes

bool mRunning
 
juce::Thread * mThread
 whether or not I'm running More...
 
SynchmSynch
 the sync I wait on More...
 
float maxSampEver
 

Detailed Description

StdIO reads/write the UNIX Standard IO pipes.

Definition at line 49 of file NullIO.h.

Constructor & Destructor Documentation

StdIO::StdIO ( )

Constructor.

Definition at line 52 of file NullIO.cpp.

References csl::Synch::MakeSynch(), csl::NullIO::mSynch, and csl::NullIO::mThread.

csl::StdIO::StdIO ( unsigned  s_rate,
unsigned  b_size,
int  in_device = 0,
int  out_device = 0,
unsigned  in_chans = 0,
unsigned  out_chans = 2 
)
StdIO::~StdIO ( )
virtual

Definition at line 57 of file NullIO.cpp.

Member Function Documentation

void StdIO::start ( )
throw (CException
)
virtual

start my timer thread

< start my timer thread

Reimplemented from csl::NullIO.

Definition at line 71 of file NullIO.cpp.

void StdIO::stop ( )
throw (CException
)
virtual

stop the timer thread

< stop the timer thread

Reimplemented from csl::NullIO.

Definition at line 74 of file NullIO.cpp.

void * StdIO::FeederFunction ( void *  arg)
staticprotected
virtual Buffer& csl::NullIO::getInput ( )
throw (CException
)
inlinevirtualinherited

Get the current input from the sound card.

Reimplemented from csl::IO.

Definition at line 33 of file NullIO.h.

References csl::IO::mInputBuffer.

virtual Buffer& csl::NullIO::getInput ( unsigned  numFrames,
unsigned  numChannels 
)
throw (CException
)
inlinevirtualinherited

Reimplemented from csl::IO.

Definition at line 34 of file NullIO.h.

virtual void csl::IO::open ( )
throw (CException
)
inlinevirtualinherited
virtual void csl::IO::close ( )
throw (CException
)
inlinevirtualinherited

open/close start/stop methods

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

Definition at line 760 of file CSL_Core.h.

References csl::kIOClosed, and csl::IO::mStatus.

Referenced by playSineMixer(), and quit_handler().

virtual void csl::IO::test ( )
throw (CException
)
inlinevirtualinherited

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

Definition at line 763 of file CSL_Core.h.

void IO::capture_on ( float  dur)
virtualinherited
void IO::capture_off ( )
virtualinherited

end output capture

Definition at line 1544 of file CSL_Core.cpp.

References csl::IO::mCaptureBuffer, and csl::Buffer::setSize().

Referenced by test_convolution_file().

Buffer * IO::get_capture ( )
virtualinherited

answer the capture buffer

Definition at line 1550 of file CSL_Core.cpp.

References csl::IO::mCaptureBuffer.

Referenced by test_convolution_file().

unsigned IO::getAndIncrementSequence ( )
inherited

increment and answer my seq #

Definition at line 1418 of file CSL_Core.cpp.

References csl::IO::mSequence.

void IO::printTimeStatistics ( struct timeval *  tthen,
struct timeval *  tnow,
long *  tsecond,
long *  ttimeSum,
long *  ttimeVals 
)
inherited
virtual void csl::IO::initialize ( unsigned  sr,
unsigned  bs,
int  is,
int  os,
unsigned  ic,
unsigned  oc 
)
inlineprotectedvirtualinherited

initialize overridden in subclasses

Reimplemented in csl::PAIO.

Definition at line 805 of file CSL_Core.h.

void Model::attachObserver ( Observer o)
inherited

(possibly notify obersvers on my death)

register/remove observers

Definition at line 502 of file CGestalt.cpp.

References csl::logMsg(), csl::Observer::mKey, and csl::Observer::mPeriod.

Referenced by CSLMIDIComponent::CSLMIDIComponent(), and csl::SpatialPanner::setSpeakerLayout().

void Model::detachObserver ( Observer o)
inherited
void Model::changed ( void *  argument)
inherited

this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map

Definition at line 540 of file CGestalt.cpp.

References csl::logMsg().

Referenced by csl::SpeakerLayout::addSpeaker(), csl::MIDIIn::handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().

virtual int csl::Model::evaluate ( void *  argument)
inlinevirtualinherited

Reimplemented in csl::MIDIIn.

Definition at line 270 of file CGestalt.h.

int ThreadPthread::createThread ( VoidFcnPtr func,
void *  args 
)
virtualinherited

Implements csl::CThread.

Definition at line 110 of file ThreadUtilities.cpp.

References csl::CThread::mAttributes, and csl::CThread::mThread.

Referenced by PME::start_management_thread().

CThread * CThread::MakeThread ( )
staticinherited

factory method

Definition at line 46 of file ThreadUtilities.cpp.

Referenced by csl::GrainCloud::GrainCloud(), and csl::FileIO::open().

void CThread::stopThread ( int  timeOutMilliseconds)
inherited

Definition at line 50 of file ThreadUtilities.cpp.

References csl::CThread::mThread.

Referenced by csl::GrainCloud::~GrainCloud().

Member Data Documentation

bool csl::NullIO::mRunning
protectedinherited
juce::Thread* csl::NullIO::mThread
protectedinherited

whether or not I'm running

my timer thread

Definition at line 38 of file NullIO.h.

Referenced by csl::NullIO::NullIO(), csl::NullIO::start(), and StdIO().

Synch* csl::NullIO::mSynch
protectedinherited

the sync I wait on

Definition at line 39 of file NullIO.h.

Referenced by csl::NullIO::FeederFunction(), FeederFunction(), csl::NullIO::NullIO(), StdIO(), and csl::NullIO::stop().

Buffer csl::IO::mOutputBuffer
inherited
Buffer csl::IO::mCaptureBuffer
inherited

the output buffer I use for capturing output (for testing)

Definition at line 780 of file CSL_Core.h.

Referenced by csl::IO::capture_off(), csl::IO::capture_on(), and csl::IO::get_capture().

SampleBuffer csl::IO::mInputPointer
inherited

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

Definition at line 781 of file CSL_Core.h.

Referenced by pa_callback().

unsigned* csl::IO::mChannelMap
inherited

the output channel remapping array

Definition at line 782 of file CSL_Core.h.

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

unsigned csl::IO::mNumFramesPlayed
inherited

counter of frames I've played

Definition at line 784 of file CSL_Core.h.

Referenced by csl::JUCEIO::audioDeviceIOCallback(), pa_callback(), RenderCallback(), csl::AUIO::start(), and csl::FileIO::writeNextBuffer().

unsigned csl::IO::mSequence
inherited

sequence counter

Definition at line 785 of file CSL_Core.h.

Referenced by csl::IO::getAndIncrementSequence().

unsigned csl::IO::mLoggingPeriod
inherited

logging period in seconds

Definition at line 786 of file CSL_Core.h.

Referenced by csl::IO::printTimeStatistics().

unsigned csl::IO::mNumInChannels
inherited

inputs

Definition at line 787 of file CSL_Core.h.

Referenced by csl::JUCEIO::audioDeviceIOCallback(), csl::PAIO::initialize(), and pa_callback().

unsigned csl::IO::mNumOutChannels
inherited
unsigned csl::IO::mNumRealInChannels
inherited

physical inputs

Definition at line 789 of file CSL_Core.h.

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

unsigned csl::IO::mNumRealOutChannels
inherited

physical outputs

Definition at line 790 of file CSL_Core.h.

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

bool csl::IO::mInterleaved
inherited

flag if IO is interleaved

Definition at line 792 of file CSL_Core.h.

Referenced by csl::InOut::InOut(), and csl::VSTIO::VSTIO().

unsigned csl::IO::mOffset
inherited

used for capture offset

Definition at line 793 of file CSL_Core.h.

Referenced by csl::IO::capture_on(), and test_convolution_file().

struct timeval mThen csl::IO::mNow
inherited

used for getting the real time

Definition at line 796 of file CSL_Core.h.

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

long csl::IO::mTimeVals
inherited
long csl::IO::mThisSec
inherited
long csl::IO::mTimeSum
inherited

for printing run-time statistics

Definition at line 797 of file CSL_Core.h.

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

float csl::IO::mUsage
inherited

cpu usage % print the CPU usage message

Definition at line 798 of file CSL_Core.h.

Referenced by csl::IO::printTimeStatistics().

float csl::IO::maxSampEver
protectedinherited

Definition at line 805 of file CSL_Core.h.

Referenced by csl::IO::printTimeStatistics().

pthread_attr_t csl::CThread::mAttributes
inherited

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