Renamed RtError class to RtAudioError and embedded it in RtAudio.h.
authorGary Scavone <gary@music.mcgill.ca>
Fri, 27 Dec 2013 19:30:37 +0000 (11:30 -0800)
committerGary Scavone <gary@music.mcgill.ca>
Fri, 27 Dec 2013 19:30:37 +0000 (11:30 -0800)
Deleted RtError.h from distribution and renamed all references to
RtError in the documentation, test files, and Windows .dsp files.
The version number was incremented to 4.1.0 in anticipation of
the next release, as this change affects the API.

24 files changed:
Makefile.in
RtAudio.cpp
RtAudio.h
RtError.h [deleted file]
doc/doxygen/compiling.txt
doc/doxygen/duplex.txt
doc/doxygen/playback.txt
doc/doxygen/recording.txt
doc/doxygen/settings.txt
doc/doxygen/tutorial.txt
doc/release.txt
tests/Windows/audioprobe.dsp
tests/Windows/duplex.dsp
tests/Windows/playraw.dsp
tests/Windows/playsaw.dsp
tests/Windows/record.dsp
tests/Windows/testall.dsp
tests/Windows/teststops.dsp
tests/duplex.cpp
tests/playraw.cpp
tests/playsaw.cpp
tests/record.cpp
tests/testall.cpp
tests/teststops.cpp

index a2ab13c8670758624d1b28a3ea87e17d18ac6256..74d648d7781c34725720e003bead9253cd09d40d 100644 (file)
@@ -9,7 +9,7 @@ OBJECTS = RtAudio.o @objects@
 LIBNAME = librtaudio
 STATIC = $(LIBNAME).a
 SHARED = @sharedlib@
-RELEASE = 4.0.12
+RELEASE = 4.1.0
 MAJOR = 4
 LIBRARIES = $(STATIC) $(SHARED)
 
@@ -46,7 +46,7 @@ install:
        $(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED)
        $(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED).$(MAJOR)
        install --mode=644 $(LIBNAME).pc $(PREFIX)/lib/pkgconfig
-       install --mode=644 RtAudio.h RtError.h $(PREFIX)/include/
+       install --mode=644 RtAudio.h $(PREFIX)/include/
        install --mode=755 rtaudio-config $(PREFIX)/bin/
 
 uninstall:
index 4b600bdb7d6866227658b2d90e54ae89b71c6528..7e04e98f6cc288829d2710e831dc5786f069b2e8 100644 (file)
@@ -230,31 +230,31 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams,
 {\r
   if ( stream_.state != STREAM_CLOSED ) {\r
     errorText_ = "RtApi::openStream: a stream is already open!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
 \r
   if ( oParams && oParams->nChannels < 1 ) {\r
     errorText_ = "RtApi::openStream: a non-NULL output StreamParameters structure cannot have an nChannels value less than one.";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
 \r
   if ( iParams && iParams->nChannels < 1 ) {\r
     errorText_ = "RtApi::openStream: a non-NULL input StreamParameters structure cannot have an nChannels value less than one.";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
 \r
   if ( oParams == NULL && iParams == NULL ) {\r
     errorText_ = "RtApi::openStream: input and output StreamParameters structures are both NULL!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
 \r
   if ( formatBytes(format) == 0 ) {\r
     errorText_ = "RtApi::openStream: 'format' parameter value is undefined.";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
 \r
@@ -264,7 +264,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams,
     oChannels = oParams->nChannels;\r
     if ( oParams->deviceId >= nDevices ) {\r
       errorText_ = "RtApi::openStream: output device parameter value is invalid.";\r
-      error( RtError::INVALID_USE );\r
+      error( RtAudioError::INVALID_USE );\r
       return;\r
     }\r
   }\r
@@ -274,7 +274,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams,
     iChannels = iParams->nChannels;\r
     if ( iParams->deviceId >= nDevices ) {\r
       errorText_ = "RtApi::openStream: input device parameter value is invalid.";\r
-      error( RtError::INVALID_USE );\r
+      error( RtAudioError::INVALID_USE );\r
       return;\r
     }\r
   }\r
@@ -287,7 +287,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams,
     result = probeDeviceOpen( oParams->deviceId, OUTPUT, oChannels, oParams->firstChannel,\r
                               sampleRate, format, bufferFrames, options );\r
     if ( result == false ) {\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
   }\r
@@ -298,7 +298,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams,
                               sampleRate, format, bufferFrames, options );\r
     if ( result == false ) {\r
       if ( oChannels > 0 ) closeStream();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
   }\r
@@ -451,7 +451,7 @@ RtApiCore:: RtApiCore()
   OSStatus result = AudioObjectSetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::RtApiCore: error setting run loop property!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
   }\r
 #endif\r
 }\r
@@ -472,7 +472,7 @@ unsigned int RtApiCore :: getDeviceCount( void )
   OSStatus result = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -490,7 +490,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void )
   OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -500,7 +500,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void )
   result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device IDs.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -508,7 +508,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void )
     if ( id == deviceList[i] ) return i;\r
 \r
   errorText_ = "RtApiCore::getDefaultInputDevice: No default device found!";\r
-  error( RtError::WARNING );\r
+  error( RtAudioError::WARNING );\r
   return 0;\r
 }\r
 \r
@@ -523,7 +523,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void )
   OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -533,7 +533,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void )
   result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device IDs.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -541,7 +541,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void )
     if ( id == deviceList[i] ) return i;\r
 \r
   errorText_ = "RtApiCore::getDefaultOutputDevice: No default device found!";\r
-  error( RtError::WARNING );\r
+  error( RtAudioError::WARNING );\r
   return 0;\r
 }\r
 \r
