From f44483cc73ce2a36229c3f904c4230243a181e51 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 11 Oct 2013 01:56:49 +0200 Subject: Release 4.0.5 tarball --- doc/html/RtAudio_8h-source.html | 1182 ++++++++++---------- doc/html/RtAudio_8h.html | 161 ++- doc/html/RtError_8h-source.html | 47 +- doc/html/acknowledge.html | 12 +- doc/html/annotated.html | 16 +- doc/html/apinotes.html | 32 +- doc/html/bugs.html | 17 +- doc/html/classRtAudio-members.html | 63 +- doc/html/classRtAudio.html | 799 ++++++------- doc/html/classRtError-members.html | 44 +- doc/html/classRtError.html | 118 +- doc/html/classes.html | 25 + doc/html/compiling.html | 14 +- doc/html/doxygen.css | 636 ++++++----- doc/html/duplex.html | 44 +- doc/html/errors.html | 8 +- doc/html/files.html | 8 +- doc/html/functions.html | 222 ++-- doc/html/functions_enum.html | 24 +- doc/html/functions_eval.html | 73 +- doc/html/functions_func.html | 92 +- doc/html/functions_vars.html | 65 +- doc/html/globals.html | 25 +- doc/html/globals_type.html | 27 +- doc/html/index.html | 18 +- doc/html/license.html | 12 +- doc/html/multi.html | 10 +- doc/html/pages.html | 8 +- doc/html/playback.html | 43 +- doc/html/probe.html | 52 +- doc/html/recording.html | 42 +- doc/html/settings.html | 38 +- doc/html/structRtAudio_1_1DeviceInfo-members.html | 28 +- doc/html/structRtAudio_1_1DeviceInfo.html | 288 ++--- .../structRtAudio_1_1StreamOptions-members.html | 17 +- doc/html/structRtAudio_1_1StreamOptions.html | 134 ++- .../structRtAudio_1_1StreamParameters-members.html | 16 +- doc/html/structRtAudio_1_1StreamParameters.html | 108 +- doc/html/tab_b.gif | Bin 0 -> 35 bytes doc/html/tab_l.gif | Bin 0 -> 706 bytes doc/html/tab_r.gif | Bin 0 -> 2585 bytes doc/html/tabs.css | 105 ++ doc/html/updates.html | 9 +- 43 files changed, 2507 insertions(+), 2175 deletions(-) create mode 100644 doc/html/classes.html create mode 100644 doc/html/tab_b.gif create mode 100644 doc/html/tab_l.gif create mode 100644 doc/html/tab_r.gif create mode 100644 doc/html/tabs.css (limited to 'doc/html') diff --git a/doc/html/RtAudio_8h-source.html b/doc/html/RtAudio_8h-source.html index 956812c..7c1fb87 100644 --- a/doc/html/RtAudio_8h-source.html +++ b/doc/html/RtAudio_8h-source.html @@ -8,11 +8,11 @@
Home   Class/Enum List   File List   Compound Members  

- +

RtAudio.h

Go to the documentation of this file.
00001 /************************************************************************/
 00039 /************************************************************************/
 00040 
-00045 // RtAudio: Version 4.0.4
+00045 // RtAudio: Version 4.0.5
 00046 
 00047 #ifndef __RTAUDIO_H
 00048 #define __RTAUDIO_H
@@ -21,612 +21,620 @@
 00051 #include <vector>
 00052 #include "RtError.h"
 00053 
-00070 typedef unsigned long RtAudioFormat;
-00071 static const RtAudioFormat RTAUDIO_SINT8 = 0x1;    // 8-bit signed integer.
-00072 static const RtAudioFormat RTAUDIO_SINT16 = 0x2;   // 16-bit signed integer.
-00073 static const RtAudioFormat RTAUDIO_SINT24 = 0x4;   // Lower 3 bytes of 32-bit signed integer.
-00074 static const RtAudioFormat RTAUDIO_SINT32 = 0x8;   // 32-bit signed integer.
-00075 static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; // Normalized between plus/minus 1.0.
-00076 static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/minus 1.0.
+00070 typedef unsigned long RtAudioFormat;
+00071 static const RtAudioFormat RTAUDIO_SINT8 = 0x1;    // 8-bit signed integer.
+00072 static const RtAudioFormat RTAUDIO_SINT16 = 0x2;   // 16-bit signed integer.
+00073 static const RtAudioFormat RTAUDIO_SINT24 = 0x4;   // Lower 3 bytes of 32-bit signed integer.
+00074 static const RtAudioFormat RTAUDIO_SINT32 = 0x8;   // 32-bit signed integer.
+00075 static const RtAudioFormat RTAUDIO_FLOAT32 = 0x10; // Normalized between plus/minus 1.0.
+00076 static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/minus 1.0.
 00077 
-00112 typedef unsigned int RtAudioStreamFlags;
-00113 static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1;    // Use non-interleaved buffers (default = interleaved).
-00114 static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2;  // Attempt to set stream parameters for lowest possible latency.
-00115 static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4;        // Attempt grab device and prevent use by others.
-00116 
-00128 typedef unsigned int RtAudioStreamStatus;
-00129 static const RtAudioStreamStatus RTAUDIO_INPUT_OVERFLOW = 0x1;    // Input data was discarded because of an overflow condition at the driver.
-00130 static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2;  // The output buffer ran low, likely causing a gap in the output sound.
-00131 
-00133 
-00171 typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
-00172                                 unsigned int nFrames,
-00173                                 double streamTime,
-00174                                 RtAudioStreamStatus status,
-00175                                 void *userData );
-00176 
-00177 
-00178 // **************************************************************** //
-00179 //
-00180 // RtAudio class declaration.
-00181 //
-00182 // RtAudio is a "controller" used to select an available audio i/o
-00183 // interface.  It presents a common API for the user to call but all
-00184 // functionality is implemented by the class RtApi and its
-00185 // subclasses.  RtAudio creates an instance of an RtApi subclass
-00186 // based on the user's API choice.  If no choice is made, RtAudio
-00187 // attempts to make a "logical" API selection.
-00188 //
-00189 // **************************************************************** //
-00190 
-00191 class RtApi;
-00192 
-00193 class RtAudio
-00194 {
-00195  public:
+00115 typedef unsigned int RtAudioStreamFlags;
+00116 static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1;    // Use non-interleaved buffers (default = interleaved).
+00117 static const RtAudioStreamFlags RTAUDIO_MINIMIZE_LATENCY = 0x2;  // Attempt to set stream parameters for lowest possible latency.
+00118 static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4;        // Attempt grab device and prevent use by others.
+00119 static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread.
+00120 
+00132 typedef unsigned int RtAudioStreamStatus;
+00133 static const RtAudioStreamStatus RTAUDIO_INPUT_OVERFLOW = 0x1;    // Input data was discarded because of an overflow condition at the driver.
+00134 static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2;  // The output buffer ran low, likely causing a gap in the output sound.
+00135 
+00137 
+00175 typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
+00176                                 unsigned int nFrames,
+00177                                 double streamTime,
+00178                                 RtAudioStreamStatus status,
+00179                                 void *userData );
+00180 
+00181 
+00182 // **************************************************************** //
+00183 //
+00184 // RtAudio class declaration.
+00185 //
+00186 // RtAudio is a "controller" used to select an available audio i/o
+00187 // interface.  It presents a common API for the user to call but all
+00188 // functionality is implemented by the class RtApi and its
+00189 // subclasses.  RtAudio creates an instance of an RtApi subclass
+00190 // based on the user's API choice.  If no choice is made, RtAudio
+00191 // attempts to make a "logical" API selection.
+00192 //
+00193 // **************************************************************** //
+00194 
+00195 class RtApi;
 00196 
