XT-Audio
|
Device queries and stream creation. More...
Go to the source code of this file.
Functions | |
void | XtDeviceDestroy (XtDevice *d) |
Destroys an audio device. More... | |
void * | XtDeviceGetHandle (XtDevice const *d) |
Implementation-defined handle to the backend device. More... | |
XtError | XtDeviceShowControlPanel (XtDevice *d) |
Show the device specific control panel. More... | |
XtError | XtDeviceGetMix (XtDevice const *d, XtBool *valid, XtMix *mix) |
Gets the device's current mix format. More... | |
XtError | XtDeviceGetChannelCount (XtDevice const *d, XtBool output, int32_t *count) |
Gets the maximum number of channels supported by the device. More... | |
XtError | XtDeviceSupportsAccess (XtDevice const *d, XtBool interleaved, XtBool *supports) |
Indicates whether the device supports the specified access mode. More... | |
XtError | XtDeviceSupportsFormat (XtDevice const *d, const XtFormat *format, XtBool *supports) |
Indicates whether an audio format is supported by the device. More... | |
XtError | XtDeviceGetBufferSize (XtDevice const *d, const XtFormat *format, XtBufferSize *size) |
Gets the buffer size limits supported by the device. More... | |
XtError | XtDeviceOpenStream (XtDevice *d, XtDeviceStreamParams const *params, void *user, XtStream **stream) |
Opens an audio stream on the given device. More... | |
XtError | XtDeviceGetChannelName (XtDevice const *d, XtBool output, int32_t index, char *buffer, int32_t *size) |
Gets the name of a specific input/output channel. More... | |
Device queries and stream creation.
Contains functions to query audio devices for supported formats and buffer sizes, and opening audio streams.
void XtDeviceDestroy | ( | XtDevice * | d | ) |
Destroys an audio device.
d | the audio device. |
It is an error to destroy a device which still has open streams. It is ok to pass NULL.
This function may only be called from the main thread.
XtError XtDeviceGetBufferSize | ( | XtDevice const * | d, |
const XtFormat * | format, | ||
XtBufferSize * | size | ||
) |
Gets the buffer size limits supported by the device.
d | the audio device. |
format | the audio format to test buffer limits for. |
size | on success, buffer receives the buffer size limits for the given format. |
The given format must be supported by the device, see XtDeviceSupportsFormat.
This function may only be called from the main thread.
Gets the maximum number of channels supported by the device.
d | the audio device. |
output | true to query output channels, false to query input channels. |
count | on success, receives the maximum channel count. |
The channel count represents the maximum number of channels representable by the current device. This value dictates the possible values of the audio format's channel masks only, it does not indicate that the device actually supports streams with the number of channels returned by this method.
This function may only be called from the main thread.
XtError XtDeviceGetChannelName | ( | XtDevice const * | d, |
XtBool | output, | ||
int32_t | index, | ||
char * | buffer, | ||
int32_t * | size | ||
) |
Gets the name of a specific input/output channel.
d | the audio device. |
output | true for output channels, false for input channels. |
index | the channel index. |
buffer | the string buffer to receive the channel name. If NULL, *size receives the required buffer size. |
size | the size of the buffer. |
This function copies up to *size characters into *buffer, including the terminating null character.
This function may only be called from the main thread.
void * XtDeviceGetHandle | ( | XtDevice const * | s | ) |
Implementation-defined handle to the backend device.
ASIO: IASIO*
ALSA: NULL
JACK: jack_client_t*
WASAPI: IMMDevice*
PulseAudio: NULL
DirectSound: IDirectSound* / IDirectSoundCapture*
This function may be called from any thread.
Gets the device's current mix format.
d | the audio device. |
valid | on success, *valid will be true if the device's current mix format is known. |
mix | on success, and when the current mix format is known, receives the devices current mix format |
It is NOT an error when a device has no current or default mix format. The mix format may be used as a starting point to query for supported audio formats (see XtDeviceSupportsFormat).
This function may only be called from the main thread.
XtError XtDeviceOpenStream | ( | XtDevice * | d, |
XtDeviceStreamParams const * | params, | ||
void * | user, | ||
XtStream ** | stream | ||
) |
Opens an audio stream on the given device.
d | the audio device. |
params | the stream parameters. |
user | user data passed to the stream callbacks (may be NULL). |
stream | on success, receives a pointer to the opened audio stream. On error, *stream will be NULL. |
The resulting stream must be closed using XtStreamDestroy. When the requested interleaving mode is not supported by the device it will be emulated.
This function may only be called from the main thread.
Show the device specific control panel.
d | the audio device. |
The service must support the device control panel feature (XtServiceCapsControlPanel). This method is currently supported for ASIO devices only.
This function may only be called from the main thread.
Indicates whether the device supports the specified access mode.
d | the audio device. |
interleaved | the desired access mode. True for interleaved, false for non-interleaved. |
supports | on success, indicates whether the access mode is supported. |
When opening a stream using an access mode that is not supported by the device, the access mode will be emulated.
This function may only be called from the main thread.
Indicates whether an audio format is supported by the device.
d | the audio device. |
format | the audio format to test support for. |
supports | on success, indicates whether the format is supported. |
This function may only be called from the main thread.