At Fri, 9 Mar 2012 12:19:03 +0000, Alan Horstmann wrote:
On Friday 09 March 2012 11:33, Takashi Iwai wrote:
The implementation isn't too hard. I wrote a quick patch now as below. It became bigger than I thought since it contains many clean-ups that are needed to adapt the mapped volume.
With the patch, amixer shows and reads the percent value with -M option just like in alsamixer.
<snip>
--- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -29,7 +29,9 @@ #include <assert.h> #include <alsa/asoundlib.h> #include <sys/poll.h> +#include <stdint.h> #include "amixer.h" +#include "../alsamixer/volume_mapping.h"
#define LEVEL_BASIC (1<<0) #define LEVEL_INACTIVE (1<<1) @@ -68,6 +70,8 @@ static int help(void) printf(" -i,--inactive show also inactive controls\n"); printf(" -a,--abstract L select abstraction level (none or basic)\n"); printf(" -s,--stdin Read and execute commands from stdin sequentially\n");
- printf(" -R,--raw-volume Use the raw value
(default)\n");
- printf(" -M,--mapped-volume Use the mapped volume\n");
A small comment... What if both -R and -M are used? Isn't -R equivalent to the absence of -M?
The option set later wins.
Takashi