-00198   enum Api {
-00199     UNSPECIFIED,    
-00200     LINUX_ALSA,     
-00201     LINUX_OSS,      
-00202     UNIX_JACK,      
-00203     MACOSX_CORE,    
-00204     WINDOWS_ASIO,   
-00205     WINDOWS_DS,     
-00206     RTAUDIO_DUMMY   
-00207   };
-00208 
-00210   struct DeviceInfo {
-00211     bool probed;                  
-00212     std::string name;             
-00213     unsigned int outputChannels;  
-00214     unsigned int inputChannels;   
-00215     unsigned int duplexChannels;  
-00216     bool isDefaultOutput;         
-00217     bool isDefaultInput;          
-00218     std::vector<unsigned int> sampleRates; 
-00219     RtAudioFormat nativeFormats;  
-00221     // Default constructor.
-00222     DeviceInfo()
-00223       :probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
-00224        isDefaultOutput(false), isDefaultInput(false), nativeFormats(0) {}
-00225   };
-00226 
-00228   struct StreamParameters {
-00229     unsigned int deviceId;     
-00230     unsigned int nChannels;    
-00231     unsigned int firstChannel; 
-00233     // Default constructor.
-00234     StreamParameters()
-00235       : deviceId(0), nChannels(0), firstChannel(0) {}
-00236   };
-00237 
-00239 
-00284   struct StreamOptions {
-00285     RtAudioStreamFlags flags;      
-00286     unsigned int numberOfBuffers;  
-00287     std::string streamName;        
-00289     // Default constructor.
-00290     StreamOptions()
-00291       : flags(0), numberOfBuffers(0) {}
-00292   };
-00293 
-00295 
-00300   static void getCompiledApi( std::vector<RtAudio::Api> &apis ) throw();
-00301 
-00303 
-00311   RtAudio( RtAudio::Api api=UNSPECIFIED ) throw();
+00197 class RtAudio
+00198 {
+00199  public:
+00200 
+00202   enum Api {
+00203     UNSPECIFIED,    
+00204     LINUX_ALSA,     
+00205     LINUX_OSS,      
+00206     UNIX_JACK,      
+00207     MACOSX_CORE,    
+00208     WINDOWS_ASIO,   
+00209     WINDOWS_DS,     
+00210     RTAUDIO_DUMMY   
+00211   };
+00212 
+00214   struct DeviceInfo {
+00215     bool probed;                  
+00216     std::string name;             
+00217     unsigned int outputChannels;  
+00218     unsigned int inputChannels;   
+00219     unsigned int duplexChannels;  
+00220     bool isDefaultOutput;         
+00221     bool isDefaultInput;          
+00222     std::vector<unsigned int> sampleRates; 
+00223     RtAudioFormat nativeFormats;  
+00225     // Default constructor.
+00226     DeviceInfo()
+00227       :probed(false), outputChannels(0), inputChannels(0), duplexChannels(0),
+00228        isDefaultOutput(false), isDefaultInput(false), nativeFormats(0) {}
+00229   };
+00230 
+00232   struct StreamParameters {
+00233     unsigned int deviceId;     
+00234     unsigned int nChannels;    
+00235     unsigned int firstChannel; 
+00237     // Default constructor.
+00238     StreamParameters()
+00239       : deviceId(0), nChannels(0), firstChannel(0) {}
+00240   };
+00241 
+00243 
+00294   struct StreamOptions {
+00295     RtAudioStreamFlags flags;      
+00296     unsigned int numberOfBuffers;  
+00297     std::string streamName;        
+00298     int priority;                  
+00300     // Default constructor.
+00301     StreamOptions()
+00302     : flags(0), numberOfBuffers(0), priority(0) {}
+00303   };
+00304 
+00306 
+00311   static void getCompiledApi( std::vector<RtAudio::Api> &apis ) throw();
 00312 
 00314 
-00318   ~RtAudio() throw();
-00319 
-00321   RtAudio::Api getCurrentApi( void ) throw();
-00322 
-00324 
-00329   unsigned int getDeviceCount( void ) throw();
+00322   RtAudio( RtAudio::Api api=UNSPECIFIED ) throw();
+00323 
+00325 
+00329   ~RtAudio() throw();
 00330 
-00332 
-00342   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
+00332   RtAudio::Api getCurrentApi( void ) throw();
+00333 
+00335 
+00340   unsigned int getDeviceCount( void ) throw();
+00341 
 00343 
-00345 
-00352   unsigned int getDefaultOutputDevice( void ) throw();
-00353 
-00355 
-00362   unsigned int getDefaultInputDevice( void ) throw();
-00363 
-00365 
-00402   void openStream( RtAudio::StreamParameters *outputParameters,
-00403                    RtAudio::StreamParameters *inputParameters,
-00404                    RtAudioFormat format, unsigned int sampleRate,
-00405                    unsigned int *bufferFrames, RtAudioCallback callback,
-00406                    void *userData = NULL, RtAudio::StreamOptions *options = NULL );
-00407 
-00409 
-00413   void closeStream( void ) throw();
-00414 
-00416 
-00422   void startStream( void );
-00423 
+00353   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
+00354 
+00356 
+00363   unsigned int getDefaultOutputDevice( void ) throw();
+00364 
+00366 
+00373   unsigned int getDefaultInputDevice( void ) throw();
+00374 
+00376 
+00413   void openStream( RtAudio::StreamParameters *outputParameters,
+00414                    RtAudio::StreamParameters *inputParameters,
+00415                    RtAudioFormat format, unsigned int sampleRate,
+00416                    unsigned int *bufferFrames, RtAudioCallback callback,
+00417                    void *userData = NULL, RtAudio::StreamOptions *options = NULL );
+00418 
+00420 
+00424   void closeStream( void ) throw();
 00425 
-00431   void stopStream( void );
-00432 
+00427 
+00433   void startStream( void );
 00434 
-00440   void abortStream( void );
-00441 
-00443   bool isStreamOpen( void ) throw();
-00444 
-00446   bool isStreamRunning( void ) throw();
-00447 
-00449 
-00452   double getStreamTime( void );
-00453 
+00436 
+00442   void stopStream( void );
+00443 
+00445 
+00451   void abortStream( void );
+00452 
+00454   bool isStreamOpen( void ) const throw();
 00455 
-00463   long getStreamLatency( void );
+00457   bool isStreamRunning( void ) const throw();
+00458 
+00460 
+00463   double getStreamTime( void );
 00464 
-00466   void showWarnings( bool value = true ) throw();
-00467 
-00468  protected:
-00469 
-00470   void openRtApi( RtAudio::Api api );
-00471   RtApi *rtapi_;
-00472 };
-00473 
-00474 // Operating system dependent thread functionality.
-00475 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
-00476   #include <windows.h>
-00477   #include <process.h>
-00478 
-00479   typedef unsigned long ThreadHandle;
-00480   typedef CRITICAL_SECTION StreamMutex;
-00481 
-00482 #elif defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
-00483   // Using pthread library for various flavors of unix.
-00484   #include <pthread.h>
-00485 
-00486   typedef pthread_t ThreadHandle;
-00487   typedef pthread_mutex_t StreamMutex;
+00466 
+00474   long getStreamLatency( void );
+00475 
+00477 
+00482   unsigned int getStreamSampleRate( void );
+00483 
+00485   void showWarnings( bool value = true ) throw();
+00486 
+00487  protected:
 00488 
-00489 #else // Setup for "dummy" behavior
-00490 
-00491   #define __RTAUDIO_DUMMY__
-00492   typedef int ThreadHandle;
-00493   typedef int StreamMutex;
-00494 
-00495 #endif
-00496 
-00497 // This global structure type is used to pass callback information
-00498 // between the private RtAudio stream structure and global callback
-00499 // handling functions.
-00500 struct CallbackInfo {
-00501   void *object;    // Used as a "this" pointer.
-00502   ThreadHandle thread;
-00503   void *callback;
-00504   void *userData;
-00505   void *apiInfo;   // void pointer for API specific callback information
-00506   bool isRunning;
+00489   void openRtApi( RtAudio::Api api );
+00490   RtApi *rtapi_;
+00491 };
+00492 
+00493 // Operating system dependent thread functionality.
+00494 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
+00495   #include <windows.h>
+00496   #include <process.h>
+00497 
+00498   typedef unsigned long ThreadHandle;
+00499   typedef CRITICAL_SECTION StreamMutex;
+00500 
+00501 #elif defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)
+00502   // Using pthread library for various flavors of unix.
+00503   #include <pthread.h>
+00504 
+00505   typedef pthread_t ThreadHandle;
+00506   typedef pthread_mutex_t StreamMutex;
 00507 
