diff options
author | Abramo Bagnara <abramo@alsa-project.org> | 2001-03-30 09:43:30 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo@alsa-project.org> | 2001-03-30 09:43:30 +0000 |
commit | abcd3a5fb4116de681d6eef1eac2c6b92162038e (patch) | |
tree | 2674da08dff4d215ef6a2f5222a71c082740c358 /alsamixer | |
parent | 98fceb5f56fb2432de7fbc21566de2d53cde553d (diff) |
More documentation. Tiny change for simple mixer element API (get_range)
Diffstat (limited to 'alsamixer')
-rw-r--r-- | alsamixer/alsamixer.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index 476909d..ff76123 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -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; } |