Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


RtDuplex.h

00001 /***************************************************/
00029 /***************************************************/
00030 
00031 #ifndef STK_RTDUPLEX_H
00032 #define STK_RTDUPLEX_H
00033 
00034 #include "Stk.h"
00035 #include "RtAudio.h"
00036 
00037 class RtDuplex : public Stk
00038 {
00039 public:
00041 
00052   RtDuplex(int nChannels = 1, StkFloat sampleRate = Stk::sampleRate(), int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 2);
00053 
00055   ~RtDuplex();
00056 
00058 
00061   void start(void);
00062 
00064 
00067   void stop(void);
00068 
00070   StkFloat lastOut(void) const;
00071 
00073 
00076   StkFloat tick(const StkFloat sample);
00077 
00079 
00082   StkFloat *tick(StkFloat *vector, unsigned int vectorSize);
00083 
00085 
00092   StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
00093 
00095   const StkFloat *lastFrame(void) const;
00096 
00098 
00101   StkFloat *tickFrame(StkFloat *frameVector, unsigned int frames = 1);
00102 
00104 
00110   StkFrames& tickFrame( StkFrames& frames );
00111 
00112 protected:
00113 
00114          RtAudio *audio_;
00115   StkFloat *data_;
00116   StkFloat *lastOutput_;
00117   int bufferSize_;
00118   bool stopped_;
00119   long counter_;
00120   unsigned int channels_;
00121 
00122 };
00123 
00124 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.