-00508   // Default constructor.
-00509   CallbackInfo()
-00510     :object(0), callback(0), userData(0), apiInfo(0), isRunning(false) {}
-00511 };
-00512 
-00513 // **************************************************************** //
-00514 //
-00515 // RtApi class declaration.
-00516 //
-00517 // Subclasses of RtApi contain all API- and OS-specific code necessary
-00518 // to fully implement the RtAudio API.
-00519 //
-00520 // Note that RtApi is an abstract base class and cannot be
-00521 // explicitly instantiated.  The class RtAudio will create an
-00522 // instance of an RtApi subclass (RtApiOss, RtApiAlsa,
-00523 // RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
-00524 //
-00525 // **************************************************************** //
+00508 #else // Setup for "dummy" behavior
+00509 
+00510   #define __RTAUDIO_DUMMY__
+00511   typedef int ThreadHandle;
+00512   typedef int StreamMutex;
+00513 
+00514 #endif
+00515 
+00516 // This global structure type is used to pass callback information
+00517 // between the private RtAudio stream structure and global callback
+00518 // handling functions.
+00519 struct CallbackInfo {
+00520   void *object;    // Used as a "this" pointer.
+00521   ThreadHandle thread;
+00522   void *callback;
+00523   void *userData;
+00524   void *apiInfo;   // void pointer for API specific callback information
+00525   bool isRunning;
 00526 
-00527 #if defined( HAVE_GETTIMEOFDAY )
-00528   #include <sys/time.h>
-00529 #endif
-00530 
-00531 #include <sstream>
-00532 
-00533 class RtApi
-00534 {
-00535 public:
-00536 
-00537   RtApi();
-00538   virtual ~RtApi();
-00539   virtual RtAudio::Api getCurrentApi( void ) = 0;
-00540   virtual unsigned int getDeviceCount( void ) = 0;
-00541   virtual RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) = 0;
-00542   virtual unsigned int getDefaultInputDevice( void );
-00543   virtual unsigned int getDefaultOutputDevice( void );
-00544   void openStream( RtAudio::StreamParameters *outputParameters,
-00545                    RtAudio::StreamParameters *inputParameters,
-00546                    RtAudioFormat format, unsigned int sampleRate,
-00547                    unsigned int *bufferFrames, RtAudioCallback callback,
-00548                    void *userData, RtAudio::StreamOptions *options );
-00549   virtual void closeStream( void );
-00550   virtual void startStream( void ) = 0;
-00551   virtual void stopStream( void ) = 0;
-00552   virtual void abortStream( void ) = 0;
-00553   long getStreamLatency( void );
-00554   virtual double getStreamTime( void );
-00555   bool isStreamOpen( void ) { return stream_.state != STREAM_CLOSED; };
-00556   bool isStreamRunning( void ) { return stream_.state == STREAM_RUNNING; };
-00557   void showWarnings( bool value ) { showWarnings_ = value; };
-00558 
-00559 
-00560 protected:
-00561 
-00562   static const unsigned int MAX_SAMPLE_RATES;
-00563   static const unsigned int SAMPLE_RATES[];
-00564 
-00565   enum { FAILURE, SUCCESS };
-00566 
-00567   enum StreamState {
-00568     STREAM_STOPPED,
-00569     STREAM_RUNNING,
-00570     STREAM_CLOSED = -50
-00571   };
-00572 
-00573   enum StreamMode {
-00574     OUTPUT,
-00575     INPUT,
-00576     DUPLEX,
-00577     UNINITIALIZED = -75
-00578   };
+00527   // Default constructor.
+00528   CallbackInfo()
+00529     :object(0), callback(0), userData(0), apiInfo(0), isRunning(false) {}
+00530 };
+00531 
+00532 // **************************************************************** //
+00533 //
+00534 // RtApi class declaration.
+00535 //
+00536 // Subclasses of RtApi contain all API- and OS-specific code necessary
+00537 // to fully implement the RtAudio API.
+00538 //
+00539 // Note that RtApi is an abstract base class and cannot be
+00540 // explicitly instantiated.  The class RtAudio will create an
+00541 // instance of an RtApi subclass (RtApiOss, RtApiAlsa,
+00542 // RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).
+00543 //
+00544 // **************************************************************** //
+00545 
+00546 #if defined( HAVE_GETTIMEOFDAY )
+00547   #include <sys/time.h>
+00548 #endif
+00549 
+00550 #include <sstream>
+00551 
+00552 class RtApi
+00553 {
+00554 public:
+00555 
+00556   RtApi();
+00557   virtual ~RtApi();
+00558   virtual RtAudio::Api getCurrentApi( void ) = 0;
+00559   virtual unsigned int getDeviceCount( void ) = 0;
+00560   virtual RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) = 0;
+00561   virtual unsigned int getDefaultInputDevice( void );
+00562   virtual unsigned int getDefaultOutputDevice( void );
+00563   void openStream( RtAudio::StreamParameters *outputParameters,
+00564                    RtAudio::StreamParameters *inputParameters,
+00565                    RtAudioFormat format, unsigned int sampleRate,
+00566                    unsigned int *bufferFrames, RtAudioCallback callback,
+00567                    void *userData, RtAudio::StreamOptions *options );
+00568   virtual void closeStream( void );
+00569   virtual void startStream( void ) = 0;
+00570   virtual void stopStream( void ) = 0;
+00571   virtual void abortStream( void ) = 0;
+00572   long getStreamLatency( void );
+00573   unsigned int getStreamSampleRate( void );
+00574   virtual double getStreamTime( void );
+00575   bool isStreamOpen( void ) const { return stream_.state != STREAM_CLOSED; };
+00576   bool isStreamRunning( void ) const { return stream_.state == STREAM_RUNNING; };
+00577   void showWarnings( bool value ) { showWarnings_ = value; };
+00578 
 00579 
-00580   // A protected structure used for buffer conversion.
-00581   struct ConvertInfo {
-00582     int channels;
-00583     int inJump, outJump;
-00584     RtAudioFormat inFormat, outFormat;
-00585     std::vector<int> inOffset;
-00586     std::vector<int> outOffset;
-00587   };
-00588 
-00589   // A protected structure for audio streams.
-00590   struct RtApiStream {
-00591     unsigned int device[2];    // Playback and record, respectively.
-00592     void *apiHandle;           // void pointer for API specific stream handle information
-00593     StreamMode mode;           // OUTPUT, INPUT, or DUPLEX.
-00594     StreamState state;         // STOPPED, RUNNING, or CLOSED
-00595     char *userBuffer[2];       // Playback and record, respectively.
-00596     char *deviceBuffer;
-00597     bool doConvertBuffer[2];   // Playback and record, respectively.
-00598     bool userInterleaved;
-00599     bool deviceInterleaved[2]; // Playback and record, respectively.
-00600     bool doByteSwap[2];        // Playback and record, respectively.
-00601     unsigned int sampleRate;
-00602     unsigned int bufferSize;
-00603     unsigned int nBuffers;
-00604     unsigned int nUserChannels[2];    // Playback and record, respectively.
-00605     unsigned int nDeviceChannels[2];  // Playback and record channels, respectively.
-00606     unsigned int channelOffset[2];    // Playback and record, respectively.
-00607     unsigned long latency[2];         // Playback and record, respectively.
-00608     RtAudioFormat userFormat;
-00609     RtAudioFormat deviceFormat[2];    // Playback and record, respectively.
-00610     StreamMutex mutex;
-00611     CallbackInfo callbackInfo;
-00612     ConvertInfo convertInfo[2];
-00613     double streamTime;         // Number of elapsed seconds since the stream started.
-00614 
-00615 #if defined(HAVE_GETTIMEOFDAY)
-00616     struct timeval lastTickTimestamp;
-00617 #endif
-00618 
-00619     RtApiStream()
-00620       :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; }
-00621   };
-00622 
-00623   typedef signed short Int16;
-00624   typedef signed int Int32;
-00625   typedef float Float32;
-00626   typedef double Float64;
-00627 
-00628   std::ostringstream errorStream_;
-00629   std::string errorText_;
-00630   bool showWarnings_;
-00631   RtApiStream stream_;
-00632 
-00640   virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00641                                 unsigned int firstChannel, unsigned int sampleRate,
-00642                                 RtAudioFormat format, unsigned int *bufferSize,
-00643                                 RtAudio::StreamOptions *options );
-00644 
-00646   void tickStreamTime( void );
+00580 protected:
+00581 
+00582   static const unsigned int MAX_SAMPLE_RATES;
+00583   static const unsigned int SAMPLE_RATES[];
+00584 
+00585   enum { FAILURE, SUCCESS };
+00586 
+00587   enum StreamState {
+00588     STREAM_STOPPED,
+00589     STREAM_RUNNING,
+00590     STREAM_CLOSED = -50
+00591   };
+00592 
+00593   enum StreamMode {
+00594     OUTPUT,
+00595     INPUT,
+00596     DUPLEX,
+00597     UNINITIALIZED = -75
+00598   };
+00599 
+00600   // A protected structure used for buffer conversion.
+00601   struct ConvertInfo {
+00602     int channels;
+00603     int inJump, outJump;
+00604     RtAudioFormat inFormat, outFormat;
+00605     std::vector<int> inOffset;
+00606     std::vector<int> outOffset;
+00607   };
+00608 
+00609   // A protected structure for audio streams.
+00610   struct RtApiStream {
+00611     unsigned int device[2];    // Playback and record, respectively.
+00612     void *apiHandle;           // void pointer for API specific stream handle information
+00613     StreamMode mode;           // OUTPUT, INPUT, or DUPLEX.
+00614     StreamState state;         // STOPPED, RUNNING, or CLOSED
+00615     char *userBuffer[2];       // Playback and record, respectively.
+00616     char *deviceBuffer;
+00617     bool doConvertBuffer[2];   // Playback and record, respectively.
+00618     bool userInterleaved;
+00619     bool deviceInterleaved[2]; // Playback and record, respectively.
+00620     bool doByteSwap[2];        // Playback and record, respectively.
+00621     unsigned int sampleRate;
+00622     unsigned int bufferSize;
+00623     unsigned int nBuffers;
+00624     unsigned int nUserChannels[2];    // Playback and record, respectively.
+00625     unsigned int nDeviceChannels[2];  // Playback and record channels, respectively.
+00626     unsigned int channelOffset[2];    // Playback and record, respectively.
+00627     unsigned long latency[2];         // Playback and record, respectively.
+00628     RtAudioFormat userFormat;
+00629     RtAudioFormat deviceFormat[2];    // Playback and record, respectively.
+00630     StreamMutex mutex;
+00631     CallbackInfo callbackInfo;
+00632     ConvertInfo convertInfo[2];
+00633     double streamTime;         // Number of elapsed seconds since the stream started.
+00634 
+00635 #if defined(HAVE_GETTIMEOFDAY)
+00636     struct timeval lastTickTimestamp;
+00637 #endif
+00638 
+00639     RtApiStream()
+00640       :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; }
+00641   };
+00642 
+00643   typedef signed short Int16;
+00644   typedef signed int Int32;
+00645   typedef float Float32;
+00646   typedef double Float64;
 00647 
