aboutsummaryrefslogtreecommitdiffstats
path: root/test-list.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-07-25 14:28:52 +0200
committerMattias Andrée <maandree@kth.se>2022-07-25 14:28:52 +0200
commit86610e5796cdf65b383c7612bc069bbc2c24cebf (patch)
tree292c7c9eb172adecef439f6740a7c7e27a4c8111 /test-list.c
parentlibgamepad_open_superdevice.c: do not change errno on success (diff)
downloadlibgamepad-86610e5796cdf65b383c7612bc069bbc2c24cebf.tar.gz
libgamepad-86610e5796cdf65b383c7612bc069bbc2c24cebf.tar.bz2
libgamepad-86610e5796cdf65b383c7612bc069bbc2c24cebf.tar.xz
Add support for audio devices
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test-list.c')
-rw-r--r--test-list.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/test-list.c b/test-list.c
index f604dd9..51ef13b 100644
--- a/test-list.c
+++ b/test-list.c
@@ -9,7 +9,8 @@ int
main(void)
{
char **devices;
- size_t ndevices, i, j;
+ size_t ndevices, i, j, *sound_cards;
+ ssize_t nsound_cards;
struct libgamepad_superdevice device;
if (libgamepad_list_superdevices(&devices, &ndevices)) {
@@ -32,6 +33,14 @@ main(void)
printf("\t%s (LED)\n", device.leds[j]);
for (j = 0; j < device.npower_supplies; j++)
printf("\t%s (PSU)\n", device.power_supplies[j]);
+ nsound_cards = libgamepad_find_sound_devices(device.syspath, &sound_cards);
+ if (nsound_cards < 0) {
+ perror("libgamepad_find_sound_devices");
+ } else {
+ for (j = 0; j < (size_t)nsound_cards; j++)
+ printf("\t%zu (SND)\n", sound_cards[j]);
+ free(sound_cards);
+ }
libgamepad_close_superdevice(&device);
}