]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fixes for PCM capture switches...
authorJaroslav Kysela <perex@perex.cz>
Tue, 11 Jan 2000 13:19:03 +0000 (13:19 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 11 Jan 2000 13:19:03 +0000 (13:19 +0000)
alsactl/alsactl_lexer.l
alsactl/alsactl_parser.y
alsactl/merge.c
alsactl/setup.c

index 3f0c226bd138e556f0b1dacde52eba067b15f085..901023bfcadb68776f35cf5e54224daff019729b 100644 (file)
@@ -60,7 +60,7 @@ rawdata                       return L_RAWDATA;
 pcm                    return L_PCM;
 rawmidi                        return L_RAWMIDI;
 playback               return L_PLAYBACK;
-record                 return L_RECORD;
+capture                        return L_CAPTURE;
 output                 return L_OUTPUT;
 input                  return L_INPUT;
 iec958ocs              return L_IEC958OCS;
index fefb461e2b176a1f6bfa07d7d0c9bf1a30e556e9..489f4cb8eec67086e45f6dbf252d602bf459c384 100644 (file)
@@ -53,7 +53,7 @@ static void build_mixer_element(char *name, int index, int etype);
 static void build_control_switch(char *name);
 static void build_mixer_switch(char *name);
 static void build_pcm_playback_switch(char *name);
-static void build_pcm_record_switch(char *name);
+static void build_pcm_capture_switch(char *name);
 static void build_rawmidi_output_switch(char *name);
 static void build_rawmidi_input_switch(char *name);
 
@@ -117,7 +117,7 @@ static unsigned short Xswitchiec958ocs1[16];
 %token L_DOUBLE1
        /* other keywords */
 %token L_SOUNDCARD L_MIXER L_ELEMENT L_SWITCH L_RAWDATA
-%token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_RECORD L_INPUT L_OUTPUT
+%token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_CAPTURE L_INPUT L_OUTPUT
 %token L_SWITCH1 L_SWITCH2 L_SWITCH3 L_VOLUME1 L_3D_EFFECT1 L_ACCU3
 %token L_MUX1 L_MUX2 L_TONE_CONTROL1
 %token L_IEC958OCS L_3D L_RESET L_USER L_VALID L_DATA L_PROTECT L_PRE2
@@ -288,7 +288,7 @@ pcms        : pcm
        ;
 
 pcm    : L_PLAYBACK '{' playbacks '}'
-       | L_RECORD '{' records '}'
+       | L_CAPTURE '{' captures '}'
        | error                 { yyerror("an unknown keyword in the pcm{} section"); }
        ;
 
@@ -301,13 +301,13 @@ playback : L_SWITCH '(' string    { build_pcm_playback_switch($3); }
        | error                 { yyerror("an unknown keyword in the playback{} section"); }
        ;
 
-records : record
-       | records record
+captures : capture
+       | captures capture
        ;
 
-record : L_SWITCH '(' string   { build_pcm_record_switch($3); }
-         ',' switches ')'      { build_pcm_record_switch(NULL); }
-       | error                 { yyerror("an unknown keyword in the record{} section"); }
+capture        : L_SWITCH '(' string   { build_pcm_capture_switch($3); }
+         ',' switches ')'      { build_pcm_capture_switch(NULL); }
+       | error                 { yyerror("an unknown keyword in the capture{} section"); }
        ;
 
 rawmidis : rawmidi
@@ -778,7 +778,7 @@ static void build_pcm_playback_switch(char *name)
        build_switch(&Xpcm->pswitches, name);
 }
 
-static void build_pcm_record_switch(char *name)
+static void build_pcm_capture_switch(char *name)
 { 
        build_switch(&Xpcm->rswitches, name);
 }
index ee6a49ffab88a1a575d9b01f180ba76e193cde0e..fa8b40d894ba971975b9bd6769f18b9a25a60ba8 100644 (file)
@@ -154,7 +154,7 @@ int soundcard_setup_merge_switches(int cardno)
                        soundcard_setup_merge_sw(mixer->switches, rmixer->switches, soundcard->no, mixer->no, "mixer");
                }
                for (rpcm = rsoundcard->pcms; rpcm; rpcm = rpcm->next) {
-                       for (pcm = rsoundcard->pcms; pcm; pcm = pcm->next) {
+                       for (pcm = soundcard->pcms; pcm; pcm = pcm->next) {
                                if (!strncmp(pcm->info.name, rpcm->info.name, sizeof(pcm->info.name)))
                                        break;
                        }
@@ -451,7 +451,7 @@ int soundcard_setup_process_switches(int cardno)
                                        }
                        }
                }
-               if(ctlhandle) {
+               if (ctlhandle) {
                        snd_ctl_close(ctlhandle);
                        ctlhandle = NULL;
                }
@@ -484,7 +484,7 @@ int soundcard_setup_process_data(int cardno)
                                mixhandle = NULL;
                        }
                }
-               if(ctlhandle) {
+               if (ctlhandle) {
                        snd_ctl_close(ctlhandle);
                        ctlhandle = NULL;
                }
index 53d0a12d6c8fe9c15e908f1f0bf6b56b8cd3c56a..6094bb08e8cbca31617ae092f1f6f9ad41b36a81 100644 (file)
@@ -946,12 +946,12 @@ int soundcard_setup_write(const char *cfgfile, int cardno)
                                continue;
                        fprintf(out, "  pcm(\"%s\") {\n", pcm->info.name);
                        if (pcm->pswitches) {
-                               fprintf(out, "    playback {");
+                               fprintf(out, "    playback {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_PCM, &pcm->pswitches);
                                fprintf(out, "    }\n");
                        }
                        if (pcm->rswitches) {
-                               fprintf(out, "    capture {");
+                               fprintf(out, "    capture {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_PCM, &pcm->rswitches);
                                fprintf(out, "    }\n");
                        }
@@ -962,12 +962,12 @@ int soundcard_setup_write(const char *cfgfile, int cardno)
                                continue;
                        fprintf(out, "  rawmidi(\"%s\") {\n", rawmidi->info.name);
                        if (rawmidi->oswitches) {
-                               fprintf(out, "    output {");
+                               fprintf(out, "    output {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_RAWMIDI, &rawmidi->oswitches);
                                fprintf(out, "    }\n");
                        }
                        if (rawmidi->iswitches) {
-                               fprintf(out, "    input {");
+                               fprintf(out, "    input {\n");
                                soundcard_setup_write_switches(out, "      ", SND_INTERFACE_RAWMIDI, &rawmidi->iswitches);
                                fprintf(out, "    }\n");
                        }