]> git.alsa-project.org Git - alsa-tools.git/commitdiff
added -c option for easier user. this is equivalent with -Dhw:#
authorTakashi Iwai <tiwai@suse.de>
Tue, 8 Jan 2002 17:22:23 +0000 (17:22 +0000)
committerTakashi Iwai <tiwai@suse.de>
Tue, 8 Jan 2002 17:22:23 +0000 (17:22 +0000)
envy24control/envy24control.1
envy24control/envy24control.c

index 3ff36071ff5ce87dd2cee44a95e22dc0a32c1970..763c6ff7a92b4e36b7e94843da7f8f0e3f9be88f 100644 (file)
@@ -4,7 +4,7 @@ envy24control \- GUI control tool for Envy24 (ice1712) based
 soundcards, under ALSA.
 
 .SH SYNOPSIS
-\fBenvy24control\fP [\fI-D\fP control-name]
+\fBenvy24control\fP [\fI-c\fP card-number] [\fI-D\fP control-name]
 
 .SH DESCRIPTION
 \fBenvy24control\fP allows control of the digital mixer, channel gains
@@ -14,12 +14,16 @@ displays a level meter for each input and output channel.
 
 .SH INVOKING
 
-\fBenvy24control\fP [\fI-D\fP control-name]
+\fBenvy24control\fP [\fI-c\fP card-number] [\fI-D\fP control-name]
 .TP
 If no control-name is given, then the first sound card is used.
 
 .SS Options
 .TP
+\fI-c\fP card-number
+Use the card specified by card-number rather than the first card.
+This is equivalent with \fI-Dhw:n\fP option where \fIn\fP is the card number.
+.TP
 \fI-D\fP control-name
 Use the card specified by control-name rather than the first card,
 normally this will be of the form hw:\fIn\fP where \fIn\fP is the sound
index bc639fcffac6f5036346bbfa853b1d325075fa79..f5ce177e0d0c863079d014e8869f82112c7382a7 100644 (file)
@@ -1144,13 +1144,13 @@ static void create_analog_volume(GtkWidget *main, GtkWidget *notebook, int page)
 
 static void usage(void)
 {
-       fprintf(stderr, "usage: envy24control [-D control-name]\n");
+       fprintf(stderr, "usage: envy24control [-c card#] [-D control-name]\n");
 }
 
 int main(int argc, char **argv)
 {
         GtkWidget *notebook;
-        char *name, title[128];
+        char *name, tmpname[8], title[128];
        int i, c, err;
        snd_ctl_card_info_t *hw_info;
        snd_ctl_elem_value_t *val;
@@ -1159,6 +1159,7 @@ int main(int argc, char **argv)
        int page;
        static struct option long_options[] = {
                {"device", 1, 0, 'D'},
+               {"card", 1, 0, 'c'},
        };
 
        snd_ctl_card_info_alloca(&hw_info);
@@ -1168,8 +1169,17 @@ int main(int argc, char **argv)
         gtk_init(&argc, &argv);
 
        name = "hw:0";
-       while ((c = getopt_long(argc, argv, "D:", long_options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "D:c:", long_options, NULL)) != -1) {
                switch (c) {
+               case 'c':
+                       i = atoi(optarg);
+                       if (i < 0 || i >= 8) {
+                               fprintf(stderr, "envy24control: invalid card number %d\n", i);
+                               exit(1);
+                       }
+                       sprintf(tmpname, "hw:%d", i);
+                       name = tmpname;
+                       break;
                case 'D':
                        name = optarg;
                        break;