-00649   void clearStreamInfo();
-00650 
-00655   void verifyStream( void );
-00656 
-00658   void error( RtError::Type type );
-00659 
-00664   void convertBuffer( char *outBuffer, char *inBuffer, ConvertInfo &info );
-00665 
-00667   void byteSwapBuffer( char *buffer, unsigned int samples, RtAudioFormat format );
-00668 
-00670   unsigned int formatBytes( RtAudioFormat format );
-00671 
-00673   void setConvertInfo( StreamMode mode, unsigned int firstChannel );
-00674 };
-00675 
-00676 // **************************************************************** //
-00677 //
-00678 // Inline RtAudio definitions.
-00679 //
-00680 // **************************************************************** //
-00681 
-00682 inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
-00683 inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }
-00684 inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }
-00685 inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }
-00686 inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }
-00687 inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }
-00688 inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }
-00689 inline void RtAudio :: stopStream( void )  { return rtapi_->stopStream(); }
-00690 inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }
-00691 inline bool RtAudio :: isStreamOpen( void ) throw() { return rtapi_->isStreamOpen(); }
-00692 inline bool RtAudio :: isStreamRunning( void ) throw() { return rtapi_->isStreamRunning(); }
-00693 inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }
-00694 inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }
-00695 inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }
-00696 
-00697 // RtApi Subclass prototypes.
-00698 
-00699 #if defined(__MACOSX_CORE__)
-00700 
-00701 #include <CoreAudio/AudioHardware.h>
-00702 
-00703 class RtApiCore: public RtApi
-00704 {
-00705 public:
-00706 
-00707   RtApiCore();
-00708   ~RtApiCore();
-00709   RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; };
-00710   unsigned int getDeviceCount( void );
-00711   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00712   unsigned int getDefaultOutputDevice( void );
-00713   unsigned int getDefaultInputDevice( void );
-00714   void closeStream( void );
-00715   void startStream( void );
-00716   void stopStream( void );
-00717   void abortStream( void );
-00718   long getStreamLatency( void );
+00648   std::ostringstream errorStream_;
+00649   std::string errorText_;
+00650   bool showWarnings_;
+00651   RtApiStream stream_;
+00652 
+00660   virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
+00661                                 unsigned int firstChannel, unsigned int sampleRate,
+00662                                 RtAudioFormat format, unsigned int *bufferSize,
+00663                                 RtAudio::StreamOptions *options );
+00664 
+00666   void tickStreamTime( void );
+00667 
+00669   void clearStreamInfo();
+00670 
+00675   void verifyStream( void );
+00676 
+00678   void error( RtError::Type type );
+00679 
+00684   void convertBuffer( char *outBuffer, char *inBuffer, ConvertInfo &info );
+00685 
+00687   void byteSwapBuffer( char *buffer, unsigned int samples, RtAudioFormat format );
+00688 
+00690   unsigned int formatBytes( RtAudioFormat format );
+00691 
+00693   void setConvertInfo( StreamMode mode, unsigned int firstChannel );
+00694 };
+00695 
+00696 // **************************************************************** //
+00697 //
+00698 // Inline RtAudio definitions.
+00699 //
+00700 // **************************************************************** //
+00701 
+00702 inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
+00703 inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }
+00704 inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }
+00705 inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }
+00706 inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }
+00707 inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }
+00708 inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }
+00709 inline void RtAudio :: stopStream( void )  { return rtapi_->stopStream(); }
+00710 inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }
+00711 inline bool RtAudio :: isStreamOpen( void ) const throw() { return rtapi_->isStreamOpen(); }
+00712 inline bool RtAudio :: isStreamRunning( void ) const throw() { return rtapi_->isStreamRunning(); }
+00713 inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }
+00714 inline unsigned int RtAudio :: getStreamSampleRate( void ) { return rtapi_->getStreamSampleRate(); };
+00715 inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }
+00716 inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }
+00717 
+00718 // RtApi Subclass prototypes.
 00719 
-00720   // This function is intended for internal use only.  It must be
-00721   // public because it is called by the internal callback handler,
-00722   // which is not a member of RtAudio.  External use of this function
-00723   // will most likely produce highly undesireable results!
-00724   bool callbackEvent( AudioDeviceID deviceId,
-00725                       const AudioBufferList *inBufferList,
-00726                       const AudioBufferList *outBufferList );
+00720 #if defined(__MACOSX_CORE__)
+00721 
+00722 #include <CoreAudio/AudioHardware.h>
+00723 
+00724 class RtApiCore: public RtApi
+00725 {
+00726 public:
 00727 
-00728   private:
-00729 
-00730   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00731                         unsigned int firstChannel, unsigned int sampleRate,
-00732                         RtAudioFormat format, unsigned int *bufferSize,
-00733                         RtAudio::StreamOptions *options );
-00734   static const char* getErrorCode( OSStatus code );
-00735 };
-00736 
-00737 #endif
-00738 
-00739 #if defined(__UNIX_JACK__)
-00740 
-00741 class RtApiJack: public RtApi
-00742 {
-00743 public:
-00744 
-00745   RtApiJack();
-00746   ~RtApiJack();
-00747   RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; };
-00748   unsigned int getDeviceCount( void );
-00749   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00750   void closeStream( void );
-00751   void startStream( void );
-00752   void stopStream( void );
-00753   void abortStream( void );
-00754   long getStreamLatency( void );
-00755 
-00756   // This function is intended for internal use only.  It must be
-00757   // public because it is called by the internal callback handler,
-00758   // which is not a member of RtAudio.  External use of this function
-00759   // will most likely produce highly undesireable results!
-00760   bool callbackEvent( unsigned long nframes );
-00761 
-00762   private:
-00763 
-00764   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00765                         unsigned int firstChannel, unsigned int sampleRate,
-00766                         RtAudioFormat format, unsigned int *bufferSize,
-00767                         RtAudio::StreamOptions *options );
-00768 };
-00769 
-00770 #endif
-00771 
-00772 #if defined(__WINDOWS_ASIO__)
-00773 
-00774 class RtApiAsio: public RtApi
-00775 {
-00776 public:
-00777 
-00778   RtApiAsio();
-00779   ~RtApiAsio();
-00780   RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; };
-00781   unsigned int getDeviceCount( void );
-00782   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00783   void closeStream( void );
-00784   void startStream( void );
-00785   void stopStream( void );
-00786   void abortStream( void );
-00787   long getStreamLatency( void );
-00788 
-00789   // This function is intended for internal use only.  It must be
-00790   // public because it is called by the internal callback handler,
-00791   // which is not a member of RtAudio.  External use of this function
-00792   // will most likely produce highly undesireable results!
-00793   bool callbackEvent( long bufferIndex );
-00794 
-00795   private:
-00796 
-00797   std::vector<RtAudio::DeviceInfo> devices_;
-00798   void saveDeviceInfo( void );
-00799   bool coInitialized_;
-00800   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00801                         unsigned int firstChannel, unsigned int sampleRate,
-00802                         RtAudioFormat format, unsigned int *bufferSize,
-00803                         RtAudio::StreamOptions *options );
-00804 };
-00805 
-00806 #endif
-00807 
-00808 #if defined(__WINDOWS_DS__)
-00809 
-00810 class RtApiDs: public RtApi
-00811 {
-00812 public:
-00813 
-00814   RtApiDs();
-00815   ~RtApiDs();
-00816   RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; };
-00817   unsigned int getDeviceCount( void );
-00818   unsigned int getDefaultOutputDevice( void );
-00819   unsigned int getDefaultInputDevice( void );
-00820   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00821   void closeStream( void );
-00822   void startStream( void );
-00823   void stopStream( void );
-00824   void abortStream( void );
-00825   long getStreamLatency( void );
+00728   RtApiCore();
+00729   ~RtApiCore();
+00730   RtAudio::Api getCurrentApi( void ) { return RtAudio::MACOSX_CORE; };
+00731   unsigned int getDeviceCount( void );
+00732   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
+00733   unsigned int getDefaultOutputDevice( void );
+00734   unsigned int getDefaultInputDevice( void );
+00735   void closeStream( void );
+00736   void startStream( void );
+00737   void stopStream( void );
+00738   void abortStream( void );
+00739   long getStreamLatency( void );
+00740 
+00741   // This function is intended for internal use only.  It must be
+00742   // public because it is called by the internal callback handler,
+00743   // which is not a member of RtAudio.  External use of this function
+00744   // will most likely produce highly undesireable results!
+00745   bool callbackEvent( AudioDeviceID deviceId,
+00746                       const AudioBufferList *inBufferList,
+00747                       const AudioBufferList *outBufferList );
+00748 
+00749   private:
+00750 
+00751   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
+00752                         unsigned int firstChannel, unsigned int sampleRate,
+00753                         RtAudioFormat format, unsigned int *bufferSize,
+00754                         RtAudio::StreamOptions *options );
+00755   static const char* getErrorCode( OSStatus code );
+00756 };
+00757 
+00758 #endif
+00759 
+00760 #if defined(__UNIX_JACK__)
+00761 
+00762 class RtApiJack: public RtApi
+00763 {
+00764 public:
+00765 
+00766   RtApiJack();
+00767   ~RtApiJack();
+00768   RtAudio::Api getCurrentApi( void ) { return RtAudio::UNIX_JACK; };
+00769   unsigned int getDeviceCount( void );
+00770   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
+00771   void closeStream( void );
+00772   void startStream( void );
+00773   void stopStream( void );
+00774   void abortStream( void );
+00775   long getStreamLatency( void );
+00776 
+00777   // This function is intended for internal use only.  It must be
+00778   // public because it is called by the internal callback handler,
+00779   // which is not a member of RtAudio.  External use of this function
+00780   // will most likely produce highly undesireable results!
+00781   bool callbackEvent( unsigned long nframes );
+00782 
+00783   private:
+00784 
+00785   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
+00786                         unsigned int firstChannel, unsigned int sampleRate,
+00787                         RtAudioFormat format, unsigned int *bufferSize,
+00788                         RtAudio::StreamOptions *options );
+00789 };
+00790 
+00791 #endif
+00792 
+00793 #if defined(__WINDOWS_ASIO__)
+00794 
+00795 class RtApiAsio: public RtApi
+00796 {
+00797 public:
+00798 
+00799   RtApiAsio();
+00800   ~RtApiAsio();
+00801   RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_ASIO; };
+00802   unsigned int getDeviceCount( void );
+00803   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
+00804   void closeStream( void );
+00805   void startStream( void );
+00806   void stopStream( void );
+00807   void abortStream( void );
+00808   long getStreamLatency( void );
+00809 
+00810   // This function is intended for internal use only.  It must be
+00811   // public because it is called by the internal callback handler,
+00812   // which is not a member of RtAudio.  External use of this function
+00813   // will most likely produce highly undesireable results!
+00814   bool callbackEvent( long bufferIndex );
+00815 
+00816   private:
+00817 
+00818   std::vector<RtAudio::DeviceInfo> devices_;
+00819   void saveDeviceInfo( void );
+00820   bool coInitialized_;
+00821   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
+00822                         unsigned int firstChannel, unsigned int sampleRate,
+00823                         RtAudioFormat format, unsigned int *bufferSize,
+00824                         RtAudio::StreamOptions *options );
+00825 };
 00826 
