|
PortAudio
2.0
|
#include <pthread.h>#include "portaudio.h"#include "pa_util.h"#include <AudioUnit/AudioUnit.h>#include <AudioToolbox/AudioToolbox.h>Go to the source code of this file.
Macros | |
| #define | MIN(a, b) (((a)<(b))?(a):(b)) |
| #define | MAX(a, b) (((a)<(b))?(b):(a)) |
| #define | ERR(mac_error) PaMacCore_SetError(mac_error, __LINE__, 1 ) |
| #define | WARNING(mac_error) PaMacCore_SetError(mac_error, __LINE__, 0 ) |
| #define | INPUT_ELEMENT (1) |
| #define | OUTPUT_ELEMENT (0) |
| #define | MAC_CORE_DEBUG |
| #define | DBUG(MSG) do { printf("||PaMacCore (AUHAL)|| "); printf MSG ; fflush(stdout); } while(0) |
| #define | VDBUG(MSG) |
| #define | VVDBUG(MSG) |
| #define | UNIX_ERR(err) PaMacCore_SetUnixError( err, __LINE__ ) |
Functions | |
| PaError | PaMacCore_SetUnixError (int err, int line) |
| PaError | PaMacCore_SetError (OSStatus error, int line, int isError) |
| long | computeRingBufferSize (const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, long inputFramesPerBuffer, long outputFramesPerBuffer, double sampleRate) |
| OSStatus | propertyProc (AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, void *inClientData) |
| PaError | AudioDeviceSetPropertyNowAndWaitForChange (AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, UInt32 inPropertyDataSize, const void *inPropertyData, void *outPropertyData) |
| PaError | setBestSampleRateForDevice (const AudioDeviceID device, const bool isOutput, const bool requireExact, const Float64 desiredSrate) |
| PaError | setBestFramesPerBuffer (const AudioDeviceID device, const bool isOutput, UInt32 requestedFramesPerBuffer, UInt32 *actualFramesPerBuffer) |
| OSStatus | xrunCallback (AudioDeviceID inDevice, UInt32 inChannel, Boolean isInput, AudioDevicePropertyID inPropertyID, void *inClientData) |
| int | initializeXRunListenerList () |
| int | destroyXRunListenerList () |
| void * | addToXRunListenerList (void *stream) |
| int | removeFromXRunListenerList (void *stream) |
| #define DBUG | ( | MSG | ) | do { printf("||PaMacCore (AUHAL)|| "); printf MSG ; fflush(stdout); } while(0) |
Referenced by AudioDeviceSetPropertyNowAndWaitForChange(), PaMacCore_SetError(), and PaMacCore_SetUnixError().
| #define ERR | ( | mac_error | ) | PaMacCore_SetError(mac_error, __LINE__, 1 ) |
| #define INPUT_ELEMENT (1) |
| #define MAC_CORE_DEBUG |
| #define MAX | ( | a, | |
| b | |||
| ) | (((a)<(b))?(b):(a)) |
Referenced by computeRingBufferSize().
| #define MIN | ( | a, | |
| b | |||
| ) | (((a)<(b))?(a):(b)) |
Referenced by ReadStream(), and WriteStream().
| #define OUTPUT_ELEMENT (0) |
| #define UNIX_ERR | ( | err | ) | PaMacCore_SetUnixError( err, __LINE__ ) |
Referenced by destroyBlioRingBuffers(), initializeBlioRingBuffers(), PaMacCore_Initialize(), ReadStream(), and WriteStream().
| #define VDBUG | ( | MSG | ) |
Referenced by computeRingBufferSize(), setBestSampleRateForDevice(), and waitUntilBlioWriteBufferIsEmpty().
| #define VVDBUG | ( | MSG | ) |
| #define WARNING | ( | mac_error | ) | PaMacCore_SetError(mac_error, __LINE__, 0 ) |
Referenced by PaMacCore_GetBufferSizeRange().
| void* addToXRunListenerList | ( | void * | stream | ) |
Returns the list, so that it can be passed to CorAudio.
References PaMacXRunListNode_s::next, and PaMacXRunListNode_s::stream.
| PaError AudioDeviceSetPropertyNowAndWaitForChange | ( | AudioDeviceID | inDevice, |
| UInt32 | inChannel, | ||
| Boolean | isInput, | ||
| AudioDevicePropertyID | inPropertyID, | ||
| UInt32 | inPropertyDataSize, | ||
| const void * | inPropertyData, | ||
| void * | outPropertyData | ||
| ) |
References DBUG, ERR, Pa_Sleep(), paInternalError, paNoError, and propertyProc().
Referenced by setBestSampleRateForDevice().
| long computeRingBufferSize | ( | const PaStreamParameters * | inputParameters, |
| const PaStreamParameters * | outputParameters, | ||
| long | inputFramesPerBuffer, | ||
| long | outputFramesPerBuffer, | ||
| double | sampleRate | ||
| ) |
References MAX, PaStreamParameters::suggestedLatency, VDBUG, and VVDBUG.
| int destroyXRunListenerList | ( | ) |
returns zero on success or a unix style error code.
References PaMacXRunListNode_s::next.
| int initializeXRunListenerList | ( | ) |
returns zero on success or a unix style error code.
Referenced by PaMacCore_Initialize().
| PaError PaMacCore_SetError | ( | OSStatus | error, |
| int | line, | ||
| int | isError | ||
| ) |
| PaError PaMacCore_SetUnixError | ( | int | err, |
| int | line | ||
| ) |
Map Unix error to PaError. Pretty much the only one that maps is ENOMEM.
References DBUG, paCoreAudio, paInsufficientMemory, paInternalError, paNoError, and PaUtil_SetLastHostErrorInfo().
Referenced by initializeBlioRingBuffers().
| OSStatus propertyProc | ( | AudioDeviceID | inDevice, |
| UInt32 | inChannel, | ||
| Boolean | isInput, | ||
| AudioDevicePropertyID | inPropertyID, | ||
| void * | inClientData | ||
| ) |
Referenced by AudioDeviceSetPropertyNowAndWaitForChange().
| int removeFromXRunListenerList | ( | void * | stream | ) |
Returns the number of Listeners in the list remaining.
References PaMacXRunListNode_s::next, and PaMacXRunListNode_s::stream.
| PaError setBestFramesPerBuffer | ( | const AudioDeviceID | device, |
| const bool | isOutput, | ||
| UInt32 | requestedFramesPerBuffer, | ||
| UInt32 * | actualFramesPerBuffer | ||
| ) |
| PaError setBestSampleRateForDevice | ( | const AudioDeviceID | device, |
| const bool | isOutput, | ||
| const bool | requireExact, | ||
| const Float64 | desiredSrate | ||
| ) |
| OSStatus xrunCallback | ( | AudioDeviceID | inDevice, |
| UInt32 | inChannel, | ||
| Boolean | isInput, | ||
| AudioDevicePropertyID | inPropertyID, | ||
| void * | inClientData | ||
| ) |
1.8.5