#define HELPID_DEBUG 1005
#define HELPID_VERSION 1006
#define HELPID_NOCHECK 1007
+#define HELPID_ABSTRACT 1008
#define LEVEL_BASIC (1<<0)
#define LEVEL_INACTIVE (1<<1)
int quiet = 0;
int debugflag = 0;
int no_check = 0;
+int smixer_level = 0;
+struct snd_mixer_selem_regopt smixer_options;
char card[64] = "default";
static void error(const char *fmt,...)
printf(" -v,--version print version of this program\n");
printf(" -q,--quiet be quiet\n");
printf(" -i,--inactive show also inactive controls\n");
+ printf(" -a,--abstract L select abstraction level (none or basic)\n");
printf("\nAvailable commands:\n");
printf(" scontrols show all mixer simple controls\n");
printf(" scontents show contents of all mixer simple controls (default command)\n");
snd_mixer_close(mhandle);
return err;
}
- if ((err = snd_mixer_selem_register(mhandle, NULL, NULL)) < 0) {
+ if ((err = snd_mixer_selem_register(mhandle, smixer_level > 0 ? &smixer_options : NULL, NULL)) < 0) {
error("Mixer register error: %s", snd_strerror(err));
snd_mixer_close(mhandle);
return err;
snd_mixer_close(handle);
return err;
}
- if ((err = snd_mixer_selem_register(handle, NULL, NULL)) < 0) {
+ if ((err = snd_mixer_selem_register(handle, smixer_level > 0 ? &smixer_options : NULL, NULL)) < 0) {
error("Mixer register error: %s", snd_strerror(err));
snd_mixer_close(handle);
return err;
snd_mixer_close(handle);
return err;
}
- if ((err = snd_mixer_selem_register(handle, NULL, NULL)) < 0) {
+ if ((err = snd_mixer_selem_register(handle, smixer_level > 0 ? &smixer_options : NULL, NULL)) < 0) {
error("Mixer register error: %s", snd_strerror(err));
snd_mixer_close(handle);
return err;
snd_mixer_close(handle);
return err;
}
- if ((err = snd_mixer_selem_register(handle, NULL, NULL)) < 0) {
+ if ((err = snd_mixer_selem_register(handle, smixer_level > 0 ? &smixer_options : NULL, NULL)) < 0) {
error("Mixer register error: %s", snd_strerror(err));
snd_mixer_close(handle);
return err;
{"debug", 0, NULL, HELPID_DEBUG},
{"nocheck", 0, NULL, HELPID_NOCHECK},
{"version", 0, NULL, HELPID_VERSION},
+ {"abstract", 1, NULL, HELPID_ABSTRACT},
{NULL, 0, NULL, 0},
};
while (1) {
int c;
- if ((c = getopt_long(argc, argv, "hc:D:qidnv", long_option, NULL)) < 0)
+ if ((c = getopt_long(argc, argv, "hc:D:qidnva:", long_option, NULL)) < 0)
break;
switch (c) {
case 'h':
case HELPID_VERSION:
printf("amixer version " SND_UTIL_VERSION_STR "\n");
return 1;
+ case 'a':
+ case HELPID_ABSTRACT:
+ smixer_level = 1;
+ memset(&smixer_options, 0, sizeof(smixer_options));
+ smixer_options.ver = 1;
+ if (!strcmp(optarg, "none"))
+ smixer_options.abstract = SND_MIXER_SABSTRACT_NONE;
+ else if (!strcmp(optarg, "basic"))
+ smixer_options.abstract = SND_MIXER_SABSTRACT_NONE;
+ else {
+ fprintf(stderr, "Select correct abstraction level (none or basic)...\n");
+ morehelp++;
+ }
+ break;
default:
fprintf(stderr, "\07Invalid switch or option needs an argument.\n");
morehelp++;