diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2013-12-27 11:30:37 -0800 |
|---|---|---|
| committer | Gary Scavone <gary@music.mcgill.ca> | 2013-12-27 11:30:37 -0800 |
| commit | 07c639e41165da70aab5016adf1bf7133a418b31 (patch) | |
| tree | 23134f770f593643c52f9ca458f06c23fc3d0873 /RtAudio.cpp | |
| parent | a16508efc3f1ce9dee8f8d760ed68626b34881df (diff) | |
Renamed RtError class to RtAudioError and embedded it in RtAudio.h.
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.
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 320 |
1 files changed, 160 insertions, 160 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index 4b600bd..7e04e98 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -230,31 +230,31 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams, {
if ( stream_.state != STREAM_CLOSED ) {
errorText_ = "RtApi::openStream: a stream is already open!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( oParams && oParams->nChannels < 1 ) {
errorText_ = "RtApi::openStream: a non-NULL output StreamParameters structure cannot have an nChannels value less than one.";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( iParams && iParams->nChannels < 1 ) {
errorText_ = "RtApi::openStream: a non-NULL input StreamParameters structure cannot have an nChannels value less than one.";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( oParams == NULL && iParams == NULL ) {
errorText_ = "RtApi::openStream: input and output StreamParameters structures are both NULL!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( formatBytes(format) == 0 ) {
errorText_ = "RtApi::openStream: 'format' parameter value is undefined.";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
@@ -264,7 +264,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams, oChannels = oParams->nChannels;
if ( oParams->deviceId >= nDevices ) {
errorText_ = "RtApi::openStream: output device parameter value is invalid.";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
}
@@ -274,7 +274,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams, iChannels = iParams->nChannels;
if ( iParams->deviceId >= nDevices ) {
errorText_ = "RtApi::openStream: input device parameter value is invalid.";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
}
@@ -287,7 +287,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams, result = probeDeviceOpen( oParams->deviceId, OUTPUT, oChannels, oParams->firstChannel,
sampleRate, format, bufferFrames, options );
if ( result == false ) {
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
}
@@ -298,7 +298,7 @@ void RtApi :: openStream( RtAudio::StreamParameters *oParams, sampleRate, format, bufferFrames, options );
if ( result == false ) {
if ( oChannels > 0 ) closeStream();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
}
@@ -451,7 +451,7 @@ RtApiCore:: RtApiCore() OSStatus result = AudioObjectSetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, sizeof(CFRunLoopRef), &theRunLoop);
if ( result != noErr ) {
errorText_ = "RtApiCore::RtApiCore: error setting run loop property!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
#endif
}
@@ -472,7 +472,7 @@ unsigned int RtApiCore :: getDeviceCount( void ) OSStatus result = AudioObjectGetPropertyDataSize( kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -490,7 +490,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void ) OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -500,7 +500,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void ) result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultInputDevice: OS-X system error getting device IDs.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -508,7 +508,7 @@ unsigned int RtApiCore :: getDefaultInputDevice( void ) if ( id == deviceList[i] ) return i;
errorText_ = "RtApiCore::getDefaultInputDevice: No default device found!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -523,7 +523,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void ) OSStatus result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, &id );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -533,7 +533,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void ) result = AudioObjectGetPropertyData( kAudioObjectSystemObject, &property, 0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDefaultOutputDevice: OS-X system error getting device IDs.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -541,7 +541,7 @@ unsigned int RtApiCore :: getDefaultOutputDevice( void ) if ( id == deviceList[i] ) return i;
errorText_ = "RtApiCore::getDefaultOutputDevice: No default device found!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -554,13 +554,13 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) unsigned int nDevices = getDeviceCount();
if ( nDevices == 0 ) {
errorText_ = "RtApiCore::getDeviceInfo: no devices found!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
if ( device >= nDevices ) {
errorText_ = "RtApiCore::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -573,7 +573,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) 0, NULL, &dataSize, (void *) &deviceList );
if ( result != noErr ) {
errorText_ = "RtApiCore::getDeviceInfo: OS-X system error getting device IDs.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -588,7 +588,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != noErr ) {
errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device manufacturer.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -606,7 +606,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != noErr ) {
errorStream_ << "RtApiCore::probeDeviceInfo: system error (" << getErrorCode( result ) << ") getting device name.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -628,7 +628,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != noErr || dataSize == 0 ) {
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration info for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -636,7 +636,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) bufferList = (AudioBufferList *) malloc( dataSize );
if ( bufferList == NULL ) {
errorText_ = "RtApiCore::getDeviceInfo: memory error allocating output AudioBufferList.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -645,7 +645,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) free( bufferList );
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting output stream configuration for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -661,7 +661,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != noErr || dataSize == 0 ) {
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration info for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -669,7 +669,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) bufferList = (AudioBufferList *) malloc( dataSize );
if ( bufferList == NULL ) {
errorText_ = "RtApiCore::getDeviceInfo: memory error allocating input AudioBufferList.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -678,7 +678,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) free( bufferList );
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting input stream configuration for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -703,7 +703,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != kAudioHardwareNoError || dataSize == 0 ) {
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rate info.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -713,7 +713,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( result != kAudioHardwareNoError ) {
errorStream_ << "RtApiCore::getDeviceInfo: system error (" << getErrorCode( result ) << ") getting sample rates.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -732,7 +732,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) if ( info.sampleRates.size() == 0 ) {
errorStream_ << "RtApiCore::probeDeviceInfo: No supported sample rates found for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -1159,7 +1159,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne else {
errorStream_ << "RtApiCore::probeDeviceOpen: system error (" << getErrorCode( result ) << ") getting device latency for device (" << device << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
}
@@ -1322,7 +1322,7 @@ void RtApiCore :: closeStream( void ) {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiCore::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -1375,7 +1375,7 @@ void RtApiCore :: startStream( void ) verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiCore::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -1408,7 +1408,7 @@ void RtApiCore :: startStream( void ) unlock:
if ( result == noErr ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiCore :: stopStream( void )
@@ -1416,7 +1416,7 @@ void RtApiCore :: stopStream( void ) verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiCore::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -1451,7 +1451,7 @@ void RtApiCore :: stopStream( void ) unlock:
if ( result == noErr ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiCore :: abortStream( void )
@@ -1459,7 +1459,7 @@ void RtApiCore :: abortStream( void ) verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiCore::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -1490,7 +1490,7 @@ bool RtApiCore :: callbackEvent( AudioDeviceID deviceId, if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return FAILURE;
}
@@ -1896,7 +1896,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device ) jack_client_t *client = jack_client_open( "RtApiJackInfo", options, status );
if ( client == 0 ) {
errorText_ = "RtApiJack::getDeviceInfo: Jack server not found or connection error!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -1925,7 +1925,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device ) if ( device >= nDevices ) {
jack_client_close( client );
errorText_ = "RtApiJack::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -1955,7 +1955,7 @@ RtAudio::DeviceInfo RtApiJack :: getDeviceInfo( unsigned int device ) if ( info.outputChannels == 0 && info.inputChannels == 0 ) {
jack_client_close(client);
errorText_ = "RtApiJack::getDeviceInfo: error determining Jack input/output channels!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -2045,7 +2045,7 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne client = jack_client_open( "RtApiJack", jackoptions, status );
if ( client == 0 ) {
errorText_ = "RtApiJack::probeDeviceOpen: Jack server not found or connection error!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return FAILURE;
}
}
@@ -2282,7 +2282,7 @@ void RtApiJack :: closeStream( void ) {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiJack::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -2324,7 +2324,7 @@ void RtApiJack :: startStream( void ) verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiJack::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -2390,7 +2390,7 @@ void RtApiJack :: startStream( void ) unlock:
if ( result == 0 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiJack :: stopStream( void )
@@ -2398,7 +2398,7 @@ void RtApiJack :: stopStream( void ) verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiJack::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -2420,7 +2420,7 @@ void RtApiJack :: abortStream( void ) verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiJack::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -2449,12 +2449,12 @@ bool RtApiJack :: callbackEvent( unsigned long nframes ) if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiCore::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return FAILURE;
}
if ( stream_.bufferSize != nframes ) {
errorText_ = "RtApiCore::callbackEvent(): the JACK buffer size has changed ... cannot process!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return FAILURE;
}
@@ -2613,7 +2613,7 @@ RtApiAsio :: RtApiAsio() HRESULT hr = CoInitialize( NULL );
if ( FAILED(hr) ) {
errorText_ = "RtApiAsio::ASIO requires a single-threaded appartment. Call CoInitializeEx(0,COINIT_APARTMENTTHREADED)";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
coInitialized_ = true;
@@ -2644,13 +2644,13 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) unsigned int nDevices = getDeviceCount();
if ( nDevices == 0 ) {
errorText_ = "RtApiAsio::getDeviceInfo: no devices found!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
if ( device >= nDevices ) {
errorText_ = "RtApiAsio::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -2658,7 +2658,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) if ( stream_.state != STREAM_CLOSED ) {
if ( device >= devices_.size() ) {
errorText_ = "RtApiAsio::getDeviceInfo: device ID was not present before stream was opened.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
return devices_[ device ];
@@ -2669,7 +2669,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) if ( result != ASE_OK ) {
errorStream_ << "RtApiAsio::getDeviceInfo: unable to get driver name (" << getAsioErrorString( result ) << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -2678,7 +2678,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) if ( !drivers.loadDriver( driverName ) ) {
errorStream_ << "RtApiAsio::getDeviceInfo: unable to load driver (" << driverName << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -2686,7 +2686,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) if ( result != ASE_OK ) {
errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") initializing driver (" << driverName << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -2697,7 +2697,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) drivers.removeCurrentDriver();
errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") getting channel count (" << driverName << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -2724,7 +2724,7 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) drivers.removeCurrentDriver();
errorStream_ << "RtApiAsio::getDeviceInfo: error (" << getAsioErrorString( result ) << ") getting driver channel info (" << driverName << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -3084,7 +3084,7 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne if ( result != ASE_OK ) {
errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error (" << getAsioErrorString( result ) << ") getting latency.";
errorText_ = errorStream_.str();
- error( RtError::WARNING); // warn but don't fail
+ error( RtAudioError::WARNING); // warn but don't fail
}
else {
stream_.latency[0] = outputLatency;
@@ -3130,7 +3130,7 @@ void RtApiAsio :: closeStream() {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiAsio::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -3173,7 +3173,7 @@ void RtApiAsio :: startStream() verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiAsio::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -3195,7 +3195,7 @@ void RtApiAsio :: startStream() stopThreadCalled = false;
if ( result == ASE_OK ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiAsio :: stopStream()
@@ -3203,7 +3203,7 @@ void RtApiAsio :: stopStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiAsio::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -3224,7 +3224,7 @@ void RtApiAsio :: stopStream() }
if ( result == ASE_OK ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiAsio :: abortStream()
@@ -3232,7 +3232,7 @@ void RtApiAsio :: abortStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiAsio::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -3265,7 +3265,7 @@ bool RtApiAsio :: callbackEvent( long bufferIndex ) if ( stream_.state == STREAM_STOPPED || stream_.state == STREAM_STOPPING ) return SUCCESS;
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiAsio::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return FAILURE;
}
@@ -3425,7 +3425,7 @@ static void sampleRateChanged( ASIOSampleRate sRate ) try {
object->stopStream();
}
- catch ( RtError &exception ) {
+ catch ( RtAudioError &exception ) {
std::cerr << "\nRtApiAsio: sampleRateChanged() error (" << exception.getMessage() << ")!\n" << std::endl;
return;
}
@@ -3652,7 +3652,7 @@ unsigned int RtApiDs :: getDeviceCount( void ) if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating output devices!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
// Query DirectSoundCapture devices.
@@ -3661,7 +3661,7 @@ unsigned int RtApiDs :: getDeviceCount( void ) if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating input devices!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
// Clean out any devices that may have disappeared.
@@ -3685,14 +3685,14 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) getDeviceCount();
if ( dsDevices.size() == 0 ) {
errorText_ = "RtApiDs::getDeviceInfo: no devices found!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
}
if ( device >= dsDevices.size() ) {
errorText_ = "RtApiDs::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -3705,7 +3705,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening output device (" << dsDevices[ device ].name << ")!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto probeInput;
}
@@ -3715,7 +3715,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) output->Release();
errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting capabilities!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto probeInput;
}
@@ -3752,7 +3752,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") opening input device (" << dsDevices[ device ].name << ")!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -3763,7 +3763,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) input->Release();
errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") getting object capabilities (" << dsDevices[ device ].name << ")!";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -4356,7 +4356,7 @@ void RtApiDs :: closeStream() {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiDs::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -4411,7 +4411,7 @@ void RtApiDs :: startStream() verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiDs::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -4459,7 +4459,7 @@ void RtApiDs :: startStream() stream_.state = STREAM_RUNNING;
unlock:
- if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR );
+ if ( FAILED( result ) ) error( RtAudioError::SYSTEM_ERROR );
}
void RtApiDs :: stopStream()
@@ -4467,7 +4467,7 @@ void RtApiDs :: stopStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiDs::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -4556,7 +4556,7 @@ void RtApiDs :: stopStream() unlock:
timeEndPeriod( 1 ); // revert to normal scheduler frequency on lesser windows.
- if ( FAILED( result ) ) error( RtError::SYSTEM_ERROR );
+ if ( FAILED( result ) ) error( RtAudioError::SYSTEM_ERROR );
}
void RtApiDs :: abortStream()
@@ -4564,7 +4564,7 @@ void RtApiDs :: abortStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiDs::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -4583,7 +4583,7 @@ void RtApiDs :: callbackEvent() if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiDs::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -4669,14 +4669,14 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
result = dsCaptureBuffer->GetCurrentPosition( NULL, &startSafeReadPointer );
if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
while ( true ) {
@@ -4684,14 +4684,14 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
result = dsCaptureBuffer->GetCurrentPosition( NULL, &safeReadPointer );
if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
if ( safeWritePointer != startSafeWritePointer && safeReadPointer != startSafeReadPointer ) break;
@@ -4712,7 +4712,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
handle->bufferPointer[0] = safeWritePointer + handle->dsPointerLeadTime[0];
@@ -4763,7 +4763,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current write position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
@@ -4804,7 +4804,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking buffer during playback!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
@@ -4817,7 +4817,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking buffer during playback!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
nextWritePointer = ( nextWritePointer + bufferSize1 + bufferSize2 ) % dsBufferSize;
@@ -4852,7 +4852,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
@@ -4913,7 +4913,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
@@ -4927,7 +4927,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") locking capture buffer!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
@@ -4948,7 +4948,7 @@ void RtApiDs :: callbackEvent() if ( FAILED( result ) ) {
errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") unlocking capture buffer!";
errorText_ = errorStream_.str();
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
handle->bufferPointer[1] = nextReadPointer;
@@ -5181,7 +5181,7 @@ unsigned int RtApiAlsa :: getDeviceCount( void ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceCount: control open, card = " << card << ", " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto nextcard;
}
subdevice = -1;
@@ -5190,7 +5190,7 @@ unsigned int RtApiAlsa :: getDeviceCount( void ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceCount: control next device, card = " << card << ", " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
break;
}
if ( subdevice < 0 )
@@ -5230,7 +5230,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: control open, card = " << card << ", " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto nextcard;
}
subdevice = -1;
@@ -5239,7 +5239,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: control next device, card = " << card << ", " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
break;
}
if ( subdevice < 0 ) break;
@@ -5265,13 +5265,13 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( nDevices == 0 ) {
errorText_ = "RtApiAlsa::getDeviceInfo: no devices found!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
if ( device >= nDevices ) {
errorText_ = "RtApiAlsa::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -5284,7 +5284,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_ctl_close( chandle );
if ( device >= devices_.size() ) {
errorText_ = "RtApiAlsa::getDeviceInfo: device ID was not present before stream was opened.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
return devices_[ device ];
@@ -5316,7 +5316,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto captureProbe;
}
@@ -5326,7 +5326,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto captureProbe;
}
@@ -5337,7 +5337,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") output channels, " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto captureProbe;
}
info.outputChannels = value;
@@ -5362,7 +5362,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
if ( info.outputChannels == 0 ) return info;
goto probeParameters;
}
@@ -5373,7 +5373,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
if ( info.outputChannels == 0 ) return info;
goto probeParameters;
}
@@ -5383,7 +5383,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: error getting device (" << name << ") input channels, " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
if ( info.outputChannels == 0 ) return info;
goto probeParameters;
}
@@ -5417,7 +5417,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( result < 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_open error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -5427,7 +5427,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: snd_pcm_hw_params error for device (" << name << "), " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -5441,7 +5441,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) snd_pcm_close( phandle );
errorStream_ << "RtApiAlsa::getDeviceInfo: no supported sample rates found for device (" << name << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -5471,7 +5471,7 @@ RtAudio::DeviceInfo RtApiAlsa :: getDeviceInfo( unsigned int device ) if ( info.nativeFormats == 0 ) {
errorStream_ << "RtApiAlsa::getDeviceInfo: pcm device (" << name << ") data format not supported by RtAudio.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -5935,7 +5935,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne apiInfo->synchronized = true;
else {
errorText_ = "RtApiAlsa::probeDeviceOpen: unable to synchronize input and output devices.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
}
else {
@@ -6013,7 +6013,7 @@ void RtApiAlsa :: closeStream() {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiAlsa::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6066,7 +6066,7 @@ void RtApiAlsa :: startStream() verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiAlsa::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6108,7 +6108,7 @@ void RtApiAlsa :: startStream() MUTEX_UNLOCK( &stream_.mutex );
if ( result >= 0 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiAlsa :: stopStream()
@@ -6116,7 +6116,7 @@ void RtApiAlsa :: stopStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiAlsa::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6151,7 +6151,7 @@ void RtApiAlsa :: stopStream() MUTEX_UNLOCK( &stream_.mutex );
if ( result >= 0 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiAlsa :: abortStream()
@@ -6159,7 +6159,7 @@ void RtApiAlsa :: abortStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiAlsa::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6191,7 +6191,7 @@ void RtApiAlsa :: abortStream() MUTEX_UNLOCK( &stream_.mutex );
if ( result >= 0 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiAlsa :: callbackEvent()
@@ -6211,7 +6211,7 @@ void RtApiAlsa :: callbackEvent() if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiAlsa::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6294,7 +6294,7 @@ void RtApiAlsa :: callbackEvent() errorStream_ << "RtApiAlsa::callbackEvent: audio read error, " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
}
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto tryOutput;
}
@@ -6364,7 +6364,7 @@ void RtApiAlsa :: callbackEvent() errorStream_ << "RtApiAlsa::callbackEvent: audio write error, " << snd_strerror( result ) << ".";
errorText_ = errorStream_.str();
}
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto unlock;
}
@@ -6539,7 +6539,7 @@ void RtApiPulse::callbackEvent( void ) if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiPulse::callbackEvent(): the stream is closed ... "
"this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6579,7 +6579,7 @@ void RtApiPulse::callbackEvent( void ) errorStream_ << "RtApiPulse::callbackEvent: audio write error, " <<
pa_strerror( pa_error ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
}
@@ -6595,7 +6595,7 @@ void RtApiPulse::callbackEvent( void ) errorStream_ << "RtApiPulse::callbackEvent: audio read error, " <<
pa_strerror( pa_error ) << ".";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
if ( stream_.doConvertBuffer[INPUT] ) {
convertBuffer( stream_.userBuffer[INPUT],
@@ -6618,12 +6618,12 @@ void RtApiPulse::startStream( void ) if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiPulse::startStream(): the stream is not open!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiPulse::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6642,12 +6642,12 @@ void RtApiPulse::stopStream( void ) if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiPulse::stopStream(): the stream is not open!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiPulse::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6661,7 +6661,7 @@ void RtApiPulse::stopStream( void ) pa_strerror( pa_error ) << ".";
errorText_ = errorStream_.str();
MUTEX_UNLOCK( &stream_.mutex );
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
}
@@ -6676,12 +6676,12 @@ void RtApiPulse::abortStream( void ) if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiPulse::abortStream(): the stream is not open!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return;
}
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiPulse::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -6695,7 +6695,7 @@ void RtApiPulse::abortStream( void ) pa_strerror( pa_error ) << ".";
errorText_ = errorStream_.str();
MUTEX_UNLOCK( &stream_.mutex );
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
return;
}
}
@@ -6918,7 +6918,7 @@ unsigned int RtApiOss :: getDeviceCount( void ) int mixerfd = open( "/dev/mixer", O_RDWR, 0 );
if ( mixerfd == -1 ) {
errorText_ = "RtApiOss::getDeviceCount: error opening '/dev/mixer'.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -6926,7 +6926,7 @@ unsigned int RtApiOss :: getDeviceCount( void ) if ( ioctl( mixerfd, SNDCTL_SYSINFO, &sysinfo ) == -1 ) {
close( mixerfd );
errorText_ = "RtApiOss::getDeviceCount: error getting sysinfo, OSS version >= 4.0 is required.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
@@ -6942,7 +6942,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) int mixerfd = open( "/dev/mixer", O_RDWR, 0 );
if ( mixerfd == -1 ) {
errorText_ = "RtApiOss::getDeviceInfo: error opening '/dev/mixer'.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -6951,7 +6951,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) if ( result == -1 ) {
close( mixerfd );
errorText_ = "RtApiOss::getDeviceInfo: error getting sysinfo, OSS version >= 4.0 is required.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -6959,14 +6959,14 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) if ( nDevices == 0 ) {
close( mixerfd );
errorText_ = "RtApiOss::getDeviceInfo: no devices found!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
if ( device >= nDevices ) {
close( mixerfd );
errorText_ = "RtApiOss::getDeviceInfo: device ID is invalid!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
return info;
}
@@ -6977,7 +6977,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) if ( result == -1 ) {
errorStream_ << "RtApiOss::getDeviceInfo: error getting device (" << ainfo.name << ") info.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -7006,7 +7006,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) if ( info.nativeFormats == 0 ) {
errorStream_ << "RtApiOss::getDeviceInfo: device (" << ainfo.name << ") data format not supported by RtAudio.";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return info;
}
@@ -7033,7 +7033,7 @@ RtAudio::DeviceInfo RtApiOss :: getDeviceInfo( unsigned int device ) if ( info.sampleRates.size() == 0 ) {
errorStream_ << "RtApiOss::getDeviceInfo: no supported sample rates found for device (" << ainfo.name << ").";
errorText_ = errorStream_.str();
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
else {
info.probed = true;
@@ -7482,7 +7482,7 @@ void RtApiOss :: closeStream() {
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiOss::closeStream(): no open stream to close!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -7531,7 +7531,7 @@ void RtApiOss :: startStream() verifyStream();
if ( stream_.state == STREAM_RUNNING ) {
errorText_ = "RtApiOss::startStream(): the stream is already running!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -7553,7 +7553,7 @@ void RtApiOss :: stopStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiOss::stopStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -7590,7 +7590,7 @@ void RtApiOss :: stopStream() result = write( handle->id[0], buffer, samples * formatBytes(format) );
if ( result == -1 ) {
errorText_ = "RtApiOss::stopStream: audio write error.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
}
}
@@ -7617,7 +7617,7 @@ void RtApiOss :: stopStream() MUTEX_UNLOCK( &stream_.mutex );
if ( result != -1 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiOss :: abortStream()
@@ -7625,7 +7625,7 @@ void RtApiOss :: abortStream() verifyStream();
if ( stream_.state == STREAM_STOPPED ) {
errorText_ = "RtApiOss::abortStream(): the stream is already stopped!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -7663,7 +7663,7 @@ void RtApiOss :: abortStream() MUTEX_UNLOCK( &stream_.mutex );
if ( result != -1 ) return;
- error( RtError::SYSTEM_ERROR );
+ error( RtAudioError::SYSTEM_ERROR );
}
void RtApiOss :: callbackEvent()
@@ -7681,7 +7681,7 @@ void RtApiOss :: callbackEvent() if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApiOss::callbackEvent(): the stream is closed ... this shouldn't happen!";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return;
}
@@ -7751,7 +7751,7 @@ void RtApiOss :: callbackEvent() // specific means for determining that.
handle->xrun[0] = true;
errorText_ = "RtApiOss::callbackEvent: audio write error.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
// Continue on to input section.
}
}
@@ -7778,7 +7778,7 @@ void RtApiOss :: callbackEvent() // specific means for determining that.
handle->xrun[1] = true;
errorText_ = "RtApiOss::callbackEvent: audio read error.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
goto unlock;
}
@@ -7824,7 +7824,7 @@ static void *ossCallbackHandler( void *ptr ) // This method can be modified to control the behavior of error
// message printing.
-void RtApi :: error( RtError::Type type )
+void RtApi :: error( RtAudioError::Type type )
{
errorStream_.str(""); // clear the ostringstream
@@ -7839,7 +7839,7 @@ void RtApi :: error( RtError::Type type ) firstErrorOccured = true;
const std::string errorMessage = errorText_;
- if ( type != RtError::WARNING && stream_.state != STREAM_STOPPED) {
+ if ( type != RtAudioError::WARNING && stream_.state != STREAM_STOPPED) {
stream_.callbackInfo.isRunning = false; // exit from the thread
abortStream();
}
@@ -7849,17 +7849,17 @@ void RtApi :: error( RtError::Type type ) return;
}
- if ( type == RtError::WARNING && showWarnings_ == true )
+ if ( type == RtAudioError::WARNING && showWarnings_ == true )
std::cerr << '\n' << errorText_ << "\n\n";
- else if ( type != RtError::WARNING )
- throw( RtError( errorText_, type ) );
+ else if ( type != RtAudioError::WARNING )
+ throw( RtAudioError( errorText_, type ) );
}
void RtApi :: verifyStream()
{
if ( stream_.state == STREAM_CLOSED ) {
errorText_ = "RtApi:: a stream is not open!";
- error( RtError::INVALID_USE );
+ error( RtAudioError::INVALID_USE );
}
}
@@ -7914,7 +7914,7 @@ unsigned int RtApi :: formatBytes( RtAudioFormat format ) return 1;
errorText_ = "RtApi::formatBytes: undefined format.";
- error( RtError::WARNING );
+ error( RtAudioError::WARNING );
return 0;
}
|
