From 66c3b06a5a006c9b5cec5f2914c3f95fc97c3d93 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 11 Jan 2000 13:19:03 +0000 Subject: [PATCH] Fixes for PCM capture switches... --- alsactl/alsactl_lexer.l | 2 +- alsactl/alsactl_parser.y | 18 +++++++++--------- alsactl/merge.c | 6 +++--- alsactl/setup.c | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/alsactl/alsactl_lexer.l b/alsactl/alsactl_lexer.l index 3f0c226..901023b 100644 --- a/alsactl/alsactl_lexer.l +++ b/alsactl/alsactl_lexer.l @@ -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; diff --git a/alsactl/alsactl_parser.y b/alsactl/alsactl_parser.y index fefb461..489f4cb 100644 --- a/alsactl/alsactl_parser.y +++ b/alsactl/alsactl_parser.y @@ -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); } diff --git a/alsactl/merge.c b/alsactl/merge.c index ee6a49f..fa8b40d 100644 --- a/alsactl/merge.c +++ b/alsactl/merge.c @@ -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; } diff --git a/alsactl/setup.c b/alsactl/setup.c index 53d0a12..6094bb0 100644 --- a/alsactl/setup.c +++ b/alsactl/setup.c @@ -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"); }