PortAudio
2.0
|
CoreAudio-specific PortAudio API extension header file. More...
Go to the source code of this file.
Data Structures | |
struct | PaMacCoreStreamInfo |
Macros | |
#define | paMacCoreChangeDeviceParameters (0x01) |
#define | paMacCoreFailIfConversionRequired (0x02) |
#define | paMacCoreConversionQualityMin (0x0100) |
#define | paMacCoreConversionQualityMedium (0x0200) |
#define | paMacCoreConversionQualityLow (0x0300) |
#define | paMacCoreConversionQualityHigh (0x0400) |
#define | paMacCoreConversionQualityMax (0x0000) |
#define | paMacCorePlayNice (0x00) |
#define | paMacCorePro (0x01) |
#define | paMacCoreMinimizeCPUButPlayNice (0x0100) |
#define | paMacCoreMinimizeCPU (0x0101) |
Functions | |
void | PaMacCore_SetupStreamInfo (PaMacCoreStreamInfo *data, unsigned long flags) |
void | PaMacCore_SetupChannelMap (PaMacCoreStreamInfo *data, const SInt32 *const channelMap, unsigned long channelMapSize) |
AudioDeviceID | PaMacCore_GetStreamInputDevice (PaStream *s) |
AudioDeviceID | PaMacCore_GetStreamOutputDevice (PaStream *s) |
const char * | PaMacCore_GetChannelName (int device, int channelIndex, bool input) |
PaError | PaMacCore_GetBufferSizeRange (PaDeviceIndex device, long *minBufferSizeFrames, long *maxBufferSizeFrames) |
CoreAudio-specific PortAudio API extension header file.
#define paMacCoreChangeDeviceParameters (0x01) |
Flags The following flags alter the behaviour of PA on the mac platform. they can be ORed together. These should work both for opening and checking a device. Allows PortAudio to change things like the device's frame size, which allows for much lower latency, but might disrupt the device if other programs are using it, even when you are just Querying the device.
#define paMacCoreConversionQualityHigh (0x0400) |
#define paMacCoreConversionQualityLow (0x0300) |
#define paMacCoreConversionQualityMax (0x0000) |
#define paMacCoreConversionQualityMedium (0x0200) |
#define paMacCoreConversionQualityMin (0x0100) |
These flags set the SR conversion quality, if required. The wierd ordering allows Maximum Quality to be the default.
#define paMacCoreFailIfConversionRequired (0x02) |
In combination with the above flag, causes the stream opening to fail, unless the exact sample rates are supported by the device.
#define paMacCoreMinimizeCPU (0x0101) |
This is a setting to minimize CPU usage, even if that means interrupting the device.
#define paMacCoreMinimizeCPUButPlayNice (0x0100) |
This is a setting to minimize CPU usage and still play nice.
#define paMacCorePlayNice (0x00) |
Here are some "preset" combinations of flags (above) to get to some common configurations. THIS IS OVERKILL, but if more flags are added it won't be.This is the default setting: do as much sample rate conversion as possible and as little mucking with the device as possible.
#define paMacCorePro (0x01) |
This setting is tuned for pro audio apps. It allows SR conversion on input and output, but it tries to set the appropriate SR on the device.
PaError PaMacCore_GetBufferSizeRange | ( | PaDeviceIndex | device, |
long * | minBufferSizeFrames, | ||
long * | maxBufferSizeFrames | ||
) |
Retrieve the range of legal native buffer sizes for the specificed device, in sample frames.
device | The global index of the PortAudio device about which the query is being made. |
minBufferSizeFrames | A pointer to the location which will receive the minimum buffer size value. |
maxBufferSizeFrames | A pointer to the location which will receive the maximum buffer size value. |
References PaUtilHostApiRepresentation::deviceInfos, PaMacAUHAL::devIds, PaMacAUHAL::inheritedHostApiRep, PaDeviceInfo::maxOutputChannels, paCoreAudio, paNoError, PaUtil_DeviceIndexToHostApiDeviceIndex(), PaUtil_GetHostApiRepresentation(), and WARNING.
const char* PaMacCore_GetChannelName | ( | int | device, |
int | channelIndex, | ||
bool | input | ||
) |
Returns a statically allocated string with the device's name for the given channel. NULL will be returned on failure.
This function's implemenation is not complete!
device | The PortAudio device index. |
channel | The channel number who's name is requested. |
References PaUtilHostApiRepresentation::deviceInfos, PaMacAUHAL::devIds, PaDeviceInfo::name, paCoreAudio, paNoError, and PaUtil_GetHostApiRepresentation().
AudioDeviceID PaMacCore_GetStreamInputDevice | ( | PaStream * | s | ) |
Retrieve the AudioDeviceID of the input device assigned to an open stream
s | The stream to query. |
References PaMacCoreStream::inputDevice, and VVDBUG.
AudioDeviceID PaMacCore_GetStreamOutputDevice | ( | PaStream * | s | ) |
Retrieve the AudioDeviceID of the output device assigned to an open stream
s | The stream to query. |
References PaMacCoreStream::outputDevice, and VVDBUG.
void PaMacCore_SetupChannelMap | ( | PaMacCoreStreamInfo * | data, |
const SInt32 *const | channelMap, | ||
unsigned long | channelMapSize | ||
) |
call this after pa_SetupMacCoreStreamInfo to use channel mapping as described in notes.txt.
data | The stream info structure to assign a channel mapping to |
channelMap | The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be copied), so the caller should not free the array until after the stream has been opened. |
channelMapSize | The size of the channel map array. |
References PaMacCoreStreamInfo::channelMap, and PaMacCoreStreamInfo::channelMapSize.
void PaMacCore_SetupStreamInfo | ( | PaMacCoreStreamInfo * | data, |
unsigned long | flags | ||
) |
Functions Use this function to initialize a paMacCoreStreamInfo struct using the requested flags. Note that channel mapping is turned off after a call to this function.
data | The datastructure to initialize |
flags | The flags to initialize the datastructure with. |
References PaMacCoreStreamInfo::channelMap, PaMacCoreStreamInfo::channelMapSize, PaMacCoreStreamInfo::flags, PaMacCoreStreamInfo::hostApiType, paCoreAudio, PaMacCoreStreamInfo::size, and PaMacCoreStreamInfo::version.