diff options
author | Taylor Holberton <taylorcholberton@gmail.com> | 2018-05-08 19:44:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 19:44:27 -0400 |
commit | 67b9210d344c34e8d1aa0cfe638abce71c5221ca (patch) | |
tree | 7b6f8e046a18360fb9adaa4485a16a15d438c5c7 /utils | |
parent | ab216f5225024cfeb3558a89a94bc15465046095 (diff) | |
parent | f8f7ef29b2095621263c748efd7570091d8dcc51 (diff) |
Merge pull request #112 from charleskeepax/master
Minor tweaks to enum controls
Diffstat (limited to 'utils')
-rw-r--r-- | utils/tinymix.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/tinymix.c b/utils/tinymix.c index 53b5285..ff019cd 100644 --- a/utils/tinymix.c +++ b/utils/tinymix.c @@ -168,7 +168,7 @@ static void tinymix_list_controls(struct mixer *mixer, int print_all) num_values = mixer_ctl_get_num_values(ctl); printf("%u\t%s\t%u\t%-40s", i, type, num_values, name); if (print_all) - tinymix_detail_control(mixer, name); + tinymix_detail_control(mixer, name); printf("\n"); } } @@ -177,14 +177,15 @@ static void tinymix_print_enum(struct mixer_ctl *ctl) { unsigned int num_enums; unsigned int i; + unsigned int value; const char *string; num_enums = mixer_ctl_get_num_enums(ctl); + value = mixer_ctl_get_value(ctl, 0); for (i = 0; i < num_enums; i++) { string = mixer_ctl_get_enum_string(ctl, i); - printf("%s%s", mixer_ctl_get_value(ctl, 0) == (int)i ? ", " : "", - string); + printf("%s%s, ", value == i ? "> " : "", string); } } @@ -265,7 +266,7 @@ static void tinymix_detail_control(struct mixer *mixer, const char *control) } static void tinymix_set_byte_ctl(struct mixer_ctl *ctl, - char **values, unsigned int num_values) + char **values, unsigned int num_values) { int ret; char *buf; |