wmix: allow to choose device and exclude channels from the config file
Because that's the kind of option that could deserve to be saved in the file. A device specified on the command line will take precedence; the list of channel to exclude will be merged. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
parent
67548f3b6a
commit
ccff1cf409
|
@ -288,7 +288,24 @@ void config_read(void)
|
|||
*ptr = '\0';
|
||||
|
||||
/* Check what keyword we have */
|
||||
if (strcmp(keyword, "mousewheel") == 0) {
|
||||
if (strcmp(keyword, "device") == 0) {
|
||||
if (config.mixer_device == default_mixer_device)
|
||||
config.mixer_device = strdup(value);
|
||||
/* If not the default, keep the previous value because it was provided in the command-line */
|
||||
|
||||
} else if (strcmp(keyword, "exclude") == 0) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
|
||||
if (config.exclude_channel[i] == NULL) {
|
||||
config.exclude_channel[i] = strdup(value);
|
||||
break;
|
||||
}
|
||||
|
||||
if (strcmp(value, config.exclude_channel[i]) == 0)
|
||||
break;
|
||||
}
|
||||
} else if (strcmp(keyword, "mousewheel") == 0) {
|
||||
config.mousewheel = atoi(value);
|
||||
|
||||
} else if (strcmp(keyword, "osd") == 0) {
|
||||
|
|
11
wmix/wmix.1x
11
wmix/wmix.1x
|
@ -58,6 +58,15 @@ If readable, the file \fI~/.wmixrc\fP (or the file specified through \fB\-f\fR o
|
|||
is read on startup.
|
||||
It may contains one configuration command per line:
|
||||
.TP
|
||||
device=<\fImixer_device\fP>
|
||||
defines the device file to use instead of \fB/dev/mixer\fP
|
||||
.TP
|
||||
exclude=<\fIchannel_name\fP>
|
||||
exclude the specified channel from control, you can use it as many times as needed (see
|
||||
.SM
|
||||
.B "CHANNEL NAMES"
|
||||
below)
|
||||
.TP
|
||||
mousewheel=<\fI0\fP|\fI1\fP>
|
||||
when set to \fI0\fP, disable the volume control through mouse wheel (default=\fI1\fP)
|
||||
.TP
|
||||
|
@ -127,7 +136,7 @@ volume control
|
|||
.TP
|
||||
.I /dev/mixer
|
||||
Device used for controlling volume (change with option
|
||||
.BR \-m )
|
||||
.BR \-m " or with command " device " in the config file)"
|
||||
.TP
|
||||
.I /usr/share/doc/wmix/README
|
||||
More information on the user interface
|
||||
|
|
Loading…
Reference in a new issue