From 86610e5796cdf65b383c7612bc069bbc2c24cebf Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 25 Jul 2022 14:28:52 +0200 Subject: Add support for audio devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test-list.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test-list.c') 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); } -- cgit v1.2.3-70-g09d2