/[pcsx2_0.9.7]/trunk/3rdparty/portaudio/src/common/pa_front.c
ViewVC logotype

Diff of /trunk/3rdparty/portaudio/src/common/pa_front.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/3rdparty/portaudio/src/common/pa_front.c	2010/11/12 00:35:47	272
+++ trunk/3rdparty/portaudio/src/common/pa_front.c	2010/11/12 01:10:22	273
@@ -27,26 +27,26 @@
  */
 
 /*
- * The text above constitutes the entire PortAudio license; however,
+ * The text above constitutes the entire PortAudio license; however, 
  * the PortAudio community also makes the following non-binding requests:
  *
  * Any person wishing to distribute modifications to the Software is
  * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
  * license above.
  */
 
 /** @file
  @ingroup common_src
 
- @brief Implements PortAudio API functions defined in portaudio.h, checks
+ @brief Implements PortAudio API functions defined in portaudio.h, checks 
  some errors, delegates platform-specific behavior to host API implementations.
-
- Implements the functions defined in the PortAudio API (portaudio.h),
- validates some parameters and checks for state inconsistencies before
- forwarding API requests to specific Host API implementations (via the
- interface declared in pa_hostapi.h), and Streams (via the interface
+ 
+ Implements the functions defined in the PortAudio API (portaudio.h), 
+ validates some parameters and checks for state inconsistencies before 
+ forwarding API requests to specific Host API implementations (via the 
+ interface declared in pa_hostapi.h), and Streams (via the interface 
  declared in pa_stream.h).
 
  This file manages initialization and termination of Host API
@@ -180,7 +180,7 @@
     if( !hostApis_ )
     {
         result = paInsufficientMemory;
-        goto error;
+        goto error; 
     }
 
     hostApisCount_ = 0;
@@ -233,7 +233,7 @@
     <device> belongs and returns it. if <hostSpecificDeviceIndex> is
     non-null, the host specific device index is returned in it.
     returns -1 if <device> is out of range.
-
+ 
 */
 static int FindHostApi( PaDeviceIndex device, int *hostSpecificDeviceIndex )
 {
@@ -323,7 +323,7 @@
     {
         PA_VALIDATE_TYPE_SIZES;
         PA_VALIDATE_ENDIANNESS;
-
+        
         PaUtil_InitializeClock();
         PaUtil_ResetTraceMessages();
 
@@ -410,11 +410,11 @@
     case paCanNotWriteToAnInputOnlyStream:      result = "Can't write to an input only stream"; break;
     case paIncompatibleStreamHostApi: result = "Incompatible stream host API"; break;
     case paBadBufferPtr:             result = "Bad buffer pointer"; break;
-    default:
+    default:                         
 		if( errorCode > 0 )
-			result = "Invalid error code (value greater than zero)";
+			result = "Invalid error code (value greater than zero)"; 
         else
-			result = "Invalid error code";
+			result = "Invalid error code"; 
         break;
     }
     return result;
@@ -425,7 +425,7 @@
 {
     PaHostApiIndex result;
     int i;
-
+    
     PA_LOGAPI_ENTER_PARAMS( "Pa_HostApiTypeIdToHostApiIndex" );
     PA_LOGAPI(("\tPaHostApiTypeId type: %d\n", type ));
 
@@ -436,14 +436,14 @@
     else
     {
         result = paHostApiNotFound;
-
+        
         for( i=0; i < hostApisCount_; ++i )
         {
             if( hostApis_[i]->info.type == type )
             {
                 result = i;
                 break;
-            }
+            }         
         }
     }
 
@@ -458,7 +458,7 @@
 {
     PaError result;
     int i;
-
+    
     if( !PA_IS_INITIALISED_ )
     {
         result = paNotInitialized;
@@ -466,7 +466,7 @@
     else
     {
         result = paHostApiNotFound;
-
+                
         for( i=0; i < hostApisCount_; ++i )
         {
             if( hostApis_[i]->info.type == type )
@@ -487,7 +487,7 @@
 {
     PaError result;
     PaDeviceIndex x;
-
+    
     x = device - hostApi->privatePaFrontInfo.baseDeviceIndex;
 
     if( x < 0 || x >= hostApi->info.deviceCount )
@@ -572,7 +572,7 @@
     else if( hostApi < 0 || hostApi >= hostApisCount_ )
     {
         info = NULL;
-
+        
         PA_LOGAPI(("Pa_GetHostApiInfo returned:\n" ));
         PA_LOGAPI(("\tPaHostApiInfo*: NULL [ hostApi out of range ]\n" ));
 
@@ -681,7 +681,7 @@
 {
     PaHostApiIndex hostApi;
     PaDeviceIndex result;
-
+    
     PA_LOGAPI_ENTER( "Pa_GetDefaultOutputDevice" );
 
     hostApi = Pa_GetDefaultHostApi();
@@ -765,7 +765,7 @@
     ValidateOpenStreamParameters() checks that parameters to Pa_OpenStream()
     conform to the expected values as described below. This function is
     also designed to be used with the proposed Pa_IsFormatSupported() function.
-
+    
     There are basically two types of validation that could be performed:
     Generic conformance validation, and device capability mismatch
     validation. This function performs only generic conformance validation.
@@ -774,21 +774,21 @@
     combinations of parameters - for example, even if the sampleRate
     seems ok, it might not be for a duplex stream - we have no way of
     checking this in an API-neutral way, so we don't try.
-
+ 
     On success the function returns PaNoError and fills in hostApi,
     hostApiInputDeviceID, and hostApiOutputDeviceID fields. On failure
     the function returns an error code indicating the first encountered
     parameter error.
-
-
+ 
+ 
     If ValidateOpenStreamParameters() returns paNoError, the following
     assertions are guaranteed to be true.
-
+ 
     - at least one of inputParameters & outputParmeters is valid (not NULL)
 
     - if inputParameters & outputParameters are both valid, that
         inputParameters->device & outputParameters->device  both use the same host api
-
+ 
     PaDeviceIndex inputParameters->device
         - is within range (0 to Pa_GetDeviceCount-1) Or:
         - is paUseHostApiSpecificDeviceSpecification and
@@ -798,30 +798,30 @@
     int inputParameters->channelCount
         - if inputParameters->device is not paUseHostApiSpecificDeviceSpecification, channelCount is > 0
         - upper bound is NOT validated against device capabilities
-
+ 
     PaSampleFormat inputParameters->sampleFormat
         - is one of the sample formats defined in portaudio.h
 
     void *inputParameters->hostApiSpecificStreamInfo
         - if supplied its hostApi field matches the input device's host Api
-
+ 
     PaDeviceIndex outputParmeters->device
         - is within range (0 to Pa_GetDeviceCount-1)
-
+ 
     int outputParmeters->channelCount
         - if inputDevice is valid, channelCount is > 0
         - upper bound is NOT validated against device capabilities
-
+ 
     PaSampleFormat outputParmeters->sampleFormat
         - is one of the sample formats defined in portaudio.h
-
+        
     void *outputParmeters->hostApiSpecificStreamInfo
         - if supplied its hostApi field matches the output device's host Api
-
+ 
     double sampleRate
         - is not an 'absurd' rate (less than 1000. or greater than 200000.)
         - sampleRate is NOT validated against device capabilities
-
+ 
     PaStreamFlags streamFlags
         - unused platform neutral flags are zero
         - paNeverDropInput is only used for full-duplex callback streams with
@@ -948,7 +948,7 @@
                         != (*hostApi)->info.type )
                     return paIncompatibleHostApiSpecificStreamInfo;
             }
-        }
+        }   
 
         if( (inputParameters != NULL) && (outputParameters != NULL) )
         {
@@ -957,8 +957,8 @@
                 return paBadIODeviceCombination;
         }
     }
-
-
+    
+    
     /* Check for absurd sample rates. */
     if( (sampleRate < 1000.0) || (sampleRate > 200000.0) )
         return paInvalidSampleRate;
@@ -980,7 +980,7 @@
         if( framesPerBuffer != paFramesPerBufferUnspecified )
             return paInvalidFlag;
     }
-
+    
     return paNoError;
 }
 
@@ -1020,7 +1020,7 @@
         PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
         PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
     }