@@ -554,13 +554,13 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   unsigned int nDevices = getDeviceCount();\r
   if ( nDevices == 0 ) {\r
     errorText_ = "RtApiCore::getDeviceInfo: no devices found!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
   if ( device >= nDevices ) {\r
     errorText_ = "RtApiCore::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -573,7 +573,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
                                                 0, NULL, &dataSize, (void *) &deviceList );\r
   if ( result != noErr ) {\r
     errorText_ = "RtApiCore::getDeviceInfo: OS-X system error getting device IDs.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -588,7 +588,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != noErr ) {\r
     errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device manufacturer.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -606,7 +606,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != noErr ) {\r
     errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device name.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -628,7 +628,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != noErr || dataSize == 0 ) {\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration info for device (" << device << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -636,7 +636,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   bufferList = (AudioBufferList *) malloc( dataSize );\r
   if ( bufferList == NULL ) {\r
     errorText_ = "RtApiCore::getDeviceInfo: memory error allocating output AudioBufferList.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -645,7 +645,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
     free( bufferList );\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration for device (" << device << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -661,7 +661,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != noErr || dataSize == 0 ) {\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration info for device (" << device << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -669,7 +669,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   bufferList = (AudioBufferList *) malloc( dataSize );\r
   if ( bufferList == NULL ) {\r
     errorText_ = "RtApiCore::getDeviceInfo: memory error allocating input AudioBufferList.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -678,7 +678,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
     free( bufferList );\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration for device (" << device << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -703,7 +703,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != kAudioHardwareNoError || dataSize == 0 ) {\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rate info.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -713,7 +713,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( result != kAudioHardwareNoError ) {\r
     errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rates.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -732,7 +732,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device )
   if ( info.sampleRates.size() == 0 ) {\r
     errorStream_ << "RtApiCore::probeDeviceInfo: No supported sample rates found for device (" << device << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -1159,7 +1159,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
     else {\r
       errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting device latency for device (" << device << ").";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
     }\r
   }\r
 \r
@@ -1322,7 +1322,7 @@ void RtApiCore :: closeStream( void )
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiCore::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -1375,7 +1375,7 @@ void RtApiCore :: startStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiCore::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -1408,7 +1408,7 @@ void RtApiCore :: startStream( void )
 \r
  unlock:\r
   if ( result == noErr ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiCore :: stopStream( void )\r
@@ -1416,7 +1416,7 @@ void RtApiCore :: stopStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiCore::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -1451,7 +1451,7 @@ void RtApiCore :: stopStream( void )
 \r
  unlock:\r
   if ( result == noErr ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiCore :: abortStream( void )\r
@@ -1459,7 +1459,7 @@ void RtApiCore :: abortStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiCore::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -1490,7 +1490,7 @@ bool RtApiCore :: callbackEvent( AudioDeviceID deviceId,
   if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return FAILURE;\r
   }\r
 \r
@@ -1896,7 +1896,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device )
   jack_client_t *client = jack_client_open( "RtApiJackInfo", options, status );\r
   if ( client == 0 ) {\r
     errorText_ = "RtApiJack::getDeviceInfo: Jack server not found or connection error!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -1925,7 +1925,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device )
   if ( device >= nDevices ) {\r
     jack_client_close( client );\r
     errorText_ = "RtApiJack::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -1955,7 +1955,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device )
   if ( info.outputChannels == 0 && info.inputChannels == 0 ) {\r
     jack_client_close(client);\r
     errorText_ = "RtApiJack::getDeviceInfo: error determining Jack input/output channels!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -2045,7 +2045,7 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
       client = jack_client_open( "RtApiJack", jackoptions, status );\r
     if ( client == 0 ) {\r
       errorText_ = "RtApiJack::probeDeviceOpen: Jack server not found or connection error!";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       return FAILURE;\r
     }\r
   }\r
@@ -2282,7 +2282,7 @@ void RtApiJack :: closeStream( void )
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiJack::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -2324,7 +2324,7 @@ void RtApiJack :: startStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiJack::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -2390,7 +2390,7 @@ void RtApiJack :: startStream( void )
 \r
  unlock:\r
   if ( result == 0 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiJack :: stopStream( void )\r
@@ -2398,7 +2398,7 @@ void RtApiJack :: stopStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiJack::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -2420,7 +2420,7 @@ void RtApiJack :: abortStream( void )
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiJack::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -2449,12 +2449,12 @@ bool RtApiJack :: callbackEvent( unsigned long nframes )
   if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return FAILURE;\r
   }\r
   if ( stream_.bufferSize != nframes ) {\r
     errorText_ = "RtApiCore::callbackEvent(): the JACK buffer size has changed ... cannot process!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return FAILURE;\r
   }\r
 \r
@@ -2613,7 +2613,7 @@ RtApiAsio :: RtApiAsio()
   HRESULT hr = CoInitialize( NULL ); \r
   if ( FAILED(hr) ) {\r
     errorText_ = "RtApiAsio::ASIO requires a single-threaded appartment. Call CoInitializeEx(0,COINIT_APARTMENTTHREADED)";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
   }\r
   coInitialized_ = true;\r
 \r
@@ -2644,13 +2644,13 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
   unsigned int nDevices = getDeviceCount();\r
   if ( nDevices == 0 ) {\r
     errorText_ = "RtApiAsio::getDeviceInfo: no devices found!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
   if ( device >= nDevices ) {\r
     errorText_ = "RtApiAsio::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -2658,7 +2658,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
   if ( stream_.state != STREAM_CLOSED ) {\r
     if ( device >= devices_.size() ) {\r
       errorText_ = "RtApiAsio::getDeviceInfo: device ID was not present before stream was opened.";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       return info;\r
     }\r
     return devices_[ device ];\r
@@ -2669,7 +2669,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
   if ( result != ASE_OK ) {\r
     errorStream_ << "RtApiAsio::getDeviceInfo: unable to get driver name (" << getAsioErrorString( result ) << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -2678,7 +2678,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
   if ( !drivers.loadDriver( driverName ) ) {\r
     errorStream_ << "RtApiAsio::getDeviceInfo: unable to load driver (" << driverName << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -2686,7 +2686,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
   if ( result != ASE_OK ) {\r
     errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") initializing driver (" << driverName << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -2697,7 +2697,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
     drivers.removeCurrentDriver();\r
     errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") getting channel count (" << driverName << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -2724,7 +2724,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device )
     drivers.removeCurrentDriver();\r
     errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") getting driver channel info (" << driverName << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -3084,7 +3084,7 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
   if ( result != ASE_OK ) {\r
     errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") getting latency.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING); // warn but don't fail\r
+    error( RtAudioError::WARNING); // warn but don't fail\r
   }\r
   else {\r
     stream_.latency[0] = outputLatency;\r
@@ -3130,7 +3130,7 @@ void RtApiAsio :: closeStream()
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiAsio::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -3173,7 +3173,7 @@ void RtApiAsio :: startStream()
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiAsio::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -3195,7 +3195,7 @@ void RtApiAsio :: startStream()
   stopThreadCalled = false;\r
 \r
   if ( result == ASE_OK ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiAsio :: stopStream()\r
@@ -3203,7 +3203,7 @@ void RtApiAsio :: stopStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiAsio::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -3224,7 +3224,7 @@ void RtApiAsio :: stopStream()
   }\r
 \r
   if ( result == ASE_OK ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiAsio :: abortStream()\r
@@ -3232,7 +3232,7 @@ void RtApiAsio :: abortStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiAsio::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -3265,7 +3265,7 @@ bool RtApiAsio :: callbackEvent( long bufferIndex )
   if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiAsio::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return FAILURE;\r
   }\r
 \r
@@ -3425,7 +3425,7 @@ static void sampleRateChanged( ASIOSampleRate sRate )
   try {\r
     object->stopStream();\r
   }\r
-  catch ( RtError &exception ) {\r
+  catch ( RtAudioError &exception ) {\r
     std::cerr << "\nRtApiAsio: sampleRateChanged() error (" << exception.getMessage() << ")!\n" << std::endl;\r
     return;\r
   }\r
@@ -3652,7 +3652,7 @@ unsigned int RtApiDs :: getDeviceCount( void )
   if ( FAILED( result ) ) {\r
     errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating output devices!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
   }\r
 \r
   // Query DirectSoundCapture devices.\r
@@ -3661,7 +3661,7 @@ unsigned int RtApiDs :: getDeviceCount( void )
   if ( FAILED( result ) ) {\r
     errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating input devices!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
   }\r
 \r
   // Clean out any devices that may have disappeared.\r
@@ -3685,14 +3685,14 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )
     getDeviceCount();\r
     if ( dsDevices.size() == 0 ) {\r
       errorText_ = "RtApiDs::getDeviceInfo: no devices found!";\r
-      error( RtError::INVALID_USE );\r
+      error( RtAudioError::INVALID_USE );\r
       return info;\r
     }\r
   }\r
 \r
   if ( device >= dsDevices.size() ) {\r
     errorText_ = "RtApiDs::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -3705,7 +3705,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )
   if ( FAILED( result ) ) {\r
     errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening output device (" << dsDevices[ device ].name << ")!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     goto probeInput;\r
   }\r
 \r
@@ -3715,7 +3715,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )
     output->Release();\r
     errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting capabilities!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     goto probeInput;\r
   }\r
 \r
@@ -3752,7 +3752,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )
   if ( FAILED( result ) ) {\r
     errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening input device (" << dsDevices[ device ].name << ")!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -3763,7 +3763,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device )
     input->Release();\r
     errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting object capabilities (" << dsDevices[ device ].name << ")!";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -4356,7 +4356,7 @@ void RtApiDs :: closeStream()
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiDs::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -4411,7 +4411,7 @@ void RtApiDs :: startStream()
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiDs::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -4459,7 +4459,7 @@ void RtApiDs :: startStream()
   stream_.state = STREAM_RUNNING;\r
 \r
  unlock:\r
-  if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR );\r
+  if ( FAILED( result ) ) error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiDs :: stopStream()\r
@@ -4467,7 +4467,7 @@ void RtApiDs :: stopStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiDs::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -4556,7 +4556,7 @@ void RtApiDs :: stopStream()
 \r
  unlock:\r
   timeEndPeriod( 1 ); // revert to normal scheduler frequency on lesser windows.\r
-  if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR );\r
+  if ( FAILED( result ) ) error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiDs :: abortStream()\r
@@ -4564,7 +4564,7 @@ void RtApiDs :: abortStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiDs::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -4583,7 +4583,7 @@ void RtApiDs :: callbackEvent()
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiDs::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -4669,14 +4669,14 @@ void RtApiDs :: callbackEvent()
       if ( FAILED( result ) ) {\r
         errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::SYSTEM_ERROR );\r
+        error( RtAudioError::SYSTEM_ERROR );\r
         return;\r
       }\r
       result = dsCaptureBuffer->GetCurrentPosition( NULL, &startSafeReadPointer );\r
       if ( FAILED( result ) ) {\r
         errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::SYSTEM_ERROR );\r
+        error( RtAudioError::SYSTEM_ERROR );\r
         return;\r
       }\r
       while ( true ) {\r
@@ -4684,14 +4684,14 @@ void RtApiDs :: callbackEvent()
         if ( FAILED( result ) ) {\r
           errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";\r
           errorText_ = errorStream_.str();\r
-          error( RtError::SYSTEM_ERROR );\r
+          error( RtAudioError::SYSTEM_ERROR );\r
           return;\r
         }\r
         result = dsCaptureBuffer->GetCurrentPosition( NULL, &safeReadPointer );\r
         if ( FAILED( result ) ) {\r
           errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";\r
           errorText_ = errorStream_.str();\r
-          error( RtError::SYSTEM_ERROR );\r
+          error( RtAudioError::SYSTEM_ERROR );\r
           return;\r
         }\r
         if ( safeWritePointer != startSafeWritePointer && safeReadPointer != startSafeReadPointer ) break;\r
@@ -4712,7 +4712,7 @@ void RtApiDs :: callbackEvent()
       if ( FAILED( result ) ) {\r
         errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::SYSTEM_ERROR );\r
+        error( RtAudioError::SYSTEM_ERROR );\r
         return;\r
       }\r
       handle->bufferPointer[0] = safeWritePointer + handle->dsPointerLeadTime[0];\r
@@ -4763,7 +4763,7 @@ void RtApiDs :: callbackEvent()
       if ( FAILED( result ) ) {\r
         errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::SYSTEM_ERROR );\r
+        error( RtAudioError::SYSTEM_ERROR );\r
         return;\r
       }\r
 \r
@@ -4804,7 +4804,7 @@ void RtApiDs :: callbackEvent()
     if ( FAILED( result ) ) {\r
       errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking buffer during playback!";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
 \r
@@ -4817,7 +4817,7 @@ void RtApiDs :: callbackEvent()
     if ( FAILED( result ) ) {\r
       errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking buffer during playback!";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
     nextWritePointer = ( nextWritePointer + bufferSize1 + bufferSize2 ) % dsBufferSize;\r
@@ -4852,7 +4852,7 @@ void RtApiDs :: callbackEvent()
     if ( FAILED( result ) ) {\r
       errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
 \r
@@ -4913,7 +4913,7 @@ void RtApiDs :: callbackEvent()
         if ( FAILED( result ) ) {\r
           errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";\r
           errorText_ = errorStream_.str();\r
-          error( RtError::SYSTEM_ERROR );\r
+          error( RtAudioError::SYSTEM_ERROR );\r
           return;\r
         }\r
       \r
@@ -4927,7 +4927,7 @@ void RtApiDs :: callbackEvent()
     if ( FAILED( result ) ) {\r
       errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking capture buffer!";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
 \r
@@ -4948,7 +4948,7 @@ void RtApiDs :: callbackEvent()
     if ( FAILED( result ) ) {\r
       errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking capture buffer!";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
     handle->bufferPointer[1] = nextReadPointer;\r
@@ -5181,7 +5181,7 @@ unsigned int RtApiAlsa :: getDeviceCount( void )
     if ( result < 0 ) {\r
       errorStream_ << "RtApiAlsa::getDeviceCount: control open, card = " << card << ", " << snd_strerror( result ) << ".";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       goto nextcard;\r
     }\r
     subdevice = -1;\r
@@ -5190,7 +5190,7 @@ unsigned int RtApiAlsa :: getDeviceCount( void )
       if ( result < 0 ) {\r
         errorStream_ << "RtApiAlsa::getDeviceCount: control next device, card = " << card << ", " << snd_strerror( result ) << ".";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::WARNING );\r
+        error( RtAudioError::WARNING );\r
         break;\r
       }\r
       if ( subdevice < 0 )\r
@@ -5230,7 +5230,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     if ( result < 0 ) {\r
       errorStream_ << "RtApiAlsa::getDeviceInfo: control open, card = " << card << ", " << snd_strerror( result ) << ".";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       goto nextcard;\r
     }\r
     subdevice = -1;\r
@@ -5239,7 +5239,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
       if ( result < 0 ) {\r
         errorStream_ << "RtApiAlsa::getDeviceInfo: control next device, card = " << card << ", " << snd_strerror( result ) << ".";\r
         errorText_ = errorStream_.str();\r
-        error( RtError::WARNING );\r
+        error( RtAudioError::WARNING );\r
         break;\r
       }\r
       if ( subdevice < 0 ) break;\r
@@ -5265,13 +5265,13 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
 \r
   if ( nDevices == 0 ) {\r
     errorText_ = "RtApiAlsa::getDeviceInfo: no devices found!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
   if ( device >= nDevices ) {\r
     errorText_ = "RtApiAlsa::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -5284,7 +5284,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_ctl_close( chandle );\r
     if ( device >= devices_.size() ) {\r
       errorText_ = "RtApiAlsa::getDeviceInfo: device ID was not present before stream was opened.";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       return info;\r
     }\r
     return devices_[ device ];\r
@@ -5316,7 +5316,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
   if ( result < 0 ) {\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     goto captureProbe;\r
   }\r
 \r
@@ -5326,7 +5326,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     goto captureProbe;\r
   }\r
 \r
@@ -5337,7 +5337,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") output channels, " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     goto captureProbe;\r
   }\r
   info.outputChannels = value;\r
@@ -5362,7 +5362,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
   if ( result < 0 ) {\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     if ( info.outputChannels == 0 ) return info;\r
     goto probeParameters;\r
   }\r
@@ -5373,7 +5373,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     if ( info.outputChannels == 0 ) return info;\r
     goto probeParameters;\r
   }\r
@@ -5383,7 +5383,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") input channels, " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     if ( info.outputChannels == 0 ) return info;\r
     goto probeParameters;\r
   }\r
@@ -5417,7 +5417,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
   if ( result < 0 ) {\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -5427,7 +5427,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -5441,7 +5441,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
     snd_pcm_close( phandle );\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: no supported sample rates found for device (" << name << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -5471,7 +5471,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device )
   if ( info.nativeFormats == 0 ) {\r
     errorStream_ << "RtApiAlsa::getDeviceInfo: pcm device (" << name << ") data format not supported by RtAudio.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -5935,7 +5935,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
       apiInfo->synchronized = true;\r
     else {\r
       errorText_ = "RtApiAlsa::probeDeviceOpen: unable to synchronize input and output devices.";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
     }\r
   }\r
   else {\r
@@ -6013,7 +6013,7 @@ void RtApiAlsa :: closeStream()
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiAlsa::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6066,7 +6066,7 @@ void RtApiAlsa :: startStream()
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiAlsa::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6108,7 +6108,7 @@ void RtApiAlsa :: startStream()
   MUTEX_UNLOCK( &stream_.mutex );\r
 \r
   if ( result >= 0 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiAlsa :: stopStream()\r
@@ -6116,7 +6116,7 @@ void RtApiAlsa :: stopStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiAlsa::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6151,7 +6151,7 @@ void RtApiAlsa :: stopStream()
   MUTEX_UNLOCK( &stream_.mutex );\r
 \r
   if ( result >= 0 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiAlsa :: abortStream()\r
@@ -6159,7 +6159,7 @@ void RtApiAlsa :: abortStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiAlsa::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6191,7 +6191,7 @@ void RtApiAlsa :: abortStream()
   MUTEX_UNLOCK( &stream_.mutex );\r
 \r
   if ( result >= 0 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiAlsa :: callbackEvent()\r
@@ -6211,7 +6211,7 @@ void RtApiAlsa :: callbackEvent()
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiAlsa::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6294,7 +6294,7 @@ void RtApiAlsa :: callbackEvent()
         errorStream_ << "RtApiAlsa::callbackEvent: audio read error, " << snd_strerror( result ) << ".";\r
         errorText_ = errorStream_.str();\r
       }\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       goto tryOutput;\r
     }\r
 \r
@@ -6364,7 +6364,7 @@ void RtApiAlsa :: callbackEvent()
         errorStream_ << "RtApiAlsa::callbackEvent: audio write error, " << snd_strerror( result ) << ".";\r
         errorText_ = errorStream_.str();\r
       }\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       goto unlock;\r
     }\r
 \r
@@ -6539,7 +6539,7 @@ void RtApiPulse::callbackEvent( void )
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiPulse::callbackEvent(): the stream is closed ... "\r
       "this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6579,7 +6579,7 @@ void RtApiPulse::callbackEvent( void )
       errorStream_ << "RtApiPulse::callbackEvent: audio write error, " <<\r
         pa_strerror( pa_error ) << ".";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
     }\r
   }\r
 \r
@@ -6595,7 +6595,7 @@ void RtApiPulse::callbackEvent( void )
       errorStream_ << "RtApiPulse::callbackEvent: audio read error, " <<\r
         pa_strerror( pa_error ) << ".";\r
       errorText_ = errorStream_.str();\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
     }\r
     if ( stream_.doConvertBuffer[INPUT] ) {\r
       convertBuffer( stream_.userBuffer[INPUT],\r
@@ -6618,12 +6618,12 @@ void RtApiPulse::startStream( void )
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiPulse::startStream(): the stream is not open!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiPulse::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6642,12 +6642,12 @@ void RtApiPulse::stopStream( void )
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiPulse::stopStream(): the stream is not open!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiPulse::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6661,7 +6661,7 @@ void RtApiPulse::stopStream( void )
         pa_strerror( pa_error ) << ".";\r
       errorText_ = errorStream_.str();\r
       MUTEX_UNLOCK( &stream_.mutex );\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
   }\r
@@ -6676,12 +6676,12 @@ void RtApiPulse::abortStream( void )
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiPulse::abortStream(): the stream is not open!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return;\r
   }\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiPulse::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -6695,7 +6695,7 @@ void RtApiPulse::abortStream( void )
         pa_strerror( pa_error ) << ".";\r
       errorText_ = errorStream_.str();\r
       MUTEX_UNLOCK( &stream_.mutex );\r
-      error( RtError::SYSTEM_ERROR );\r
+      error( RtAudioError::SYSTEM_ERROR );\r
       return;\r
     }\r
   }\r
@@ -6918,7 +6918,7 @@ unsigned int RtApiOss :: getDeviceCount( void )
   int mixerfd = open( "/dev/mixer", O_RDWR, 0 );\r
   if ( mixerfd == -1 ) {\r
     errorText_ = "RtApiOss::getDeviceCount: error opening '/dev/mixer'.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -6926,7 +6926,7 @@ unsigned int RtApiOss :: getDeviceCount( void )
   if ( ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ) == -1 ) {\r
     close( mixerfd );\r
     errorText_ = "RtApiOss::getDeviceCount: error getting sysinfo, OSS version >= 4.0 is required.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return 0;\r
   }\r
 \r
@@ -6942,7 +6942,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   int mixerfd = open( "/dev/mixer", O_RDWR, 0 );\r
   if ( mixerfd == -1 ) {\r
     errorText_ = "RtApiOss::getDeviceInfo: error opening '/dev/mixer'.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -6951,7 +6951,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   if ( result == -1 ) {\r
     close( mixerfd );\r
     errorText_ = "RtApiOss::getDeviceInfo: error getting sysinfo, OSS version >= 4.0 is required.";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -6959,14 +6959,14 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   if ( nDevices == 0 ) {\r
     close( mixerfd );\r
     errorText_ = "RtApiOss::getDeviceInfo: no devices found!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
   if ( device >= nDevices ) {\r
     close( mixerfd );\r
     errorText_ = "RtApiOss::getDeviceInfo: device ID is invalid!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
     return info;\r
   }\r
 \r
@@ -6977,7 +6977,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   if ( result == -1 ) {\r
     errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -7006,7 +7006,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   if ( info.nativeFormats == 0 ) {\r
     errorStream_ << "RtApiOss::getDeviceInfo: device (" << ainfo.name << ") data format not supported by RtAudio.";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return info;\r
   }\r
 \r
@@ -7033,7 +7033,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device )
   if ( info.sampleRates.size() == 0 ) {\r
     errorStream_ << "RtApiOss::getDeviceInfo: no supported sample rates found for device (" << ainfo.name << ").";\r
     errorText_ = errorStream_.str();\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
   }\r
   else {\r
     info.probed = true;\r
@@ -7482,7 +7482,7 @@ void RtApiOss :: closeStream()
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiOss::closeStream(): no open stream to close!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -7531,7 +7531,7 @@ void RtApiOss :: startStream()
   verifyStream();\r
   if ( stream_.state == STREAM_RUNNING ) {\r
     errorText_ = "RtApiOss::startStream(): the stream is already running!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -7553,7 +7553,7 @@ void RtApiOss :: stopStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiOss::stopStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -7590,7 +7590,7 @@ void RtApiOss :: stopStream()
       result = write( handle->id[0], buffer, samples * formatBytes(format) );\r
       if ( result == -1 ) {\r
         errorText_ = "RtApiOss::stopStream: audio write error.";\r
-        error( RtError::WARNING );\r
+        error( RtAudioError::WARNING );\r
       }\r
     }\r
 \r
@@ -7617,7 +7617,7 @@ void RtApiOss :: stopStream()
   MUTEX_UNLOCK( &stream_.mutex );\r
 \r
   if ( result != -1 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiOss :: abortStream()\r
@@ -7625,7 +7625,7 @@ void RtApiOss :: abortStream()
   verifyStream();\r
   if ( stream_.state == STREAM_STOPPED ) {\r
     errorText_ = "RtApiOss::abortStream(): the stream is already stopped!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -7663,7 +7663,7 @@ void RtApiOss :: abortStream()
   MUTEX_UNLOCK( &stream_.mutex );\r
 \r
   if ( result != -1 ) return;\r
-  error( RtError::SYSTEM_ERROR );\r
+  error( RtAudioError::SYSTEM_ERROR );\r
 }\r
 \r
 void RtApiOss :: callbackEvent()\r
@@ -7681,7 +7681,7 @@ void RtApiOss :: callbackEvent()
 \r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApiOss::callbackEvent(): the stream is closed ... this shouldn't happen!";\r
-    error( RtError::WARNING );\r
+    error( RtAudioError::WARNING );\r
     return;\r
   }\r
 \r
@@ -7751,7 +7751,7 @@ void RtApiOss :: callbackEvent()
       // specific means for determining that.\r
       handle->xrun[0] = true;\r
       errorText_ = "RtApiOss::callbackEvent: audio write error.";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       // Continue on to input section.\r
     }\r
   }\r
@@ -7778,7 +7778,7 @@ void RtApiOss :: callbackEvent()
       // specific means for determining that.\r
       handle->xrun[1] = true;\r
       errorText_ = "RtApiOss::callbackEvent: audio read error.";\r
-      error( RtError::WARNING );\r
+      error( RtAudioError::WARNING );\r
       goto unlock;\r
     }\r
 \r
@@ -7824,7 +7824,7 @@ static void *ossCallbackHandler( void *ptr )
 \r
 // This method can be modified to control the behavior of error\r
 // message printing.\r
-void RtApi :: error( RtError::Type type )\r
+void RtApi :: error( RtAudioError::Type type )\r
 {\r
   errorStream_.str(""); // clear the ostringstream\r
 \r
@@ -7839,7 +7839,7 @@ void RtApi :: error( RtError::Type type )
     firstErrorOccured = true;\r
     const std::string errorMessage = errorText_;\r
 \r
-    if ( type != RtError::WARNING && stream_.state != STREAM_STOPPED) {\r
+    if ( type != RtAudioError::WARNING && stream_.state != STREAM_STOPPED) {\r
       stream_.callbackInfo.isRunning = false; // exit from the thread\r
       abortStream();\r
     }\r
@@ -7849,17 +7849,17 @@ void RtApi :: error( RtError::Type type )
     return;\r
   }\r
 \r
-  if ( type == RtError::WARNING && showWarnings_ == true )\r
+  if ( type == RtAudioError::WARNING && showWarnings_ == true )\r
     std::cerr << '\n' << errorText_ << "\n\n";\r
-  else if ( type != RtError::WARNING )\r
-    throw( RtError( errorText_, type ) );\r
+  else if ( type != RtAudioError::WARNING )\r
+    throw( RtAudioError( errorText_, type ) );\r
 }\r
 \r
 void RtApi :: verifyStream()\r
 {\r
   if ( stream_.state == STREAM_CLOSED ) {\r
     errorText_ = "RtApi:: a stream is not open!";\r
-    error( RtError::INVALID_USE );\r
+    error( RtAudioError::INVALID_USE );\r
   }\r
 }\r
 \r
@@ -7914,7 +7914,7 @@ unsigned int RtApi :: formatBytes( RtAudioFormat format )
     return 1;\r
 \r
   errorText_ = "RtApi::formatBytes: undefined format.";\r
-  error( RtError::WARNING );\r
+  error( RtAudioError::WARNING );\r
 \r
   return 0;\r
 }\r
index d78c3134d867c978db0ce7e6253117c5f70bc643..97219059fdfbe04bec9abe03b288bbbe3e7928e8 100644 (file)
--- a/RtAudio.h
+++ b/RtAudio.h
 
 #include <string>
 #include <vector>
-#include "RtError.h"
+#include <exception>
+#include <iostream>
 
 // RtAudio version
-static const std::string VERSION( "4.0.12" );
+static const std::string VERSION( "4.1.0pre" );
 
 /*! \typedef typedef unsigned long RtAudioFormat;
     \brief RtAudio data format type.
@@ -205,6 +206,7 @@ typedef void (*RtAudioErrorCallback)( RtError::Type type, const std::string &err
 //
 // **************************************************************** //
 
+class RtAudioError;
 class RtApi;
 
 class RtAudio
@@ -1048,6 +1050,60 @@ public:
 
 #endif
 
+/************************************************************************/
+/*! \class RtError
+    \brief Exception handling class for RtAudio & RtMidi.
+
+    The RtError class is quite simple but it does allow errors to be
+    "caught" by RtError::Type. See the RtAudio and RtMidi
+    documentation to know which methods can throw an RtError.
+
+*/
+/************************************************************************/
+
+class RtAudioError : public std::exception
+{
+ public:
+  //! Defined RtAudioError types.
+  enum Type {
+    WARNING,           /*!< A non-critical error. */
+    DEBUG_WARNING,     /*!< A non-critical error which might be useful for debugging. */
+    UNSPECIFIED,       /*!< The default, unspecified error type. */
+    NO_DEVICES_FOUND,  /*!< No devices found on system. */
+    INVALID_DEVICE,    /*!< An invalid device ID was specified. */
+    MEMORY_ERROR,      /*!< An error occured during memory allocation. */
+    INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
+    INVALID_USE,       /*!< The function was called incorrectly. */
+    DRIVER_ERROR,      /*!< A system driver error occured. */
+    SYSTEM_ERROR,      /*!< A system error occured. */
+    THREAD_ERROR       /*!< A thread error occured. */
+  };
+
+  //! The constructor.
+  RtAudioError( const std::string& message, Type type = RtAudioError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
+  //! The destructor.
+  virtual ~RtAudioError( void ) throw() {}
+
+  //! Prints thrown error message to stderr.
+  virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
+
+  //! Returns the thrown error message type.
+  virtual const Type& getType(void) const throw() { return type_; }
+
+  //! Returns the thrown error message string.
+  virtual const std::string& getMessage(void) const throw() { return message_; }
+
+  //! Returns the thrown error message as a c-style string.
+  virtual const char* what( void ) const throw() { return message_.c_str(); }
+
+ protected:
+  std::string message_;
+  Type type_;
+};
+
+#endif
+
 #endif
 
 // Indentation settings for Vim and Emacs
diff --git a/RtError.h b/RtError.h
deleted file mode 100644 (file)
index a64f434..0000000
--- a/RtError.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/************************************************************************/
-/*! \class RtError
-    \brief Exception handling class for RtAudio & RtMidi.
-
-    The RtError class is quite simple but it does allow errors to be
-    "caught" by RtError::Type. See the RtAudio and RtMidi
-    documentation to know which methods can throw an RtError.
-
-*/
-/************************************************************************/
-
-#ifndef RTERROR_H
-#define RTERROR_H
-
-#include <exception>
-#include <iostream>
-#include <string>
-
-class RtError : public std::exception
-{
- public:
-  //! Defined RtError types.
-  enum Type {
-    WARNING,           /*!< A non-critical error. */
-    DEBUG_WARNING,     /*!< A non-critical error which might be useful for debugging. */
-    UNSPECIFIED,       /*!< The default, unspecified error type. */
-    NO_DEVICES_FOUND,  /*!< No devices found on system. */
-    INVALID_DEVICE,    /*!< An invalid device ID was specified. */
-    MEMORY_ERROR,      /*!< An error occured during memory allocation. */
-    INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
-    INVALID_USE,       /*!< The function was called incorrectly. */
-    DRIVER_ERROR,      /*!< A system driver error occured. */
-    SYSTEM_ERROR,      /*!< A system error occured. */
-    THREAD_ERROR       /*!< A thread error occured. */
-  };
-
-  //! The constructor.
-  RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
-  //! The destructor.
-  virtual ~RtError( void ) throw() {}
-
-  //! Prints thrown error message to stderr.
-  virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
-
-  //! Returns the thrown error message type.
-  virtual const Type& getType(void) const throw() { return type_; }
-
-  //! Returns the thrown error message string.
-  virtual const std::string& getMessage(void) const throw() { return message_; }
-
-  //! Returns the thrown error message as a c-style string.
-  virtual const char* what( void ) const throw() { return message_.c_str(); }
-
- protected:
-  std::string message_;
-  Type type_;
-};
-
-#endif
index c1f83e4fae9bccac024107562c29486c23fbb371..9e9cab247f4a71b9a0b0f2ec96457164221de686 100644 (file)
@@ -78,7 +78,7 @@ In order to compile RtAudio for a specific OS and audio API, it is necessary to
 </TABLE>
 <P>
 
-The example compiler statements above could be used to compile the <TT>audioprobe.cpp</TT> example file, assuming that <TT>audioprobe.cpp</TT>, <TT>RtAudio.h</TT>, <tt>RtError.h</tt>, and <TT>RtAudio.cpp</TT> all exist in the same directory.
+The example compiler statements above could be used to compile the <TT>audioprobe.cpp</TT> example file, assuming that <TT>audioprobe.cpp</TT>, <TT>RtAudio.h</TT> and <TT>RtAudio.cpp</TT> all exist in the same directory.
 
 
 */
index c76ae73d1d9f52fde621b54d4a92a4a573c47e63..2777fdcd3bb7dd58ee95afa10979e6f241f9d717 100644 (file)
@@ -40,7 +40,7 @@ int main()
   try {
     adac.openStream( &oParams, &iParams, RTAUDIO_SINT32, 44100, &bufferFrames, &inout, (void *)&bufferBytes );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     exit( 0 );
   }
@@ -57,7 +57,7 @@ int main()
     // Stop the stream.
     adac.stopStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     goto cleanup;
   }
index c291f5ae18af548a56f1b2d5eba852274e001a09..cf182a69662f47c18f86cf7bbe27c183a302f116 100644 (file)
@@ -52,7 +52,7 @@ int main()
                     sampleRate, &bufferFrames, &saw, (void *)&data );
     dac.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     exit( 0 );
   }
@@ -65,7 +65,7 @@ int main()
     // Stop the stream
     dac.stopStream();
   }
-  catch (RtError& e) {
+  catch (RtAudioError& e) {
     e.printMessage();
   }
 
index 9b624386a1de4cc5c6d7d8bf44a44b399c37d531..69b4e3ebd2be3942db2e640cf174f0f476c50854 100644 (file)
@@ -40,7 +40,7 @@ int main()
                     sampleRate, &bufferFrames, &record );
     adc.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     exit( 0 );
   }
@@ -53,7 +53,7 @@ int main()
     // Stop the stream
     adc.stopStream();
   }
