XT-Audio
Functions
XtDeviceList.h File Reference

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...
 

Detailed Description

Device enumeration and metadata.

Contains functions to enumerate devices and retrieve device names and capabilities.

Function Documentation

void XtDeviceListDestroy ( XtDeviceList l)

Destroys a device list.

Parameters
lthe 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.

Returns
0 on success, a nonzero error code otherwise.
Parameters
lthe device list.
idthe device id.
capabilitieson success, receives the device capabilities.

This function may only be called from the main thread.

See also
XtDeviceListGetId
XtError XtDeviceListGetCount ( XtDeviceList const *  l,
int32_t *  count 
)

Gets the number of devices enumerated.

Returns
0 on success, a nonzero error code otherwise.
Parameters
lthe device list.
counton success, receives the number of devices.

This function may only be called from the main thread.

See also
XtEnumFlags
XtServiceOpenDeviceList
XtError XtDeviceListGetId ( XtDeviceList const *  l,
int32_t  index,
char *  buffer,
int32_t *  size 
)

Gets a device's id.

Returns
0 on success, a nonzero error code otherwise.
Parameters
lthe device list.
indexthe device index.
bufferthe string buffer to receive the device id. If NULL, *size receives the required buffer size.
sizethe 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.

See also
XtDeviceListGetCount
XtServiceOpenDevice
XtServiceGetDefaultDeviceId
XtError XtDeviceListGetName ( XtDeviceList const *  l,
char const *  id,
char *  buffer,
int32_t *  size 
)

Gets a device's name.

Returns
0 on success, a nonzero error code otherwise.
Parameters
lthe device list.
idthe device id.
bufferthe string buffer to receive the device name. If NULL, *size receives the required buffer size.
sizethe 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.

See also
XtDeviceListGetId