/[pcsx2_0.9.7]/trunk/3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c
ViewVC logotype

Diff of /trunk/3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c

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

--- trunk/3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c	2010/11/12 00:35:47	272
+++ trunk/3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c	2010/11/12 01:10:22	273
@@ -15,7 +15,7 @@
  * Olivier Tristan for feedback and testing
  * Glenn Zelniker and Z-Systems engineering for sponsoring the Blocking I/O
  * interface.
- *
+ * 
  *
  * Based on the Open Source API proposed by Ross Bencina
  * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
@@ -41,13 +41,13 @@
  */
 
 /*
- * 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.
  */
 
@@ -97,16 +97,16 @@
     /*FIXME: still need to handle possible ComponentResult values.*/
     /*       unfortunately, they don't seem to be documented anywhere.*/
     PaError result;
-    const char *errorType;
+    const char *errorType; 
     const char *errorText;
-
+    
     switch (error) {
     case kAudioHardwareNoError:
         return paNoError;
     case kAudioHardwareNotRunningError:
         errorText = "Audio Hardware Not Running";
         result = paInternalError; break;
-    case kAudioHardwareUnspecifiedError:
+    case kAudioHardwareUnspecifiedError: 
         errorText = "Unspecified Audio Hardware Error";
         result = paInternalError; break;
     case kAudioHardwareUnknownPropertyError:
@@ -115,7 +115,7 @@
     case kAudioHardwareBadPropertySizeError:
         errorText = "Audio Hardware: Bad Property Size";
         result = paInternalError; break;
-    case kAudioHardwareIllegalOperationError:
+    case kAudioHardwareIllegalOperationError: 
         errorText = "Audio Hardware: Illegal Operation";
         result = paInternalError; break;
     case kAudioHardwareBadDeviceError:
@@ -261,7 +261,7 @@
       framesPerBufferTimesChannelCount = MAX(
            inputFramesPerBuffer * inputParameters->channelCount,
            outputFramesPerBuffer * outputParameters->channelCount );
-   }
+   } 
    else if( outputParameters )
    {
       latencyTimesChannelCount
@@ -316,17 +316,17 @@
  */
 
 OSStatus propertyProc(
-    AudioDeviceID inDevice,
-    UInt32 inChannel,
-    Boolean isInput,
-    AudioDevicePropertyID inPropertyID,
+    AudioDeviceID inDevice, 
+    UInt32 inChannel, 
+    Boolean isInput, 
+    AudioDevicePropertyID inPropertyID, 
     void* inClientData )
 {
    // this is where we would set the condition variable
    return noErr;
 }
 
-/* sets the value of the given property and waits for the change to
+/* sets the value of the given property and waits for the change to 
    be acknowledged, and returns the final value, which is not guaranteed
    by this function to be the same as the desired value. Obviously, this
    function can only be used for data whose input and output are the
@@ -337,10 +337,10 @@
    determining if the property was read. */
 PaError AudioDeviceSetPropertyNowAndWaitForChange(
     AudioDeviceID inDevice,
-    UInt32 inChannel,
-    Boolean isInput,
+    UInt32 inChannel, 
+    Boolean isInput, 
     AudioDevicePropertyID inPropertyID,
-    UInt32 inPropertyDataSize,
+    UInt32 inPropertyDataSize, 
     const void *inPropertyData,
     void *outPropertyData )
 {
@@ -349,7 +349,7 @@
 
    /* First, see if it already has that value. If so, return. */
    macErr = AudioDeviceGetProperty( inDevice, inChannel,
-                                 isInput, inPropertyID,
+                                 isInput, inPropertyID, 
                                  &outPropertyDataSize, outPropertyData );
    if( macErr ) {
       memset( outPropertyData, 0, inPropertyDataSize );
@@ -367,7 +367,7 @@
       but for now, this is just to make 10.6 happy. */
    macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput,
                                    inPropertyID, propertyProc,
-                                   NULL );
+                                   NULL ); 
    if( macErr )
       /* we couldn't add a listener. */
       goto failMac;
@@ -389,7 +389,7 @@
    while( tv2.tv_sec - tv1.tv_sec < 30 ) {
       /* now read the property back out */
       macErr = AudioDeviceGetProperty( inDevice, inChannel,
-                                    isInput, inPropertyID,
+                                    isInput, inPropertyID, 
                                     &outPropertyDataSize, outPropertyData );
       if( macErr ) {
          memset( outPropertyData, 0, inPropertyDataSize );
@@ -405,7 +405,7 @@
       gettimeofday( &tv2, NULL );
    }
    DBUG( ("Timeout waiting for device setting.\n" ) );
-
+   
    AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc );
    return paNoError;
 
@@ -481,7 +481,7 @@
               (float) ranges[i].mMaximum ) );
 #endif
    VDBUG(("-----\n"));
-
+   
    /* -- now pick the best available sample rate -- */
    for( i=0; i<propsize/sizeof(AudioValueRange); ++i )
    {
@@ -529,7 +529,7 @@
 */
 PaError setBestFramesPerBuffer( const AudioDeviceID device,
                                 const bool isOutput,
-                                UInt32 requestedFramesPerBuffer,
+                                UInt32 requestedFramesPerBuffer, 
                                 UInt32 *actualFramesPerBuffer )
 {
    UInt32 afpb;
@@ -584,7 +584,7 @@
               (float) ranges[i].mMaximum ) );
 #endif
    VDBUG(("-----\n"));
-
+   
    /* --- now pick the best available framesPerBuffer -- */
    for( i=0; i<propsize/sizeof(AudioValueRange); ++i )
    {
@@ -638,10 +638,10 @@
 static pthread_mutex_t xrunMutex;
 
 OSStatus xrunCallback(
-    AudioDeviceID inDevice,
-    UInt32 inChannel,
-    Boolean isInput,
-    AudioDevicePropertyID inPropertyID,
+    AudioDeviceID inDevice, 
+    UInt32 inChannel, 
+    Boolean isInput, 
+    AudioDevicePropertyID inPropertyID, 
     void* inClientData)
 {
    PaMacXRunListNode *node = (PaMacXRunListNode *) inClientData;

 

  ViewVC Help
Powered by ViewVC 1.1.22