diff options
author | parazyd <parazyd@dyne.org> | 2016-12-30 12:16:07 +0100 |
---|---|---|
committer | parazyd <parazyd@dyne.org> | 2016-12-30 12:16:07 +0100 |
commit | 62f40164309cd6f22be9fae89c071221944618e4 (patch) | |
tree | 8dd70436266950dc3b3e98af8c353dc4d738b5c2 /slstatus.c | |
parent | c2808b6d99f30e30b059906e7801cc8a2b76189f (diff) |
add vol_perc notes, add braces to singleline statements
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -628,14 +628,18 @@ vol_perc(const char *card) } ioctl(afd, MIXER_READ(SOUND_MIXER_DEVMASK), &devmask); - for (i = 0; i < (sizeof(vnames) / sizeof((vnames[0]))); i++) - if (devmask & (1 << i)) - if (!strcmp("vol", vnames[i])) + for (i = 0; i < (sizeof(vnames) / sizeof((vnames[0]))); i++) { + if (devmask & (1 << i)) { + if (!strcmp("vol", vnames[i])) { ioctl(afd, MIXER_READ(i), &v); + } + } + } close(afd); - if (v == 0) + if (v == 0) { return smprintf("mute"); + } return smprintf("%d%%", v & 0xff); } |