Add alsa wrappers to get control values

Change-Id: Ic870261888f35717bfa939029dcd64bfe1a3df33
This commit is contained in:
Amaury Pouly 2017-10-07 21:58:36 +02:00
parent 5af813c5b7
commit 26d18fd348
2 changed files with 63 additions and 14 deletions

View file

@ -31,6 +31,9 @@ void alsa_controls_init(void);
/* close alsa controls */
void alsa_controls_close(void);
/* NOTE: all the following functions panic on error. This behaviour could be changed with the
* functions returning proper values but that would make errors happen silently */
/* find a control element ID by name, return false of not found, the id needs
* to be allocated */
bool alsa_controls_find(snd_ctl_elem_id_t *id, const char *name);
@ -49,5 +52,10 @@ void alsa_controls_set_bool(const char *name, bool val);
void alsa_controls_set_enum(const char *name, const char *enum_name);
/* helper function: set a control with one or more integers */
void alsa_controls_set_ints(const char *name, int count, long *val);
/* get a control value, potentially supports several values */
void alsa_controls_get(const char *name, snd_ctl_elem_type_t type,
unsigned nr_values, long *val);
/* helper function: set a control with a single boolean value */
bool alsa_controls_get_bool(const char *name);
#endif /* __ALSA_CONTROLS_RB_H__ */