-  catch (RtError& e) {
+  catch (RtAudioError& e) {
     e.printMessage();
   }
 
index d7cc1d2767c942e86ce4595ad8951f6054ad83f8..54cb38bdd6da6210f9ae7a51fe9e05a2b06f332a 100644 (file)
@@ -24,7 +24,7 @@ int main()
     dac.openStream( &parameters, NULL, RTAUDIO_FLOAT32,
                     sampleRate, &bufferFrames, &myCallback, NULL, &options );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     exit( 0 );
   }
@@ -33,7 +33,7 @@ int main()
 }
 \endcode
 
-The RtAudio::openStream() function attempts to open a stream with a specified set of parameter values.  In the above example, we attempt to open a two channel playback stream using the default output device, 32-bit floating point data, a sample rate of 44100 Hz, and a frame rate of 256 sample frames per output buffer.  If the user specifies an invalid parameter value (such as a device id greater than or equal to the number of enumerated devices), an RtError is thrown of type = INVALID_USE.   If a system error occurs or the device does not support the specified parameter values, an RtError of type = SYSTEM_ERROR is thrown.  In either case, a descriptive error message is bundled with the exception and can be queried with the RtError::getMessage() or RtError::what() functions.
+The RtAudio::openStream() function attempts to open a stream with a specified set of parameter values.  In the above example, we attempt to open a two channel playback stream using the default output device, 32-bit floating point data, a sample rate of 44100 Hz, and a frame rate of 256 sample frames per output buffer.  If the user specifies an invalid parameter value (such as a device id greater than or equal to the number of enumerated devices), an RtAudioError is thrown of type = INVALID_USE.   If a system error occurs or the device does not support the specified parameter values, an RtAudioError of type = SYSTEM_ERROR is thrown.  In either case, a descriptive error message is bundled with the exception and can be queried with the RtAudioError::getMessage() or RtAudioError::what() functions.
 
 RtAudio provides four signed integer and two floating point data formats which can be specified using the RtAudioFormat parameter values mentioned earlier.  If the opened device does not natively support the given format, RtAudio will automatically perform the necessary data format conversion.
 
index 65817742e1f1159baa90670fb90fada4b751553c..be72425bd1447b1fc0e516cf2d51b18be3bf3a57 100644 (file)
@@ -5,7 +5,7 @@ RtAudio is a set of C++ classes that provide a common API (Application Programmi
 <UL>
   <LI>object-oriented C++ design</LI>
   <LI>simple, common API across all supported platforms</LI>
-  <LI>only one source and two header files for easy inclusion in programming projects</LI>
+  <LI>only one source and one header file for easy inclusion in programming projects</LI>
   <LI>allow simultaneous multi-api support</LI>
   <LI>support dynamic connection of devices</LI>
   <LI>provide extensive audio device parameter control</LI>
index b9ba9150f6ee80a5a86af5cf84ec17031c636da2..7cbd9dfb4f70f83ac4813150f2aaa764e0f8ab83 100644 (file)
@@ -1,6 +1,9 @@
 RtAudio - a set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio, and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound and ASIO) operating systems.
 
-By Gary P. Scavone, 2001-2013.
+By Gary P. Scavone, 2001-2014.
+
+v4.1.0: (?? 2014)
+- RtError class renamed RtAudioError and embedded in RtAudio.h (RtError.h deleted)
 
 v4.0.12: (16 April 2013)
 - new functionality to allow error reporting via a client-supplied function (thanks to Pavel Mogilevskiy)