-00827   // This function is intended for internal use only.  It must be
-00828   // public because it is called by the internal callback handler,
-00829   // which is not a member of RtAudio.  External use of this function
-00830   // will most likely produce highly undesireable results!
-00831   void callbackEvent( void );
-00832 
-00833   private:
+00827 #endif
+00828 
+00829 #if defined(__WINDOWS_DS__)
+00830 
+00831 class RtApiDs: public RtApi
+00832 {
+00833 public:
 00834 
-00835   bool coInitialized_;
-00836   bool buffersRolling;
-00837   long duplexPrerollBytes;
-00838   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00839                         unsigned int firstChannel, unsigned int sampleRate,
-00840                         RtAudioFormat format, unsigned int *bufferSize,
-00841                         RtAudio::StreamOptions *options );
-00842 };
-00843 
-00844 #endif
-00845 
-00846 #if defined(__LINUX_ALSA__)
-00847 
-00848 class RtApiAlsa: public RtApi
-00849 {
-00850 public:
-00851 
-00852   RtApiAlsa();
-00853   ~RtApiAlsa();
-00854   RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; };
-00855   unsigned int getDeviceCount( void );
-00856   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00857   void closeStream( void );
-00858   void startStream( void );
-00859   void stopStream( void );
-00860   void abortStream( void );
-00861 
-00862   // This function is intended for internal use only.  It must be
-00863   // public because it is called by the internal callback handler,
-00864   // which is not a member of RtAudio.  External use of this function
-00865   // will most likely produce highly undesireable results!
-00866   void callbackEvent( void );
-00867 
-00868   private:
-00869 
-00870   std::vector<RtAudio::DeviceInfo> devices_;
-00871   void saveDeviceInfo( void );
-00872   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00873                         unsigned int firstChannel, unsigned int sampleRate,
-00874                         RtAudioFormat format, unsigned int *bufferSize,
-00875                         RtAudio::StreamOptions *options );
-00876 };
-00877 
-00878 #endif
-00879 
-00880 #if defined(__LINUX_OSS__)
-00881 
-00882 class RtApiOss: public RtApi
-00883 {
-00884 public:
-00885 
-00886   RtApiOss();
-00887   ~RtApiOss();
-00888   RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; };
-00889   unsigned int getDeviceCount( void );
-00890   RtAudio::DeviceInfo getDeviceInfo( unsigned int device );
-00891   void closeStream( void );
-00892   void startStream( void );
-00893   void stopStream( void );
-00894   void abortStream( void );
-00895 
-00896   // This function is intended for internal use only.  It must be
-00897   // public because it is called by the internal callback handler,
-00898   // which is not a member of RtAudio.  External use of this function
-00899   // will most likely produce highly undesireable results!
-00900   void callbackEvent( void );
-00901 
-00902   private:
-00903 
-00904   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00905                         unsigned int firstChannel, unsigned int sampleRate,
-00906                         RtAudioFormat format, unsigned int *bufferSize,
-00907                         RtAudio::StreamOptions *options );
-00908 };
-00909 
-00910 #endif
-00911 
-00912 #if defined(__RTAUDIO_DUMMY__)
-00913 
-00914 class RtApiDummy: public RtApi
-00915 {
-00916 public:
-00917 
-00918   RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtError::WARNING ); };
-00919   RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; };
-00920   unsigned int getDeviceCount( void ) { return 0; };
-00921   RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; return info; };
-00922   void closeStream( void ) {};
-00923   void startStream( void ) {};
-00924   void stopStream( void ) {};
-00925   void abortStream( void ) {};
-00926 
-00927   private:
-00928 
-00929   bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, 
-00930                         unsigned int firstChannel, unsigned int sampleRate,
-00931                         RtAudioFormat format, unsigned int *bufferSize,
-00932                         RtAudio::StreamOptions *options ) { return false; };
-00933 };
-00934 
-00935 #endif
-00936 
-00937 #endif
-00938 
-00939 // Indentation settings for Vim and Emacs
-00940 //
-00941 // Local Variables:
-00942 // c-basic-offset: 2
-00943 // indent-tabs-mode: nil
-00944 // End:
-00945 //
-00946 // vim: et sts=2 sw=2
-

+00835 RtApiDs(); +00836 ~RtApiDs(); +00837 RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_DS; }; +00838 unsigned int getDeviceCount( void ); +00839 unsigned int getDefaultOutputDevice( void ); +00840 unsigned int getDefaultInputDevice( void ); +00841 RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); +00842 void closeStream( void ); +00843 void startStream( void ); +00844 void stopStream( void ); +00845 void abortStream( void ); +00846 long getStreamLatency( void ); +00847 +00848 // This function is intended for internal use only. It must be +00849 // public because it is called by the internal callback handler, +00850 // which is not a member of RtAudio. External use of this function +00851 // will most likely produce highly undesireable results! +00852 void callbackEvent( void ); +00853 +00854 private: +00855 +00856 bool coInitialized_; +00857 bool buffersRolling; +00858 long duplexPrerollBytes; +00859 bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, +00860 unsigned int firstChannel, unsigned int sampleRate, +00861 RtAudioFormat format, unsigned int *bufferSize, +00862 RtAudio::StreamOptions *options ); +00863 }; +00864 +00865 #endif +00866 +00867 #if defined(__LINUX_ALSA__) +00868 +00869 class RtApiAlsa: public RtApi +00870 { +00871 public: +00872 +00873 RtApiAlsa(); +00874 ~RtApiAlsa(); +00875 RtAudio::Api getCurrentApi() { return RtAudio::LINUX_ALSA; }; +00876 unsigned int getDeviceCount( void ); +00877 RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); +00878 void closeStream( void ); +00879 void startStream( void ); +00880 void stopStream( void ); +00881 void abortStream( void ); +00882 +00883 // This function is intended for internal use only. It must be +00884 // public because it is called by the internal callback handler, +00885 // which is not a member of RtAudio. External use of this function +00886 // will most likely produce highly undesireable results! +00887 void callbackEvent( void ); +00888 +00889 private: +00890 +00891 std::vector<RtAudio::DeviceInfo> devices_; +00892 void saveDeviceInfo( void ); +00893 bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, +00894 unsigned int firstChannel, unsigned int sampleRate, +00895 RtAudioFormat format, unsigned int *bufferSize, +00896 RtAudio::StreamOptions *options ); +00897 }; +00898 +00899 #endif +00900 +00901 #if defined(__LINUX_OSS__) +00902 +00903 class RtApiOss: public RtApi +00904 { +00905 public: +00906 +00907 RtApiOss(); +00908 ~RtApiOss(); +00909 RtAudio::Api getCurrentApi() { return RtAudio::LINUX_OSS; }; +00910 unsigned int getDeviceCount( void ); +00911 RtAudio::DeviceInfo getDeviceInfo( unsigned int device ); +00912 void closeStream( void ); +00913 void startStream( void ); +00914 void stopStream( void ); +00915 void abortStream( void ); +00916 +00917 // This function is intended for internal use only. It must be +00918 // public because it is called by the internal callback handler, +00919 // which is not a member of RtAudio. External use of this function +00920 // will most likely produce highly undesireable results! +00921 void callbackEvent( void ); +00922 +00923 private: +00924 +00925 bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, +00926 unsigned int firstChannel, unsigned int sampleRate, +00927 RtAudioFormat format, unsigned int *bufferSize, +00928 RtAudio::StreamOptions *options ); +00929 }; +00930 +00931 #endif +00932 +00933 #if defined(__RTAUDIO_DUMMY__) +00934 +00935 class RtApiDummy: public RtApi +00936 { +00937 public: +00938 +00939 RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtError::WARNING ); }; +00940 RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; }; +00941 unsigned int getDeviceCount( void ) { return 0; }; +00942 RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; return info; }; +00943 void closeStream( void ) {}; +00944 void startStream( void ) {}; +00945 void stopStream( void ) {}; +00946 void abortStream( void ) {}; +00947 +00948 private: +00949 +00950 bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, +00951 unsigned int firstChannel, unsigned int sampleRate, +00952 RtAudioFormat format, unsigned int *bufferSize, +00953 RtAudio::StreamOptions *options ) { return false; }; +00954 }; +00955 +00956 #endif +00957 +00958 #endif +00959 +00960 // Indentation settings for Vim and Emacs +00961 // +00962 // Local Variables: +00963 // c-basic-offset: 2 +00964 // indent-tabs-mode: nil +00965 // End: +00966 // +00967 // vim: et sts=2 sw=2 + +
- +
©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone.
©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone.
diff --git a/doc/html/RtAudio_8h.html b/doc/html/RtAudio_8h.html index 73f5584..5ffc249 100644 --- a/doc/html/RtAudio_8h.html +++ b/doc/html/RtAudio_8h.html @@ -8,7 +8,8 @@
Home   Class/Enum List   File List   Compound Members  

