Fixes for PCM capture switches...

This commit is contained in:
Jaroslav Kysela 2000-01-11 13:19:03 +00:00
parent f9d81448d8
commit 66c3b06a5a
4 changed files with 17 additions and 17 deletions

View file

@ -60,7 +60,7 @@ rawdata return L_RAWDATA;
pcm return L_PCM; pcm return L_PCM;
rawmidi return L_RAWMIDI; rawmidi return L_RAWMIDI;
playback return L_PLAYBACK; playback return L_PLAYBACK;
record return L_RECORD; capture return L_CAPTURE;
output return L_OUTPUT; output return L_OUTPUT;
input return L_INPUT; input return L_INPUT;
iec958ocs return L_IEC958OCS; iec958ocs return L_IEC958OCS;

View 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_control_switch(char *name);
static void build_mixer_switch(char *name); static void build_mixer_switch(char *name);
static void build_pcm_playback_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_output_switch(char *name);
static void build_rawmidi_input_switch(char *name); static void build_rawmidi_input_switch(char *name);
@ -117,7 +117,7 @@ static unsigned short Xswitchiec958ocs1[16];
%token L_DOUBLE1 %token L_DOUBLE1
/* other keywords */ /* other keywords */
%token L_SOUNDCARD L_MIXER L_ELEMENT L_SWITCH L_RAWDATA %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_SWITCH1 L_SWITCH2 L_SWITCH3 L_VOLUME1 L_3D_EFFECT1 L_ACCU3
%token L_MUX1 L_MUX2 L_TONE_CONTROL1 %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 %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 '}' pcm : L_PLAYBACK '{' playbacks '}'
| L_RECORD '{' records '}' | L_CAPTURE '{' captures '}'
| error { yyerror("an unknown keyword in the pcm{} section"); } | 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"); } | error { yyerror("an unknown keyword in the playback{} section"); }
; ;
records : record captures : capture
| records record | captures capture
; ;
record : L_SWITCH '(' string { build_pcm_record_switch($3); } capture : L_SWITCH '(' string { build_pcm_capture_switch($3); }
',' switches ')' { build_pcm_record_switch(NULL); } ',' switches ')' { build_pcm_capture_switch(NULL); }
| error { yyerror("an unknown keyword in the record{} section"); } | error { yyerror("an unknown keyword in the capture{} section"); }
; ;
rawmidis : rawmidi rawmidis : rawmidi
@ -778,7 +778,7 @@ static void build_pcm_playback_switch(char *name)
build_switch(&Xpcm->pswitches, 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); build_switch(&Xpcm->rswitches, name);
} }

View 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"); soundcard_setup_merge_sw(mixer->switches, rmixer->switches, soundcard->no, mixer->no, "mixer");
} }
for (rpcm = rsoundcard->pcms; rpcm; rpcm = rpcm->next) { 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))) if (!strncmp(pcm->info.name, rpcm->info.name, sizeof(pcm->info.name)))
break; break;
} }
@ -451,7 +451,7 @@ int soundcard_setup_process_switches(int cardno)
} }
} }
} }
if(ctlhandle) { if (ctlhandle) {
snd_ctl_close(ctlhandle); snd_ctl_close(ctlhandle);
ctlhandle = NULL; ctlhandle = NULL;
} }
@ -484,7 +484,7 @@ int soundcard_setup_process_data(int cardno)
mixhandle = NULL; mixhandle = NULL;
} }
} }
if(ctlhandle) { if (ctlhandle) {
snd_ctl_close(ctlhandle); snd_ctl_close(ctlhandle);
ctlhandle = NULL; ctlhandle = NULL;
} }

View file

@ -946,12 +946,12 @@ int soundcard_setup_write(const char *cfgfile, int cardno)
continue; continue;
fprintf(out, " pcm(\"%s\") {\n", pcm->info.name); fprintf(out, " pcm(\"%s\") {\n", pcm->info.name);
if (pcm->pswitches) { if (pcm->pswitches) {
fprintf(out, " playback {"); fprintf(out, " playback {\n");
soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->pswitches); soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->pswitches);
fprintf(out, " }\n"); fprintf(out, " }\n");
} }
if (pcm->rswitches) { if (pcm->rswitches) {
fprintf(out, " capture {"); fprintf(out, " capture {\n");
soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->rswitches); soundcard_setup_write_switches(out, " ", SND_INTERFACE_PCM, &pcm->rswitches);
fprintf(out, " }\n"); fprintf(out, " }\n");
} }
@ -962,12 +962,12 @@ int soundcard_setup_write(const char *cfgfile, int cardno)
continue; continue;
fprintf(out, " rawmidi(\"%s\") {\n", rawmidi->info.name); fprintf(out, " rawmidi(\"%s\") {\n", rawmidi->info.name);
if (rawmidi->oswitches) { if (rawmidi->oswitches) {
fprintf(out, " output {"); fprintf(out, " output {\n");
soundcard_setup_write_switches(out, " ", SND_INTERFACE_RAWMIDI, &rawmidi->oswitches); soundcard_setup_write_switches(out, " ", SND_INTERFACE_RAWMIDI, &rawmidi->oswitches);
fprintf(out, " }\n"); fprintf(out, " }\n");
} }
if (rawmidi->iswitches) { if (rawmidi->iswitches) {
fprintf(out, " input {"); fprintf(out, " input {\n");
soundcard_setup_write_switches(out, " ", SND_INTERFACE_RAWMIDI, &rawmidi->iswitches); soundcard_setup_write_switches(out, " ", SND_INTERFACE_RAWMIDI, &rawmidi->iswitches);
fprintf(out, " }\n"); fprintf(out, " }\n");
} }