add vol_perc notes, add braces to singleline statements
This commit is contained in:
parent
c2808b6d99
commit
62f4016430
3 changed files with 19 additions and 5 deletions
12
slstatus.c
12
slstatus.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue