#include "portaudio.h"
Go to the source code of this file.
Defines | |
#define | PA_DEBUG(x) |
Functions | |
PaError | PaUtil_GetHostApiRepresentation (struct PaUtilHostApiRepresentation **hostApi, PaHostApiTypeId type) |
PaError | PaUtil_DeviceIndexToHostApiDeviceIndex (PaDeviceIndex *hostApiDevice, PaDeviceIndex device, struct PaUtilHostApiRepresentation *hostApi) |
void | PaUtil_SetLastHostErrorInfo (PaHostApiTypeId hostApiType, long errorCode, const char *errorText) |
void | PaUtil_DebugPrint (const char *format,...) |
void * | PaUtil_AllocateMemory (long size) |
void | PaUtil_FreeMemory (void *block) |
int | PaUtil_CountCurrentlyAllocatedBlocks (void) |
void | PaUtil_InitializeClock (void) |
double | PaUtil_GetTime (void) |
#define PA_DEBUG | ( | x | ) |
void* PaUtil_AllocateMemory | ( | long | size | ) |
Allocate size bytes, guaranteed to be aligned to a FIXME byte boundary
int PaUtil_CountCurrentlyAllocatedBlocks | ( | void | ) |
Return the number of currently allocated blocks. This function can be used for detecting memory leaks.
void PaUtil_DebugPrint | ( | const char * | format, | |
... | ||||
) |
PA_DEBUG() provides a simple debug message printing facility. The macro passes it's argument to a printf-like function called PaUtil_DebugPrint() which prints to stderr and always flushes the stream after printing. Because preprocessor macros cannot directly accept variable length argument lists, calls to the macro must include an additional set of parenthesis, eg: PA_DEBUG(("errorno: %d", 1001 ));
PaError PaUtil_DeviceIndexToHostApiDeviceIndex | ( | PaDeviceIndex * | hostApiDevice, | |
PaDeviceIndex | device, | |||
struct PaUtilHostApiRepresentation * | hostApi | |||
) |
Convert a PortAudio device index into a host API specific device index.
hostApiDevice | Pointer to a device index, on success this will recieve the converted device index value. | |
device | The PortAudio device index to convert. | |
hostApi | The host api which the index should be converted for. |
void PaUtil_FreeMemory | ( | void * | block | ) |
Realease block if non-NULL. block may be NULL
PaError PaUtil_GetHostApiRepresentation | ( | struct PaUtilHostApiRepresentation ** | hostApi, | |
PaHostApiTypeId | type | |||
) |
Retrieve a specific host API representation. This function can be used by implementations to retrieve a pointer to their representation in host api specific extension functions which aren't passed a rep pointer by pa_front.c.
hostApi | A pointer to a host API represenation pointer. Apon success this will receive the requested representation pointer. | |
type | A valid host API type identifier. |
double PaUtil_GetTime | ( | void | ) |
Return the system time in seconds. Used to implement CPU load functions
void PaUtil_InitializeClock | ( | void | ) |
Initialize the clock used by PaUtil_GetTime(). Call this before calling PaUtil_GetTime.
void PaUtil_SetLastHostErrorInfo | ( | PaHostApiTypeId | hostApiType, | |
long | errorCode, | |||
const char * | errorText | |||
) |
Set the host error information returned by Pa_GetLastHostErrorInfo. This function and the paUnanticipatedHostError error code should be used as a last resort. Implementors should use existing PA error codes where possible, or nominate new ones. Note that at it is always better to use PaUtil_SetLastHostErrorInfo() and paUnanticipatedHostError than to return an ambiguous or inaccurate PaError code.
hostApiType | The host API which encountered the error (ie of the caller) | |
errorCode | The error code returned by the native API function. | |
errorText | A string describing the error. PaUtil_SetLastHostErrorInfo makes a copy of the string, so it is not necessary for the pointer to remain valid after the call to PaUtil_SetLastHostErrorInfo() returns. |