diff options
author | Taylor Holberton <taylorcholberton@gmail.com> | 2016-12-01 18:24:44 -0800 |
---|---|---|
committer | Taylor Holberton <taylorcholberton@gmail.com> | 2016-12-01 18:24:44 -0800 |
commit | 7dc7d83ed7305edacdd46a3f4bd9d711c5c4c4ff (patch) | |
tree | 72cce744d670cf7a6c10ef90d03aba47f2512250 /include | |
parent | f3d6c67db4f5eea516d2d4fcbc2edd75f33d48a4 (diff) | |
parent | a94295b6cf85fceb6b06db42b27c88131f1a18b0 (diff) |
Merge branch 'const-correctness' into develop
This merge adds the changes made to the mixer API.
Diffstat (limited to 'include')
-rw-r--r-- | include/tinyalsa/mixer.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index 4de6133..a54b5c1 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -69,9 +69,11 @@ struct mixer *mixer_open(unsigned int card); void mixer_close(struct mixer *mixer); -const char *mixer_get_name(struct mixer *mixer); +const char *mixer_get_name(const struct mixer *mixer); -unsigned int mixer_get_num_ctls(struct mixer *mixer); +unsigned int mixer_get_num_ctls(const struct mixer *mixer); + +const struct mixer_ctl *mixer_get_ctl_const(const struct mixer *mixer, unsigned int id); struct mixer_ctl *mixer_get_ctl(struct mixer *mixer, unsigned int id); @@ -81,17 +83,17 @@ struct mixer_ctl *mixer_get_ctl_by_name_and_index(struct mixer *mixer, const char *name, unsigned int index); -unsigned int mixer_ctl_get_id(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_id(const struct mixer_ctl *ctl); -const char *mixer_ctl_get_name(struct mixer_ctl *ctl); +const char *mixer_ctl_get_name(const struct mixer_ctl *ctl); -enum mixer_ctl_type mixer_ctl_get_type(struct mixer_ctl *ctl); +enum mixer_ctl_type mixer_ctl_get_type(const struct mixer_ctl *ctl); -const char *mixer_ctl_get_type_string(struct mixer_ctl *ctl); +const char *mixer_ctl_get_type_string(const struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_values(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_num_values(const struct mixer_ctl *ctl); -unsigned int mixer_ctl_get_num_enums(struct mixer_ctl *ctl); +unsigned int mixer_ctl_get_num_enums(const struct mixer_ctl *ctl); const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, unsigned int enum_id); @@ -102,13 +104,13 @@ const char *mixer_ctl_get_enum_string(struct mixer_ctl *ctl, unsigned int enum_i void mixer_ctl_update(struct mixer_ctl *ctl); /* Set and get mixer controls */ -int mixer_ctl_get_percent(struct mixer_ctl *ctl, unsigned int id); +int mixer_ctl_get_percent(const struct mixer_ctl *ctl, unsigned int id); int mixer_ctl_set_percent(struct mixer_ctl *ctl, unsigned int id, int percent); -int mixer_ctl_get_value(struct mixer_ctl *ctl, unsigned int id); +int mixer_ctl_get_value(const struct mixer_ctl *ctl, unsigned int id); -int mixer_ctl_get_array(struct mixer_ctl *ctl, void *array, size_t count); +int mixer_ctl_get_array(const struct mixer_ctl *ctl, void *array, size_t count); int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value); @@ -117,9 +119,9 @@ int mixer_ctl_set_array(struct mixer_ctl *ctl, const void *array, size_t count); int mixer_ctl_set_enum_by_string(struct mixer_ctl *ctl, const char *string); /* Determe range of integer mixer controls */ -int mixer_ctl_get_range_min(struct mixer_ctl *ctl); +int mixer_ctl_get_range_min(const struct mixer_ctl *ctl); -int mixer_ctl_get_range_max(struct mixer_ctl *ctl); +int mixer_ctl_get_range_max(const struct mixer_ctl *ctl); #if defined(__cplusplus) } /* extern "C" */ |