index 679bf9a856df3deeb3570ed7b30433862ffb2fab..cbdc11ad844eaddb949ee108ecb65ca999b230cb 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index c9ba2941abe024d1a16aa283a4d03ee14fcd6e4a..0073640b7e9b1130e17ec3ed944d864568fbae32 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 849890d21787e24aa4abed17bc5111be09cafb90..4da8d9c2fbc10c5b961fab63490ad531d73f8ea9 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 7923c1ce65b68120786e5c37cf4d49a8ad697214..e2bcfe553356291fa07933fc34faeb07119fde5b 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 9ba312ccf5286503ad0f55fafec2be3b5b1f908b..b1c2dc0e29ac4d4850e20211079644fd0d8ba75b 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 72b6259e8404f2d8d251f0285fa30b1ec4f44ee2..87b25bb90c5268a374e0118b0b49baaea9d594f4 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 1543bc84f2d30478943305b6e2878ab66f9c101d..71d2fff1fe0c6f281d1a890dedfc814c1f0688a8 100755 (executable)
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h
 \r
 SOURCE=..\..\RtAudio.h\r
 # End Source File\r
-# Begin Source File\r
-\r
-SOURCE=..\..\RtError.h\r
-# End Source File\r
 # End Group\r
 # Begin Group "Resource Files"\r
 \r
index 2c60aada87c182bfd837890d1ae4caccd3a673b8..60be90122bd953464bf74fe865fe6313ab90020c 100644 (file)
@@ -103,7 +103,7 @@ int main( int argc, char *argv[] )
   try {
     adac.openStream( &oParams, &iParams, FORMAT, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     exit( 1 );
   }
@@ -123,7 +123,7 @@ int main( int argc, char *argv[] )
     // Stop the stream.
     adac.stopStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     goto cleanup;
   }
index f57c0b0e31023995dc491688698faa88a57ac6f5..7e7256ba0110e7477e87bdb986bd4f38b9100cf3 100644 (file)
@@ -130,7 +130,7 @@ int main( int argc, char *argv[] )
     dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data );
     dac.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     goto cleanup;
   }
index 100d8d9badc3a9fac3457f785fd58c1f3fefc1c7..a590ca18ddf59f655efe8a8434fc0cce9d77e332 100644 (file)
@@ -172,7 +172,7 @@ int main( int argc, char *argv[] )
     dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options );
     dac.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     goto cleanup;
   }
@@ -190,7 +190,7 @@ int main( int argc, char *argv[] )
       // Stop the stream
       dac.stopStream();
     }
-    catch ( RtError& e ) {
+    catch ( RtAudioError& e ) {
       e.printMessage();
     }
   }
index 5aa0ef381232820850f73effb1d670159645b480..4bd9d30f304a495d5dfedd2019f0e7dd0a80e376 100644 (file)
@@ -126,7 +126,7 @@ int main( int argc, char *argv[] )
   try {
     adc.openStream( NULL, &iParams, FORMAT, fs, &bufferFrames, &input, (void *)&data );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     goto cleanup;
   }
@@ -148,7 +148,7 @@ int main( int argc, char *argv[] )
   try {
     adc.startStream();
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     std::cout << '\n' << e.getMessage() << '\n' << std::endl;
     goto cleanup;
   }
index f518a574908a39715a210c2f562072941bac497c..c8db735f59ce8be567bbb5fc5f104cb70571f659 100644 (file)
@@ -160,7 +160,7 @@ int main( int argc, char *argv[] )
     std::cout << "Playing again ... press <enter> to close the stream.\n";
     std::cin.get( input );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     goto cleanup;
   }
@@ -180,7 +180,7 @@ int main( int argc, char *argv[] )
     std::cout << "\nPlaying ... press <enter> to stop.\n";
     std::cin.get( input );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
     goto cleanup;
   }
@@ -216,7 +216,7 @@ int main( int argc, char *argv[] )
     std::cout << "\nRunning ... press <enter> to stop.\n";
     std::cin.get( input );
   }
-  catch ( RtError& e ) {
+  catch ( RtAudioError& e ) {
     e.printMessage();
   }
 
index ab71dbde2ce574444dbcbc9c16c02cdbeb578cbd..b74a66ea0b550927bf41b5cb41faa31453f8f52e 100644 (file)
@@ -141,7 +141,7 @@ int main( int argc, char *argv[] )
       SLEEP( pausetime );\r
     }\r
   }\r
-  catch ( RtError& e ) {\r
+  catch ( RtAudioError& e ) {\r
     e.printMessage();\r
     goto cleanup;\r
   }\r
@@ -168,7 +168,7 @@ int main( int argc, char *argv[] )
       SLEEP( pausetime );\r
     }\r
   }\r
-  catch ( RtError& e ) {\r
+  catch ( RtAudioError& e ) {\r
     e.printMessage();\r
     goto cleanup;\r
   }\r
@@ -193,7 +193,7 @@ int main( int argc, char *argv[] )
       SLEEP( pausetime );\r
     }\r
   }\r
-  catch ( RtError& e ) {\r
+  catch ( RtAudioError& e ) {\r
     e.printMessage();\r
     goto cleanup;\r
   }\r
@@ -222,7 +222,7 @@ int main( int argc, char *argv[] )
       SLEEP( pausetime );\r
     }\r
   }\r
-  catch ( RtError& e ) {\r
+  catch ( RtAudioError& e ) {\r
     e.printMessage();\r
     goto cleanup;\r
   }\r
@@ -253,7 +253,7 @@ int main( int argc, char *argv[] )
       SLEEP( pausetime );\r
     }\r
   }\r
-  catch ( RtError& e ) {\r
+  catch ( RtAudioError& e ) {\r
     e.printMessage();\r
     goto cleanup;\r
   }\r