mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-08 22:55:42 +01:00
More documentation. Tiny change for simple mixer element API (get_range)
This commit is contained in:
parent
98fceb5f56
commit
abcd3a5fb4
2 changed files with 10 additions and 18 deletions
|
@ -471,8 +471,8 @@ mixer_calc_volume(snd_mixer_elem_t *elem,
|
|||
{
|
||||
int vol1;
|
||||
long v;
|
||||
long min = snd_mixer_selem_get_playback_min(elem);
|
||||
long max = snd_mixer_selem_get_playback_max(elem);
|
||||
long min, max;
|
||||
snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
|
||||
vol1 = (vol < 0) ? -vol : vol;
|
||||
if (vol1 > 0) {
|
||||
if (vol1 > 100)
|
||||
|
@ -645,17 +645,13 @@ mixer_update_cbar (int elem_index)
|
|||
}
|
||||
|
||||
if (snd_mixer_selem_has_playback_volume(elem)) {
|
||||
long vmin, vmax;
|
||||
snd_mixer_selem_get_playback_volume_range(elem, &vmin, &vmax);
|
||||
snd_mixer_selem_get_playback_volume(elem, chn_left, &vleft);
|
||||
vleft = mixer_conv(vleft,
|
||||
snd_mixer_selem_get_playback_min(elem),
|
||||
snd_mixer_selem_get_playback_max(elem),
|
||||
0, 100);
|
||||
vleft = mixer_conv(vleft, vmin, vmax, 0, 100);
|
||||
if (chn_right != SND_MIXER_SCHN_UNKNOWN) {
|
||||
snd_mixer_selem_get_playback_volume(elem, chn_right, &vright);
|
||||
vright = mixer_conv(vright,
|
||||
snd_mixer_selem_get_playback_min(elem),
|
||||
snd_mixer_selem_get_playback_max(elem),
|
||||
0, 100);
|
||||
vright = mixer_conv(vright, vmin, vmax, 0, 100);
|
||||
} else {
|
||||
vright = vleft;
|
||||
}
|
||||
|
|
|
@ -501,19 +501,16 @@ static int show_selem(snd_mixer_t *handle, snd_mixer_selem_id_t *id, const char
|
|||
}
|
||||
if (snd_mixer_selem_has_playback_volume(elem) ||
|
||||
snd_mixer_selem_has_capture_volume(elem)) {
|
||||
cmin = snd_mixer_selem_get_capture_min(elem);
|
||||
cmax = snd_mixer_selem_get_capture_max(elem);
|
||||
printf("%sLimits: ", space);
|
||||
if (snd_mixer_selem_has_playback_volume(elem)) {
|
||||
pmin = snd_mixer_selem_get_playback_min(elem);
|
||||
pmax = snd_mixer_selem_get_playback_max(elem);
|
||||
|
||||
snd_mixer_selem_get_playback_volume_range(elem, &pmin, &pmax);
|
||||
if (!snd_mixer_selem_has_common_volume(elem))
|
||||
printf("Playback ");
|
||||
printf("%li - %li ", pmin, pmax);
|
||||
}
|
||||
if (snd_mixer_selem_has_capture_volume(elem)) {
|
||||
cmin = snd_mixer_selem_get_capture_min(elem);
|
||||
cmax = snd_mixer_selem_get_capture_max(elem);
|
||||
snd_mixer_selem_get_capture_volume_range(elem, &cmin, &cmax);
|
||||
printf("Capture %li - %li", cmin, cmax);
|
||||
}
|
||||
printf("\n");
|
||||
|
@ -921,8 +918,7 @@ static int sset(unsigned int argc, char *argv[], int roflag)
|
|||
snd_mixer_close(handle);
|
||||
return -ENOENT;
|
||||
}
|
||||
min = snd_mixer_selem_get_playback_min(elem);
|
||||
max = snd_mixer_selem_get_playback_max(elem);
|
||||
snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
|
||||
if (roflag)
|
||||
goto __skip_write;
|
||||
for (idx = 1; idx < argc; idx++) {
|
||||
|
|
Loading…
Reference in a new issue