diff options
author | Taylor Holberton <taylorcholberton@gmail.com> | 2016-10-01 19:25:19 -0400 |
---|---|---|
committer | Taylor Holberton <taylorcholberton@gmail.com> | 2016-10-01 19:25:19 -0400 |
commit | 7c8b20a6fec65113df0e2874cfb55cde31c666aa (patch) | |
tree | 9b0b947f1e210a5feb9baa5bc4a599dac10a7b67 | |
parent | 6d58e01d30961c2c84f7f5943695c475370777a1 (diff) |
added some documentation to mixer interface
-rw-r--r-- | include/tinyalsa/mixer.h | 6 | ||||
-rw-r--r-- | src/mixer.c | 19 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index 33ffb38..ae7c118 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -26,6 +26,12 @@ ** DAMAGE. */ +/** @file */ + +/** @defgroup tinyalsa-mixer Mixer Interface + * @brief All macros, structures and functions that make up the mixer interface. + */ + #ifndef TINYALSA_MIXER_H #define TINYALSA_MIXER_H diff --git a/src/mixer.c b/src/mixer.c index ac294ca..cb1d5cb 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -47,19 +47,34 @@ #include <tinyalsa/asoundlib.h> +/** A mixer control. + * @ingroup tinyalsa-mixer + */ struct mixer_ctl { + /** The mixer that the mixer control belongs to */ struct mixer *mixer; struct snd_ctl_elem_info info; char **ename; }; +/** A mixer handle. + * @ingroup tinyalsa-mixer + */ struct mixer { + /** File descriptor for the card */ int fd; + /** Card information */ struct snd_ctl_card_info card_info; + /** A continuous array of mixer controls */ struct mixer_ctl *ctl; + /** The number of mixer controls */ unsigned int count; }; +/** Closes a mixer returned by @ref mixer_open. + * @param mixer A mixer handle. + * @ingroup tinyalsa-mixer + */ void mixer_close(struct mixer *mixer) { unsigned int n,m; @@ -87,6 +102,10 @@ void mixer_close(struct mixer *mixer) /* TODO: verify frees */ } +/** Opens a mixer for a given card. + * @param card The card to open the mixer for. + * @ingroup tinyalsa-mixer + */ struct mixer *mixer_open(unsigned int card) { struct snd_ctl_elem_list elist; |