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)
115 AudioHardwarePropertyID inPropertyID,
116 UInt32* ioPropertyDataSize,
117 void* outPropertyData );
120 AudioHardwarePropertyID inPropertyID,
124 AudioDeviceID inDevice,
127 AudioDevicePropertyID inPropertyID,
128 UInt32* ioPropertyDataSize,
129 void* outPropertyData );
132 AudioDeviceID inDevice,
133 const AudioTimeStamp* inWhen,
136 AudioDevicePropertyID inPropertyID,
137 UInt32 inPropertyDataSize,
138 const void* inPropertyData );
141 AudioDeviceID inDevice,
144 AudioDevicePropertyID inPropertyID,
148 AudioDeviceID inDevice,
151 AudioDevicePropertyID inPropertyID,
152 AudioObjectPropertyListenerProc inProc,
153 void* inClientData );
156 AudioDeviceID inDevice,
159 AudioDevicePropertyID inPropertyID,
160 AudioObjectPropertyListenerProc inProc,
161 void* inClientData );
164 AudioStreamID inStream,
166 AudioDevicePropertyID inPropertyID,
167 UInt32* ioPropertyDataSize,
168 void* outPropertyData );
170 #define UNIX_ERR(err) PaMacCore_SetUnixError( err, __LINE__ )
194 long inputFramesPerBuffer,
195 long outputFramesPerBuffer,
199 AudioObjectID inObjectID,
200 UInt32 inNumberAddresses,
201 const AudioObjectPropertyAddress* inAddresses,
202 void* inClientData );
210 AudioDeviceID inDevice,
213 AudioDevicePropertyID inPropertyID,
214 UInt32 inPropertyDataSize,
215 const void *inPropertyData,
216 void *outPropertyData );
229 const bool requireExact,
230 const Float64 desiredSrate );
242 UInt32 requestedFramesPerBuffer,
243 UInt32 *actualFramesPerBuffer );
253 AudioObjectID inObjectID,
254 UInt32 inNumberAddresses,
255 const AudioObjectPropertyAddress* inAddresses,
256 void * inClientData );
void * addToXRunListenerList(void *stream)
Definition: pa_mac_core_utilities.c:779
OSStatus PaMacCore_AudioDeviceSetProperty(AudioDeviceID inDevice, const AudioTimeStamp *inWhen, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 inPropertyDataSize, const void *inPropertyData)
Definition: pa_mac_core_utilities.c:96
int destroyXRunListenerList(void)
Definition: pa_mac_core_utilities.c:766
PaError setBestSampleRateForDevice(const AudioDeviceID device, const bool isOutput, const bool requireExact, const Float64 desiredSrate)
Definition: pa_mac_core_utilities.c:534
OSStatus PaMacCore_AudioHardwareGetProperty(AudioHardwarePropertyID inPropertyID, UInt32 *ioPropertyDataSize, void *outPropertyData)
Definition: pa_mac_core_utilities.c:66
OSStatus PaMacCore_AudioStreamGetProperty(AudioStreamID inStream, UInt32 inChannel, AudioDevicePropertyID inPropertyID, UInt32 *ioPropertyDataSize, void *outPropertyData)
Definition: pa_mac_core_utilities.c:148
OSStatus PaMacCore_AudioDeviceGetPropertySize(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 *outSize)
Definition: pa_mac_core_utilities.c:110
PaError AudioDeviceSetPropertyNowAndWaitForChange(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 inPropertyDataSize, const void *inPropertyData, void *outPropertyData)
Definition: pa_mac_core_utilities.c:446
long computeRingBufferSize(const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, long inputFramesPerBuffer, long outputFramesPerBuffer, double sampleRate)
Definition: pa_mac_core_utilities.c:357
int initializeXRunListenerList(void)
Definition: pa_mac_core_utilities.c:760
The portable PortAudio API.
PaMacCoreStream * stream
Definition: pa_mac_core_utilities.c:712
OSStatus xrunCallback(AudioObjectID inDevice, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *inClientData)
Definition: pa_mac_core_utilities.c:724
OSStatus PaMacCore_AudioHardwareGetPropertySize(AudioHardwarePropertyID inPropertyID, UInt32 *outSize)
Definition: pa_mac_core_utilities.c:75
OSStatus PaMacCore_AudioDeviceGetProperty(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 *ioPropertyDataSize, void *outPropertyData)
Definition: pa_mac_core_utilities.c:83
int PaError
Definition: portaudio.h:122
Definition: portaudio.h:547
PaError PaMacCore_SetUnixError(int err, int line)
Definition: pa_mac_core_utilities.c:159
OSStatus PaMacCore_AudioDeviceRemovePropertyListener(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, AudioObjectPropertyListenerProc inProc, void *inClientData)
Definition: pa_mac_core_utilities.c:135
OSStatus propertyProc(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *inClientData)
Definition: pa_mac_core_utilities.c:427
Prototypes for utility functions used by PortAudio implementations.
PaError PaMacCore_SetError(OSStatus error, int line, int isError)
Definition: pa_mac_core_utilities.c:188
int removeFromXRunListenerList(void *stream)
Definition: pa_mac_core_utilities.c:794
PaError setBestFramesPerBuffer(const AudioDeviceID device, const bool isOutput, UInt32 requestedFramesPerBuffer, UInt32 *actualFramesPerBuffer)
Definition: pa_mac_core_utilities.c:638
OSStatus PaMacCore_AudioDeviceAddPropertyListener(AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, AudioObjectPropertyListenerProc inProc, void *inClientData)
Definition: pa_mac_core_utilities.c:122