- + +

RtAudio.h File Reference

#include <string>
#include <vector>
#include "RtError.h"
@@ -21,141 +22,110 @@ class  RtAudio  Realtime audio i/o C++ classes. More...
-struct  RtAudio::DeviceInfo +struct  RtAudio::RtAudio::DeviceInfo  The public device information structure for returning queried values. More...
-struct  RtAudio::StreamParameters +struct  RtAudio::RtAudio::StreamParameters  The structure for specifying input or ouput stream parameters. More...
-struct  RtAudio::StreamOptions +struct  RtAudio::RtAudio::StreamOptions  The structure for specifying stream options. More...

Typedefs

-typedef unsigned long RtAudioFormat +typedef unsigned long RtAudioFormatRtAudio data format type.
-typedef unsigned int RtAudioStreamFlagsRtAudio data format type.
+typedef unsigned int RtAudioStreamFlagsRtAudio stream option flags.
-typedef unsigned int RtAudioStreamStatusRtAudio stream option flags.
+typedef unsigned int RtAudioStreamStatusRtAudio stream status (over- or underflow) flags.
-typedef int(* RtAudioCallback )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData) + RtAudio stream status (over- or underflow) flags.
+typedef int(* RtAudioCallback )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData) - RtAudio callback function prototype.
RtAudio callback function prototype.

Detailed Description


Typedef Documentation

-

- - - - -
- + +
+
+
- +
typedef unsigned long RtAudioFormat typedef unsigned long RtAudioFormat
-
- - - - - -
-   - + +

-RtAudio data format type. +RtAudio data format type.

-Support for signed integers and floats. Audio data fed to/from an RtAudio stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions.

+Support for signed integers and floats. Audio data fed to/from an RtAudio stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions.

    -
  • RTAUDIO_SINT8: 8-bit signed integer.
  • RTAUDIO_SINT16: 16-bit signed integer.
  • RTAUDIO_SINT24: Upper 3 bytes of 32-bit signed integer.
  • RTAUDIO_SINT32: 32-bit signed integer.
  • RTAUDIO_FLOAT32: Normalized between plus/minus 1.0.
  • RTAUDIO_FLOAT64: Normalized between plus/minus 1.0.
-
-

