[Pkg-wmaker-commits] [wmix] 29/44: wmix: allow to choose device and exclude channels from the config file

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Sep 29 10:40:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmix.

commit 2d9296227aee188a57c573c0bca3e21329192fff
Author: Christophe CURIS <christophe.curis at free.fr>
Date:   Sat Jun 7 21:21:57 2014 +0200

    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 at free.fr>
---
 config.c | 19 ++++++++++++++++++-
 wmix.1x  | 11 ++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index 0414ea4..7034271 100644
--- a/config.c
+++ b/config.c
@@ -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) {
diff --git a/wmix.1x b/wmix.1x
index 9b6f650..a749fb0 100644
--- a/wmix.1x
+++ b/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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmix.git



More information about the Pkg-wmaker-commits mailing list