From 7656237bb6e6fe676a318e491c60a2337446c722 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 12 Oct 2012 22:00:23 +0200 Subject: Mixer: Provide supported devices Signed-off-by: Paul Kocialkowski --- mixer.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'mixer.c') diff --git a/mixer.c b/mixer.c index 065b939..508fea8 100644 --- a/mixer.c +++ b/mixer.c @@ -777,6 +777,40 @@ int tinyalsa_mixer_set_voice_volume(struct tinyalsa_mixer *mixer, audio_devices_ &mixer->input, "voice-volume"); } +audio_devices_t tinyalsa_mixer_get_supported_devices(struct tinyalsa_mixer *mixer) +{ + struct tinyalsa_mixer_device *mixer_device; + audio_devices_t devices = 0x00; + struct list_head *list; + + LOGD("%s(%p)", __func__, mixer); + + if(mixer == NULL) + return -1; + + list = mixer->output.devices; + while(list != NULL) { + if(list->data != NULL) { + mixer_device = (struct tinyalsa_mixer_device *) list->data; + devices |= mixer_device->props.type; + } + + list = list->next; + } + + list = mixer->input.devices; + while(list != NULL) { + if(list->data != NULL) { + mixer_device = (struct tinyalsa_mixer_device *) list->data; + devices |= mixer_device->props.type; + } + + list = list->next; + } + + return devices; +} + struct tinyalsa_mixer_io_props *tinyalsa_mixer_get_output_props(struct tinyalsa_mixer *mixer) { LOGD("%s(%p)", __func__, mixer); -- cgit v1.1