diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-12-06 14:07:48 +0100 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2010-12-06 14:07:48 +0100 |
commit | 34bb514b5fd1d6f91ba9a7b3a70b0ea0c6014250 (patch) | |
tree | dbe88d759d48fe750ce89766b990993f2e202425 /alsamixer/volume_mapping.h | |
parent | 70a01748d594ef57a1962e4cb012927faf6d852f (diff) | |
download | alsa-utils-34bb514b5fd1d6f91ba9a7b3a70b0ea0c6014250.tar.gz |
alsamixer: use cubic scale for volume bars
Instead of mapping the raw volume values linearly to the screen, use
a mapping where the bar height is proportional to the audible volume,
i.e., where the amplitude is the cube of the bar height.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'alsamixer/volume_mapping.h')
-rw-r--r-- | alsamixer/volume_mapping.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/alsamixer/volume_mapping.h b/alsamixer/volume_mapping.h new file mode 100644 index 0000000..d4251d6 --- /dev/null +++ b/alsamixer/volume_mapping.h @@ -0,0 +1,19 @@ +#ifndef VOLUME_MAPPING_H_INCLUDED +#define VOLUME_MAPPING_H_INCLUDED + +#include <alsa/asoundlib.h> + +double get_normalized_playback_volume(snd_mixer_elem_t *elem, + snd_mixer_selem_channel_id_t channel); +double get_normalized_capture_volume(snd_mixer_elem_t *elem, + snd_mixer_selem_channel_id_t channel); +int set_normalized_playback_volume(snd_mixer_elem_t *elem, + snd_mixer_selem_channel_id_t channel, + double volume, + int dir); +int set_normalized_capture_volume(snd_mixer_elem_t *elem, + snd_mixer_selem_channel_id_t channel, + double volume, + int dir); + +#endif |