-
+    
     PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
 #endif
 
@@ -1043,7 +1043,7 @@
         PA_LOGAPI_EXIT_PAERROR( "Pa_IsFormatSupported", result );
         return result;
     }
-
+    
 
     if( inputParameters )
     {
@@ -1130,7 +1130,7 @@
         PA_LOGAPI(("\tPaTime outputParameters->suggestedLatency: %f\n", outputParameters->suggestedLatency ));
         PA_LOGAPI(("\tvoid *outputParameters->hostApiSpecificStreamInfo: 0x%p\n", outputParameters->hostApiSpecificStreamInfo ));
     }
-
+    
     PA_LOGAPI(("\tdouble sampleRate: %g\n", sampleRate ));
     PA_LOGAPI(("\tunsigned long framesPerBuffer: %d\n", framesPerBuffer ));
     PA_LOGAPI(("\tPaStreamFlags streamFlags: 0x%x\n", streamFlags ));
@@ -1177,7 +1177,7 @@
         PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) ));
         return result;
     }
-
+    
 
     if( inputParameters )
     {
@@ -1251,8 +1251,8 @@
     {
         hostApiInputParameters.device = Pa_GetDefaultInputDevice();
 		if( hostApiInputParameters.device == paNoDevice )
-			return paDeviceUnavailable;
-
+			return paDeviceUnavailable; 
+	
         hostApiInputParameters.channelCount = inputChannelCount;
         hostApiInputParameters.sampleFormat = sampleFormat;
         /* defaultHighInputLatency is used below instead of
@@ -1260,7 +1260,7 @@
            stream to work reliably than it is for it to work with the lowest
            latency.
          */
-        hostApiInputParameters.suggestedLatency =
+        hostApiInputParameters.suggestedLatency = 
              Pa_GetDeviceInfo( hostApiInputParameters.device )->defaultHighInputLatency;
         hostApiInputParameters.hostApiSpecificStreamInfo = NULL;
         hostApiInputParametersPtr = &hostApiInputParameters;
@@ -1274,7 +1274,7 @@
     {
         hostApiOutputParameters.device = Pa_GetDefaultOutputDevice();
 		if( hostApiOutputParameters.device == paNoDevice )
-			return paDeviceUnavailable;
+			return paDeviceUnavailable; 
 
         hostApiOutputParameters.channelCount = outputChannelCount;
         hostApiOutputParameters.sampleFormat = sampleFormat;
@@ -1658,7 +1658,7 @@
             else if( result == 1 )
             {
                 result = paStreamIsStopped;
-            }
+            }  
         }
     }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22