XT-Audio
|
Device enumeration and metadata. More...
Go to the source code of this file.
Functions | |
void | XtDeviceListDestroy (XtDeviceList *l) |
Destroys a device list. More... | |
XtError | XtDeviceListGetCount (XtDeviceList const *l, int32_t *count) |
Gets the number of devices enumerated. More... | |
XtError | XtDeviceListGetId (XtDeviceList const *l, int32_t index, char *buffer, int32_t *size) |
Gets a device's id. More... | |
XtError | XtDeviceListGetName (XtDeviceList const *l, char const *id, char *buffer, int32_t *size) |
Gets a device's name. More... | |
XtError | XtDeviceListGetCapabilities (XtDeviceList const *l, char const *id, XtDeviceCaps *capabilities) |
Gets a device's capabilities. More... | |
Device enumeration and metadata.
Contains functions to enumerate devices and retrieve device names and capabilities.
void XtDeviceListDestroy | ( | XtDeviceList * | l | ) |
Destroys a device list.
l | the device list. |
It is ok to pass NULL.
This function may only be called from the main thread.
XtError XtDeviceListGetCapabilities | ( | XtDeviceList const * | l, |
char const * | id, | ||
XtDeviceCaps * | capabilities | ||
) |
Gets a device's capabilities.
l | the device list. |
id | the device id. |
capabilities | on success, receives the device capabilities. |
This function may only be called from the main thread.
XtError XtDeviceListGetCount | ( | XtDeviceList const * | l, |
int32_t * | count | ||
) |
Gets the number of devices enumerated.
l | the device list. |
count | on success, receives the number of devices. |
This function may only be called from the main thread.
XtError XtDeviceListGetId | ( | XtDeviceList const * | l, |
int32_t | index, | ||
char * | buffer, | ||
int32_t * | size | ||
) |
Gets a device's id.
l | the device list. |
index | the device index. |
buffer | the string buffer to receive the device id. If NULL, *size receives the required buffer size. |
size | the size of the buffer. |
The device id is stable and suitable to store between application sessions, for example to remember the user-selected device. Note that the device id is generated by XT-Audio based on the backend's device information, but may not correspond directly to a backend-specific device id (such as IAudioClient's id for WASAPI or ALSA's snd_device_name_hint). The identifier should be treated as opaque by the application and is only meaningful for use with other device list functions and XtServiceOpenDevice.
This function copies up to *size characters into *buffer, including the terminating null character.
This function may only be called from the main thread.
XtError XtDeviceListGetName | ( | XtDeviceList const * | l, |
char const * | id, | ||
char * | buffer, | ||
int32_t * | size | ||
) |
Gets a device's name.
l | the device list. |
id | the device id. |
buffer | the string buffer to receive the device 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.