mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
ucm: unify snd_use_case_geti(), add snd_use_case_card_list() template
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
0ae6c43b86
commit
3a34394508
2 changed files with 34 additions and 8 deletions
|
|
@ -944,8 +944,9 @@ long modifier_status(snd_use_case_mgr_t *uc_mgr,
|
|||
* \param identifier
|
||||
* \return Value if success, otherwise a negative error code
|
||||
*/
|
||||
long snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
|
||||
const char *identifier)
|
||||
int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
|
||||
const char *identifier,
|
||||
long *value)
|
||||
{
|
||||
char *str, *str1;
|
||||
long err;
|
||||
|
|
@ -964,11 +965,19 @@ long snd_use_case_geti(snd_use_case_mgr_t *uc_mgr,
|
|||
} else {
|
||||
str = NULL;
|
||||
}
|
||||
if (check_identifier(identifier, "_devstatus"))
|
||||
if (check_identifier(identifier, "_devstatus")) {
|
||||
err = device_status(uc_mgr, str);
|
||||
else if (check_identifier(identifier, "_modstatus"))
|
||||
if (err >= 0) {
|
||||
*value = err;
|
||||
err = 0;
|
||||
}
|
||||
} else if (check_identifier(identifier, "_modstatus")) {
|
||||
err = modifier_status(uc_mgr, str);
|
||||
else
|
||||
if (err >= 0) {
|
||||
*value = err;
|
||||
err = 0;
|
||||
}
|
||||
} else
|
||||
err = -EINVAL;
|
||||
if (str)
|
||||
free(str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue