Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


RtWvOut.h

00001 /***************************************************/
00019 /***************************************************/
00020 
00021 #ifndef STK_RTWVOUT_H
00022 #define STK_RTWVOUT_H
00023 
00024 #include "WvOut.h"
00025 #include "RtAudio.h"
00026 
00027 class RtWvOut : public WvOut
00028 {
00029  public:
00030 
00032 
00042   RtWvOut( unsigned int nChannels = 1, StkFloat sampleRate = Stk::sampleRate(),
00043            int device = 0, int bufferFrames = RT_BUFFER_SIZE, int nBuffers = 20 );
00044 
00046   ~RtWvOut();
00047 
00049 
00053   void start( void );
00054 
00056 
00060   void stop( void );
00061 
00062   // This function is not intended for general use but had to be made
00063   // public for access from the audio callback function.
00064   int readBuffer( void *buffer, unsigned int frameCount );
00065 
00066  protected:
00067 
00068   void computeSample( const StkFloat sample );
00069   void computeFrames( const StkFrames& frames );
00070 
00071   RtAudio dac_;
00072   bool stopped_;
00073   unsigned int readIndex_;
00074   unsigned int writeIndex_;
00075   long framesFilled_;
00076   unsigned int status_; // running = 0, emptying buffer = 1, finished = 2
00077 
00078 };
00079 
00080 #endif

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