From f4ca4385995edc83ff59404332342d918b540d77 Mon Sep 17 00:00:00 2001 From: John Melas Date: Fri, 27 Nov 2020 09:09:00 +0200 Subject: [PATCH] formatting and #ifdef comment --- src/hostapi/coreaudio/pa_mac_core.c | 11 +++++----- src/hostapi/coreaudio/pa_mac_core_utilities.c | 20 +++++++++---------- src/hostapi/coreaudio/pa_mac_core_utilities.h | 13 +++++++++--- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/hostapi/coreaudio/pa_mac_core.c b/src/hostapi/coreaudio/pa_mac_core.c index 155c6ba..21bd788 100644 --- a/src/hostapi/coreaudio/pa_mac_core.c +++ b/src/hostapi/coreaudio/pa_mac_core.c @@ -1083,7 +1083,8 @@ static OSStatus AudioDevicePropertyActualSampleRateListenerProc( AudioDeviceID i } return osErr; } -#endif +#endif /* PA_NEW_HAL */ + /* ================================================================================= */ static OSStatus QueryUInt32DeviceProperty( AudioDeviceID deviceID, Boolean isInput, AudioDevicePropertyID propertyID, UInt32 *outValue ) { @@ -1169,7 +1170,7 @@ static OSStatus AudioDevicePropertyGenericListenerProc( AudioDeviceID inDevice, } return osErr; } -#endif +#endif /* PA_NEW_HAL */ /* ================================================================================= */ /* @@ -2244,7 +2245,7 @@ static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter, return noErr; } -#endif +#endif /* PA_NEW_HAL */ /* * Called by the AudioUnit API to process audio from the sound card. @@ -2486,7 +2487,7 @@ static OSStatus AudioIOProc( void *inRefCon, &stream->inputRingBuffer, &size, (void *)&data ); -#endif +#endif /* PA_NEW_HAL */ if( err == RING_BUFFER_EMPTY ) { /* the ring buffer callback underflowed */ err = 0; @@ -2686,7 +2687,7 @@ static OSStatus AudioIOProc( void *inRefCon, &stream->inputRingBuffer, &size, (void *)data ); -#endif +#endif /* PA_NEW_HAL */ if( err != RING_BUFFER_EMPTY ) ERR( err ); if( err != noErr && err != RING_BUFFER_EMPTY ) diff --git a/src/hostapi/coreaudio/pa_mac_core_utilities.c b/src/hostapi/coreaudio/pa_mac_core_utilities.c index 2e85907..711d5ca 100644 --- a/src/hostapi/coreaudio/pa_mac_core_utilities.c +++ b/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -73,7 +73,7 @@ OSStatus pa_AudioHardwareGetProperty( return AudioObjectGetPropertyData(kAudioObjectSystemObject, &address, 0, NULL, ioPropertyDataSize, outPropertyData); #else return AudioHardwareGetProperty(inPropertyID, ioPropertyDataSize, outPropertyData); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioHardwareGetPropertySize( @@ -85,7 +85,7 @@ OSStatus pa_AudioHardwareGetPropertySize( return AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &address, 0, NULL, outSize); #else return AudioHardwareGetPropertyInfo(inPropertyID, outSize, NULL); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioDeviceGetProperty( @@ -102,7 +102,7 @@ OSStatus pa_AudioDeviceGetProperty( return AudioObjectGetPropertyData(inDevice, &address, 0, NULL, ioPropertyDataSize, outPropertyData); #else return AudioDeviceGetProperty(inDevice, inChannel, isInput, inPropertyID, ioPropertyDataSize, outPropertyData); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioDeviceSetProperty( @@ -120,7 +120,7 @@ OSStatus pa_AudioDeviceSetProperty( return AudioObjectSetPropertyData(inDevice, &address, 0, NULL, inPropertyDataSize, inPropertyData); #else return AudioDeviceSetProperty(inDevice, inWhen, inChannel, isInput, inPropertyID, inPropertyDataSize, inPropertyData); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioDeviceGetPropertySize( @@ -136,7 +136,7 @@ OSStatus pa_AudioDeviceGetPropertySize( return AudioObjectGetPropertyDataSize(inDevice, &address, 0, NULL, outSize); #else return AudioDeviceGetPropertyInfo(inDevice, inChannel, isInput, inPropertyID, outSize, NULL); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioDeviceAddPropertyListener( @@ -153,7 +153,7 @@ OSStatus pa_AudioDeviceAddPropertyListener( return AudioObjectAddPropertyListener(inDevice, &address, inProc, inClientData); #else return AudioDeviceAddPropertyListener(inDevice, inChannel, isInput, inPropertyID, inProc, inClientData); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioDeviceRemovePropertyListener( @@ -170,7 +170,7 @@ OSStatus pa_AudioDeviceRemovePropertyListener( return AudioObjectRemovePropertyListener(inDevice, &address, inProc, inClientData); #else return AudioDeviceRemovePropertyListener(inDevice, inChannel, isInput, inPropertyID, inProc); -#endif +#endif /* PA_NEW_HAL */ } OSStatus pa_AudioStreamGetProperty( @@ -185,7 +185,7 @@ OSStatus pa_AudioStreamGetProperty( return AudioObjectGetPropertyData(inStream, &address, 0, NULL, ioPropertyDataSize, outPropertyData); #else return AudioStreamGetProperty(inStream, inChannel, inPropertyID, ioPropertyDataSize, outPropertyData); -#endif +#endif /* PA_NEW_HAL */ } PaError PaMacCore_SetUnixError( int err, int line ) @@ -455,7 +455,7 @@ OSStatus propertyProc( // this is where we would set the condition variable return noErr; } -#endif +#endif /* PA_NEW_HAL */ /* sets the value of the given property and waits for the change to be acknowledged, and returns the final value, which is not guaranteed @@ -815,7 +815,7 @@ OSStatus xrunCallback( return 0; } -#endif +#endif /* PA_NEW_HAL */ int initializeXRunListenerList( void ) { diff --git a/src/hostapi/coreaudio/pa_mac_core_utilities.h b/src/hostapi/coreaudio/pa_mac_core_utilities.h index e6e0c6e..8888a36 100644 --- a/src/hostapi/coreaudio/pa_mac_core_utilities.h +++ b/src/hostapi/coreaudio/pa_mac_core_utilities.h @@ -121,15 +121,17 @@ typedef AudioObjectPropertyListenerProc pa_AudioDevicePropertyListenerProc; #else typedef AudioDevicePropertyListenerProc pa_AudioDevicePropertyListenerProc; -#endif +#endif /* PA_NEW_HAL */ OSStatus pa_AudioHardwareGetProperty( AudioHardwarePropertyID inPropertyID, UInt32* ioPropertyDataSize, void* outPropertyData); + OSStatus pa_AudioHardwareGetPropertySize( AudioHardwarePropertyID inPropertyID, UInt32* outSize); + OSStatus pa_AudioDeviceGetProperty( AudioDeviceID inDevice, UInt32 inChannel, @@ -137,6 +139,7 @@ OSStatus pa_AudioDeviceGetProperty( AudioDevicePropertyID inPropertyID, UInt32* ioPropertyDataSize, void* outPropertyData); + OSStatus pa_AudioDeviceSetProperty( AudioDeviceID inDevice, const AudioTimeStamp* inWhen, @@ -145,12 +148,14 @@ OSStatus pa_AudioDeviceSetProperty( AudioDevicePropertyID inPropertyID, UInt32 inPropertyDataSize, const void* inPropertyData); + OSStatus pa_AudioDeviceGetPropertySize( AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32* outSize); + OSStatus pa_AudioDeviceAddPropertyListener( AudioDeviceID inDevice, UInt32 inChannel, @@ -158,6 +163,7 @@ OSStatus pa_AudioDeviceAddPropertyListener( AudioDevicePropertyID inPropertyID, pa_AudioDevicePropertyListenerProc inProc, void* inClientData); + OSStatus pa_AudioDeviceRemovePropertyListener( AudioDeviceID inDevice, UInt32 inChannel, @@ -165,6 +171,7 @@ OSStatus pa_AudioDeviceRemovePropertyListener( AudioDevicePropertyID inPropertyID, pa_AudioDevicePropertyListenerProc inProc, void* inClientData); + OSStatus pa_AudioStreamGetProperty( AudioStreamID inStream, UInt32 inChannel, @@ -213,7 +220,7 @@ OSStatus propertyProc( Boolean isInput, AudioDevicePropertyID inPropertyID, void* inClientData ); -#endif +#endif /* PA_NEW_HAL */ /* sets the value of the given property and waits for the change to be acknowledged, and returns the final value, which is not guaranteed @@ -276,7 +283,7 @@ OSStatus xrunCallback( Boolean isInput, AudioDevicePropertyID inPropertyID, void* inClientData ) ; -#endif +#endif /* PA_NEW_HAL */ /** returns zero on success or a unix style error code. */ int initializeXRunListenerList( void ); -- 2.43.0