59 #ifndef PA_MAC_CORE_UTILITIES_H__
60 #define PA_MAC_CORE_UTILITIES_H__
65 #include <AudioUnit/AudioUnit.h>
66 #include <AudioToolbox/AudioToolbox.h>
69 #define MIN(a, b) (((a)<(b))?(a):(b))
73 #define MAX(a, b) (((a)<(b))?(b):(a))
76 #define ERR(mac_error) PaMacCore_SetError(mac_error, __LINE__, 1 )
77 #define WARNING(mac_error) PaMacCore_SetError(mac_error, __LINE__, 0 )
81 #define INPUT_ELEMENT (1)
82 #define OUTPUT_ELEMENT (0)
87 #define MAC_CORE_DEBUG
89 # define DBUG(MSG) do { printf("||PaMacCore (AUHAL)|| "); printf MSG ; fflush(stdout); } while(0)
98 #ifdef MAC_CORE_VERBOSE_DEBUG
99 # define VDBUG(MSG) do { printf("||PaMacCore (v )|| "); printf MSG ; fflush(stdout); } while(0)
108 #ifdef MAC_CORE_VERY_VERBOSE_DEBUG
109 # define VVDBUG(MSG) do { printf("||PaMacCore (vv)|| "); printf MSG ; fflush(stdout); } while(0)
118 #define UNIX_ERR(err) PaMacCore_SetUnixError( err, __LINE__ )
142 long inputFramesPerBuffer,
143 long outputFramesPerBuffer,
147 AudioDeviceID inDevice,
150 AudioDevicePropertyID inPropertyID,
151 void* inClientData );
159 AudioDeviceID inDevice,
162 AudioDevicePropertyID inPropertyID,
163 UInt32 inPropertyDataSize,
164 const void *inPropertyData,
165 void *outPropertyData );
178 const bool requireExact,
179 const Float64 desiredSrate );
191 UInt32 requestedFramesPerBuffer,
192 UInt32 *actualFramesPerBuffer );
202 AudioDeviceID inDevice,
205 AudioDevicePropertyID inPropertyID,
206 void* inClientData ) ;
void * addToXRunListenerList(void *stream)
Definition: pa_mac_core_utilities.c:663
OSStatus propertyProc(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, void *inClientData)
Definition: pa_mac_core_utilities.c:310
PaError setBestSampleRateForDevice(const AudioDeviceID device, const bool isOutput, const bool requireExact, const Float64 desiredSrate)
Definition: pa_mac_core_utilities.c:418
PaError AudioDeviceSetPropertyNowAndWaitForChange(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 inPropertyDataSize, const void *inPropertyData, void *outPropertyData)
Definition: pa_mac_core_utilities.c:330
long computeRingBufferSize(const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, long inputFramesPerBuffer, long outputFramesPerBuffer, double sampleRate)
Definition: pa_mac_core_utilities.c:240
The portable PortAudio API.
PaMacCoreStream * stream
Definition: pa_mac_core_utilities.c:596
int PaError
Definition: portaudio.h:121
Definition: portaudio.h:538
PaError PaMacCore_SetUnixError(int err, int line)
Definition: pa_mac_core_utilities.c:66
Prototypes for utility functions used by PortAudio implementations.
PaError PaMacCore_SetError(OSStatus error, int line, int isError)
Definition: pa_mac_core_utilities.c:95
int removeFromXRunListenerList(void *stream)
Definition: pa_mac_core_utilities.c:678
int destroyXRunListenerList()
Definition: pa_mac_core_utilities.c:650
int initializeXRunListenerList()
Definition: pa_mac_core_utilities.c:644
PaError setBestFramesPerBuffer(const AudioDeviceID device, const bool isOutput, UInt32 requestedFramesPerBuffer, UInt32 *actualFramesPerBuffer)
Definition: pa_mac_core_utilities.c:522
OSStatus xrunCallback(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, void *inClientData)
Definition: pa_mac_core_utilities.c:608