- - - - -
- +
  • RTAUDIO_SINT8: 8-bit signed integer.
  • RTAUDIO_SINT16: 16-bit signed integer.
  • RTAUDIO_SINT24: Upper 3 bytes of 32-bit signed integer.
  • RTAUDIO_SINT32: 32-bit signed integer.
  • RTAUDIO_FLOAT32: Normalized between plus/minus 1.0.
  • RTAUDIO_FLOAT64: Normalized between plus/minus 1.0.
  • + + +

    + +

    +
    +
    - +
    typedef unsigned long RtAudioStreamFlags typedef unsigned long RtAudioStreamFlags
    -
    - - - - - -
    -   - + +

    -RtAudio stream option flags. +RtAudio stream option flags.

    The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:

    • RTAUDIO_NONINTERLEAVED: Use non-interleaved buffers (default = interleaved).
    • RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
    • RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.

    -By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    -Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    -If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    -

    - - - - -
    - +By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    +Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    +If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    +If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. + +

    + +

    +
    +
    - +
    typedef unsigned long RtAudioStreamStatus typedef unsigned long RtAudioStreamStatus
    -
    - - - - - -
    -   - + +

    -RtAudio stream status (over- or underflow) flags. +RtAudio stream status (over- or underflow) flags.

    Notification of a stream over- or underflow is indicated by a non-zero stream status argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input:

      -
    • RTAUDIO_INPUT_OVERFLOW: Input data was discarded because of an overflow condition at the driver.
    • RTAUDIO_OUTPUT_UNDERFLOW: The output buffer ran low, likely producing a break in the output sound.
    -
    -

    - - - - -
    - +
  • RTAUDIO_INPUT_OVERFLOW: Input data was discarded because of an overflow condition at the driver.
  • RTAUDIO_OUTPUT_UNDERFLOW: The output buffer ran low, likely producing a break in the output sound.
  • + + +

    + +

    +
    +
    - +
    typedef int(* RtAudioCallback)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData) typedef int(* RtAudioCallback)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)
    -
    - - - - - -
    -   - + +

    -RtAudio callback function prototype. +RtAudio callback function prototype.

    -All RtAudio clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.

    +All RtAudio clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.

    Parameters:
    @@ -166,13 +136,14 @@ All RtAudio clients must create a fun
    outputBuffer For output (or duplex) streams, the client should write nFrames of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL.
    userData A pointer to optional data provided by the client when opening the stream (default = NULL).
    -To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two.
    +To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two. +

    +

    +


    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/RtError_8h-source.html b/doc/html/RtError_8h-source.html index 0c736c1..68868de 100644 --- a/doc/html/RtError_8h-source.html +++ b/doc/html/RtError_8h-source.html @@ -8,7 +8,7 @@
    Home   Class/Enum List   File List   Compound Members  

    - +

    RtError.h

    00001 /************************************************************************/
     00010 /************************************************************************/
     00011 
    @@ -19,45 +19,46 @@
     00016 #include <iostream>
     00017 #include <string>
     00018 
    -00019 class RtError : public std::exception
    +00019 class RtError : public std::exception
     00020 {
     00021  public:
    -00023   enum Type {
    -00024     WARNING,           
    -00025     DEBUG_WARNING,     
    -00026     UNSPECIFIED,       
    -00027     NO_DEVICES_FOUND,  
    -00028     INVALID_DEVICE,    
    -00029     MEMORY_ERROR,      
    -00030     INVALID_PARAMETER, 
    -00031     INVALID_USE,       
    -00032     DRIVER_ERROR,      
    -00033     SYSTEM_ERROR,      
    -00034     THREAD_ERROR       
    +00023   enum Type {
    +00024     WARNING,           
    +00025     DEBUG_WARNING,     
    +00026     UNSPECIFIED,       
    +00027     NO_DEVICES_FOUND,  
    +00028     INVALID_DEVICE,    
    +00029     MEMORY_ERROR,      
    +00030     INVALID_PARAMETER, 
    +00031     INVALID_USE,       
    +00032     DRIVER_ERROR,      
    +00033     SYSTEM_ERROR,      
    +00034     THREAD_ERROR       
     00035   };
     00036 
    -00038   RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
    +00038   RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
     00039  
    -00041   virtual ~RtError( void ) throw() {}
    +00041   virtual ~RtError( void ) throw() {}
     00042 
    -00044   virtual void printMessage( void ) throw() { std::cerr << '\n' << message_ << "\n\n"; }
    +00044   virtual void printMessage( void ) throw() { std::cerr << '\n' << message_ << "\n\n"; }
     00045 
    -00047   virtual const Type& getType(void) throw() { return type_; }
    +00047   virtual const Type& getType(void) throw() { return type_; }
     00048 
    -00050   virtual const std::string& getMessage(void) throw() { return message_; }
    +00050   virtual const std::string& getMessage(void) throw() { return message_; }
     00051 
    -00053   virtual const char* what( void ) const throw() { return message_.c_str(); }
    +00053   virtual const char* what( void ) const throw() { return message_.c_str(); }
     00054 
     00055  protected:
     00056   std::string message_;
    -00057   Type type_;
    +00057   Type type_;
     00058 };
     00059 
     00060 #endif
    -

    + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/acknowledge.html b/doc/html/acknowledge.html index 395227a..697c578 100644 --- a/doc/html/acknowledge.html +++ b/doc/html/acknowledge.html @@ -8,8 +8,9 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    Acknowledgements

    Many thanks to the following people for providing bug fixes and improvements:

    - c -

    +: RtAudio +

    - d -

    +: RtError +
  • deviceId +: RtAudio::RtAudio::StreamParameters +
  • DRIVER_ERROR +: RtError +
  • duplexChannels +: RtAudio::RtAudio::DeviceInfo +

    - f -

    +: RtAudio::RtAudio::StreamParameters +
  • flags +: RtAudio::RtAudio::StreamOptions +

    - g -

    +: RtAudio +
  • getCurrentApi() +: RtAudio +
  • getDefaultInputDevice() +: RtAudio +
  • getDefaultOutputDevice() +: RtAudio +
  • getDeviceCount() +: RtAudio +
  • getDeviceInfo() +: RtAudio +
  • getMessage() +: RtError +
  • getStreamLatency() +: RtAudio +
  • getStreamSampleRate() +: RtAudio +
  • getStreamTime() +: RtAudio +
  • getType() +: RtError +

    - i -

    +: RtAudio::RtAudio::DeviceInfo +
  • INVALID_DEVICE +: RtError +
  • INVALID_PARAMETER +: RtError +
  • INVALID_USE +: RtError +
  • isDefaultInput +: RtAudio::RtAudio::DeviceInfo +
  • isDefaultOutput +: RtAudio::RtAudio::DeviceInfo +
  • isStreamOpen() +: RtAudio +
  • isStreamRunning() +: RtAudio +

    - l -

    +: RtAudio +
  • LINUX_OSS +: RtAudio +

    - m -

    +: RtAudio +
  • MEMORY_ERROR +: RtError +

    - n -

    +: RtAudio::RtAudio::DeviceInfo +
  • nativeFormats +: RtAudio::RtAudio::DeviceInfo +
  • nChannels +: RtAudio::RtAudio::StreamParameters +
  • NO_DEVICES_FOUND +: RtError +
  • numberOfBuffers +: RtAudio::RtAudio::StreamOptions +

    - o -

    +: RtAudio +
  • outputChannels +: RtAudio::RtAudio::DeviceInfo +

    - p -

    +: RtError +
  • priority +: RtAudio::RtAudio::StreamOptions +
  • probed +: RtAudio::RtAudio::DeviceInfo +

    - r -

    +: RtAudio +
  • RTAUDIO_DUMMY +: RtAudio +
  • RtError() +: RtError +

    - s -

    +: RtAudio::RtAudio::DeviceInfo +
  • showWarnings() +: RtAudio +
  • startStream() +: RtAudio +
  • stopStream() +: RtAudio +
  • streamName +: RtAudio::RtAudio::StreamOptions +
  • SYSTEM_ERROR +: RtError +

    - t -

    +: RtError +
  • Type +: RtError +

    - u -

    +: RtAudio +
  • UNSPECIFIED +: RtError +, RtAudio +

    - w -

    +: RtError +
  • what() +: RtError +
  • WINDOWS_ASIO +: RtAudio +
  • WINDOWS_DS +: RtAudio +

    - ~ -

    +: RtAudio +
  • ~RtError() +: RtError + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_enum.html b/doc/html/functions_enum.html index a70132c..007c4f6 100644 --- a/doc/html/functions_enum.html +++ b/doc/html/functions_enum.html @@ -8,18 +8,30 @@
    Home   Class/Enum List   File List   Compound Members  

    - - - + + +

    +: RtAudio +
  • Type +: RtError + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_eval.html b/doc/html/functions_eval.html index d0ffb4e..92c8793 100644 --- a/doc/html/functions_eval.html +++ b/doc/html/functions_eval.html @@ -8,34 +8,63 @@
    Home   Class/Enum List   File List   Compound Members  

    - - - + + +

    +: RtError +
  • DRIVER_ERROR +: RtError +
  • INVALID_DEVICE +: RtError +
  • INVALID_PARAMETER +: RtError +
  • INVALID_USE +: RtError +
  • LINUX_ALSA +: RtAudio +
  • LINUX_OSS +: RtAudio +
  • MACOSX_CORE +: RtAudio +
  • MEMORY_ERROR +: RtError +
  • NO_DEVICES_FOUND +: RtError +
  • RTAUDIO_DUMMY +: RtAudio +
  • SYSTEM_ERROR +: RtError +
  • THREAD_ERROR +: RtError +
  • UNIX_JACK +: RtAudio +
  • UNSPECIFIED +: RtError +, RtAudio +
  • WARNING +: RtError +
  • WINDOWS_ASIO +: RtAudio +
  • WINDOWS_DS +: RtAudio + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html index 1fdd9be..c5520d9 100644 --- a/doc/html/functions_func.html +++ b/doc/html/functions_func.html @@ -8,40 +8,76 @@
    Home   Class/Enum List   File List   Compound Members  

    - - - + + +

    +: RtAudio +
  • closeStream() +: RtAudio +
  • getCompiledApi() +: RtAudio +
  • getCurrentApi() +: RtAudio +
  • getDefaultInputDevice() +: RtAudio +
  • getDefaultOutputDevice() +: RtAudio +
  • getDeviceCount() +: RtAudio +
  • getDeviceInfo() +: RtAudio +
  • getMessage() +: RtError +
  • getStreamLatency() +: RtAudio +
  • getStreamSampleRate() +: RtAudio +
  • getStreamTime() +: RtAudio +
  • getType() +: RtError +
  • isStreamOpen() +: RtAudio +
  • isStreamRunning() +: RtAudio +
  • openStream() +: RtAudio +
  • printMessage() +: RtError +
  • RtAudio() +: RtAudio +
  • RtError() +: RtError +
  • showWarnings() +: RtAudio +
  • startStream() +: RtAudio +
  • stopStream() +: RtAudio +
  • what() +: RtError +
  • ~RtAudio() +: RtAudio +
  • ~RtError() +: RtError + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html index e0ab54f..d28575c 100644 --- a/doc/html/functions_vars.html +++ b/doc/html/functions_vars.html @@ -8,31 +8,58 @@
    Home   Class/Enum List   File List   Compound Members  

    - - - + + +

    +: RtAudio::RtAudio::StreamParameters +
  • duplexChannels +: RtAudio::RtAudio::DeviceInfo +
  • firstChannel +: RtAudio::RtAudio::StreamParameters +
  • flags +: RtAudio::RtAudio::StreamOptions +
  • inputChannels +: RtAudio::RtAudio::DeviceInfo +
  • isDefaultInput +: RtAudio::RtAudio::DeviceInfo +
  • isDefaultOutput +: RtAudio::RtAudio::DeviceInfo +
  • name +: RtAudio::RtAudio::DeviceInfo +
  • nativeFormats +: RtAudio::RtAudio::DeviceInfo +
  • nChannels +: RtAudio::RtAudio::StreamParameters +
  • numberOfBuffers +: RtAudio::RtAudio::StreamOptions +
  • outputChannels +: RtAudio::RtAudio::DeviceInfo +
  • priority +: RtAudio::RtAudio::StreamOptions +
  • probed +: RtAudio::RtAudio::DeviceInfo +
  • sampleRates +: RtAudio::RtAudio::DeviceInfo +
  • streamName +: RtAudio::RtAudio::StreamOptions + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/globals.html b/doc/html/globals.html index f071050..4140e96 100644 --- a/doc/html/globals.html +++ b/doc/html/globals.html @@ -8,20 +8,31 @@
    Home   Class/Enum List   File List   Compound Members  

    - - + +
    + +
    +
    Here is a list of all documented file members with links to the documentation:

    +: RtAudio.h +
  • RtAudioFormat +: RtAudio.h +
  • RtAudioStreamFlags +: RtAudio.h +
  • RtAudioStreamStatus +: RtAudio.h + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html index f97bf9d..eb3207e 100644 --- a/doc/html/globals_type.html +++ b/doc/html/globals_type.html @@ -8,20 +8,31 @@
    Home   Class/Enum List   File List   Compound Members  

    - - - + +
    + +
    +

    +: RtAudio.h +
  • RtAudioFormat +: RtAudio.h +
  • RtAudioStreamFlags +: RtAudio.h +
  • RtAudioStreamStatus +: RtAudio.h + +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/index.html b/doc/html/index.html index 36ae05d..e0a50b1 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -8,10 +8,11 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    The RtAudio Home Page

    + +
    +

    The RtAudio Home Page

    -

    4.0.4

    RtAudio is a set of C++ classes that provide a common API (Application Programming Interface) for realtime audio input/output across Linux, Macintosh OS-X and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:

    +

    4.0.5

    RtAudio is a set of C++ classes that provide a common API (Application Programming Interface) for realtime audio input/output across Linux, Macintosh OS-X and Windows (DirectSound and ASIO) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives:

    • object-oriented C++ design
    • @@ -31,21 +32,22 @@ allow audio device capability probing automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping

    -RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the API Notes section for information specific to each of the supported audio APIs.

    +RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the API Notes section for information specific to each of the supported audio APIs.

    What's New (Version 4.0)

    -RtAudio V4 represents a significant rewrite of the code and includes a number of API and functionality changes from previous versions. A partial list of the changes includes:

    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/license.html b/doc/html/license.html index 177bcbe..80a7408 100644 --- a/doc/html/license.html +++ b/doc/html/license.html @@ -8,16 +8,18 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    License

    RtAudio: a set of realtime audio i/o C++ classes
    - Copyright (c) 2001-2007 Gary P. Scavone

    + +

    +

    License

    RtAudio: a set of realtime audio i/o C++ classes
    + Copyright (c) 2001-2009 Gary P. Scavone

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/multi.html b/doc/html/multi.html index 2d88b64..acc6088 100644 --- a/doc/html/multi.html +++ b/doc/html/multi.html @@ -8,12 +8,14 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    Using Simultaneous Multiple APIs

    Because support for each audio API is encapsulated in a specific RtApi subclass, it is possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both the RtApiDs and RtApiAsio classes on Windows operating systems by providing the appropriate preprocessor definitions, include files, and libraries for each. In a run-time situation, one might first attempt to determine whether any ASIO device drivers exist. This can be done by specifying the api argument RtAudio::WINDOWS_ASIO when attempting to create an instance of RtAudio. If no available devices are found, then an instance of RtAudio with the api argument RtAudio::WINDOWS_DS can be created. Alternately, if no api argument is specified, RtAudio will first look for an ASIO instance and then a DirectSound instance (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of RtAudio open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is unlikely that the same device could be simultaneously controlled with two different audio APIs.

    -The static function RtAudio::getCompiledApi() is provided to determine the available compiled API support. The function RtAudio::getCurrentApi() indicates the API selected for a given RtAudio instance.


    + +
    +

    Using Simultaneous Multiple APIs

    Because support for each audio API is encapsulated in a specific RtApi subclass, it is possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both the RtApiDs and RtApiAsio classes on Windows operating systems by providing the appropriate preprocessor definitions, include files, and libraries for each. In a run-time situation, one might first attempt to determine whether any ASIO device drivers exist. This can be done by specifying the api argument RtAudio::WINDOWS_ASIO when attempting to create an instance of RtAudio. If no available devices are found, then an instance of RtAudio with the api argument RtAudio::WINDOWS_DS can be created. Alternately, if no api argument is specified, RtAudio will first look for an ASIO instance and then a DirectSound instance (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of RtAudio open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is unlikely that the same device could be simultaneously controlled with two different audio APIs.

    +The static function RtAudio::getCompiledApi() is provided to determine the available compiled API support. The function RtAudio::getCurrentApi() indicates the API selected for a given RtAudio instance.

    +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/pages.html b/doc/html/pages.html index 2d2f35f..b417146 100644 --- a/doc/html/pages.html +++ b/doc/html/pages.html @@ -8,8 +8,9 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    RtAudio Related Pages

    Here is a list of all related documentation pages:

    -By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    -Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    -If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    -The numberOfBuffers parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the RtAudio::openStream() function by the value actually used by the system.

    -The streamName parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of RtAudio with Jack, each instance must have a unique client name. +By default, RtAudio streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with nFrames samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index nFrames (assuming the buffer pointer was recast to the correct data type for the stream).

    +Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, RtAudio will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.

    +If the RTAUDIO_HOG_DEVICE flag is set, RtAudio will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.

    +If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt to select realtime scheduling (round-robin) for the callback thread. The priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME flag is set. It defines the thread's realtime priority.

    +The numberOfBuffers parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the RtAudio::openStream() function by the value actually used by the system.

    +The streamName parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of RtAudio with Jack, each instance must have a unique client name.


    Member Data Documentation

    + +
    +
    + + + + +
    RtAudioStreamFlags RtAudio::RtAudio::StreamOptions::flags
    +
    +
    +

    -


    Member Data Documentation

    -

    - - - - -
    - +A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE). + +

    + +

    +
    +
    - +
    RtAudioStreamFlags RtAudio::StreamOptions::flags unsigned int RtAudio::RtAudio::StreamOptions::numberOfBuffers
    -
    - - - - - -
    -   - + +

    -A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE).

    -

    - - - - -
    - +Number of stream buffers. + +

    + +

    +
    +
    - +
    unsigned int RtAudio::StreamOptions::numberOfBuffers std::string RtAudio::RtAudio::StreamOptions::streamName
    -
    - - - - - -
    -   - + +

    -Number of stream buffers.

    -

    - - - - -
    - +A stream name (currently used only in Jack). + +

    + +

    +
    +
    - +
    std::string RtAudio::StreamOptions::streamName int RtAudio::RtAudio::StreamOptions::priority
    -
    - - - - - -
    -   - + +

    -A stream name (currently used only in Jack).

    +Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). +

    +


    The documentation for this struct was generated from the following file: +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamParameters-members.html b/doc/html/structRtAudio_1_1StreamParameters-members.html index 3dd3ca7..ab67bfb 100644 --- a/doc/html/structRtAudio_1_1StreamParameters-members.html +++ b/doc/html/structRtAudio_1_1StreamParameters-members.html @@ -8,15 +8,17 @@
    Home   Class/Enum List   File List   Compound Members  

    - -

    RtAudio::StreamParameters Member List

    This is the complete list of members for RtAudio::StreamParameters, including all inherited members.

    - - - -
    deviceIdRtAudio::StreamParameters
    firstChannelRtAudio::StreamParameters
    nChannelsRtAudio::StreamParameters


    + +
    +

    RtAudio::RtAudio::StreamParameters Member List

    This is the complete list of members for RtAudio::RtAudio::StreamParameters, including all inherited members.

    + + + +
    deviceIdRtAudio::RtAudio::StreamParameters
    firstChannelRtAudio::RtAudio::StreamParameters
    nChannelsRtAudio::RtAudio::StreamParameters

    +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/structRtAudio_1_1StreamParameters.html b/doc/html/structRtAudio_1_1StreamParameters.html index b147fc6..71f2853 100644 --- a/doc/html/structRtAudio_1_1StreamParameters.html +++ b/doc/html/structRtAudio_1_1StreamParameters.html @@ -8,103 +8,81 @@
    Home   Class/Enum List   File List   Compound Members  

    - - -

    RtAudio::StreamParameters Struct Reference

    The structure for specifying input or ouput stream parameters. + + +
    +

    RtAudio::RtAudio::StreamParameters Struct Reference

    The structure for specifying input or ouput stream parameters. More...

    #include <RtAudio.h> +

    +

    List of all members. - + - + - +

    Public Attributes

    unsigned int deviceId
    unsigned int deviceId
    unsigned int nChannels
    unsigned int nChannels
    unsigned int firstChannel
    unsigned int firstChannel


    Detailed Description

    -The structure for specifying input or ouput stream parameters. -

    -


    Member Data Documentation

    -

    - - - - -
    - +The structure for specifying input or ouput stream parameters.

    Member Data Documentation

    + +
    +
    +
    - +
    unsigned int RtAudio::StreamParameters::deviceId unsigned int RtAudio::RtAudio::StreamParameters::deviceId
    -
    - - - - - -
    -   - + +

    -Device index (0 to getDeviceCount() - 1).

    -

    - - - - -
    - +Device index (0 to getDeviceCount() - 1). + +

    + +

    +
    +
    - +
    unsigned int RtAudio::StreamParameters::nChannels unsigned int RtAudio::RtAudio::StreamParameters::nChannels
    -
    - - - - - -
    -   - + +

    -Number of channels.

    -

    - - - - -
    - +Number of channels. + +

    + +

    +
    +
    - +
    unsigned int RtAudio::StreamParameters::firstChannel unsigned int RtAudio::RtAudio::StreamParameters::firstChannel
    -
    - - - - - -
    -   - + +

    -First channel index on device (default = 0).

    +First channel index on device (default = 0). +

    +


    The documentation for this struct was generated from the following file: +
    - +
    ©2001-2008 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    ©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.
    Maintained by Gary P. Scavone.
    diff --git a/doc/html/tab_b.gif b/doc/html/tab_b.gif new file mode 100644 index 0000000..0d62348 Binary files /dev/null and b/doc/html/tab_b.gif differ diff --git a/doc/html/tab_l.gif b/doc/html/tab_l.gif new file mode 100644 index 0000000..9b1e633 Binary files /dev/null and b/doc/html/tab_l.gif differ diff --git a/doc/html/tab_r.gif b/doc/html/tab_r.gif new file mode 100644 index 0000000..ce9dd9f Binary files /dev/null and b/doc/html/tab_r.gif differ diff --git a/doc/html/tabs.css b/doc/html/tabs.css new file mode 100644 index 0000000..ab02c62 --- /dev/null +++ b/doc/html/tabs.css @@ -0,0 +1,105 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; +} diff --git a/doc/html/updates.html b/doc/html/updates.html index 55e4639..88fd7d4 100644 --- a/doc/html/updates.html +++ b/doc/html/updates.html @@ -25,7 +25,8 @@ UC4 5Robust support for full-duplex with different devices. Provide well-defined behavior if the devices get out of sync, with input taking precedence, so no incoming samples are lost (if possible).UC 6More sophisticated querying of device capabilities - for example, it'd be nice to figure out that a device supports either 4 channels of 16-bit or 2 channels of 24-bit audio.UC - +7A faster device querying capability in DirectSound API - the current approach can take an extremely long time, especially for devices with many channels (like an RME Fireface 800).UC +8A way to specify a desired device name, instead of a device index, when opening a stream?UC @@ -63,6 +64,12 @@ 10Choice of opening a device in exclusive or non-exclusive mode. If opening in non-exclusive mode, try to use the device as-is without changing its sample rate, etc - this is good when users want to use two audio devices at once.3New RtAudio::StreamOptions structure and parameters4.0 +11Previous CoreAudio support included only a single stream with multiple channels or multiple one-channel streams.Added support for arbitrary stream channel configurations (GS)4.0.5 + +12Added function to return actual sample rate used by a stream because sometimes it varies slightly from the specified one.New getStreamSampleRate() function (Theo Veenker)4.0.5 + +13Added way to specify realtime scheduling for unices.New StreamOptions flag "RTAUDIO_SCHEDULE_REALTIME" and attribute "priority" to StreamOptions (Theo Veenker)4.0.5 +

    Details:

    -- cgit v1.2.3