From 7db1464a2de498170eb566bd5fe8c758126242f0 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 6 Sep 2000 09:25:50 +0000 Subject: [PATCH] More fixes for typos and mute problems.. --- src/mixer/simple.c | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/mixer/simple.c b/src/mixer/simple.c index c0b36f51..8712066b 100644 --- a/src/mixer/simple.c +++ b/src/mixer/simple.c @@ -252,7 +252,7 @@ static int input_get(snd_mixer_t *handle, mixer_simple_t *simple, snd_mixer_simp if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH) { input_get_mute_switch(handle, simple, control, " Playback", " Switch", simple->pswitch_values); } else if (simple->present & MIXER_PRESENT_GLOBAL_SWITCH) { - input_get_mute_switch(handle, simple, control, "", " Switch", simple->pvolume_values); + input_get_mute_switch(handle, simple, control, "", " Switch", simple->gswitch_values); } else if (simple->present & MIXER_PRESENT_SINGLE_SWITCH) { input_get_mute_switch(handle, simple, control, "", "", simple->global_values); } else if (simple->present & MIXER_PRESENT_PLAYBACK_ROUTE) { @@ -307,7 +307,6 @@ static int input_put_mute_switch(snd_mixer_t *handle, mixer_simple_t *simple, sn return err; for (idx = 0; idx < voices && idx < 32; idx++) ctl.value.integer.value[idx] = (control->mute & (1 << idx)) ? 0 : 1; - err = put_mixer_write(handle, str, simple->sid.index, &ctl); if ((err = put_mixer_write(handle, str, simple->sid.index, &ctl)) < 0) return err; return 0; @@ -326,7 +325,6 @@ static int input_put_mute_route(snd_mixer_t *handle, mixer_simple_t *simple, snd ctl.value.integer.value[idx] = 0; for (idx = 0; idx < voices && idx < 32; idx++) ctl.value.integer.value[(idx * voices) + idx] = (control->mute & (1 << idx)) ? 0 : 1; - err = put_mixer_write(handle, str, simple->sid.index, &ctl); if ((err = put_mixer_write(handle, str, simple->sid.index, &ctl)) < 0) return err; return 0; @@ -385,30 +383,16 @@ static int input_put(snd_mixer_t *handle, mixer_simple_t *simple, snd_mixer_simp } } if (simple->caps & SND_MIXER_SCTCAP_MUTE) { - if ((control->mute & control->channels) != control->channels) { - if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH) - input_put_mute_switch(handle, simple, control, " Playback", " Switch", simple->pswitch_values); - if (simple->present & MIXER_PRESENT_GLOBAL_SWITCH) - input_put_mute_switch(handle, simple, control, "", " Switch", simple->pvolume_values); - if (simple->present & MIXER_PRESENT_SINGLE_SWITCH) - input_put_mute_switch(handle, simple, control, "", "", simple->global_values); - if (simple->present & MIXER_PRESENT_PLAYBACK_ROUTE) - input_put_mute_route(handle, simple, control, "Playback ", simple->proute_values); - if (simple->present & MIXER_PRESENT_GLOBAL_ROUTE) - input_put_mute_route(handle, simple, control, "", simple->groute_values); - } else { - if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH) { - input_put_mute_switch(handle, simple, control, "Playback ", " Switch", simple->pswitch_values); - } else if (simple->present & MIXER_PRESENT_GLOBAL_SWITCH) { - input_put_mute_switch(handle, simple, control, "", " Switch", simple->pvolume_values); - } else if (simple->present & MIXER_PRESENT_SINGLE_SWITCH) { - input_put_mute_switch(handle, simple, control, "", "", simple->global_values); - } else if (simple->present & MIXER_PRESENT_PLAYBACK_ROUTE) { - input_put_mute_route(handle, simple, control, "Playback ", simple->proute_values); - } else if (simple->present & MIXER_PRESENT_GLOBAL_ROUTE) { - input_put_mute_route(handle, simple, control, "", simple->groute_values); - } - } + if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH) + input_put_mute_switch(handle, simple, control, " Playback", " Switch", simple->pswitch_values); + if (simple->present & MIXER_PRESENT_GLOBAL_SWITCH) + input_put_mute_switch(handle, simple, control, "", " Switch", simple->gswitch_values); + if (simple->present & MIXER_PRESENT_SINGLE_SWITCH) + input_put_mute_switch(handle, simple, control, "", "", simple->global_values); + if (simple->present & MIXER_PRESENT_PLAYBACK_ROUTE) + input_put_mute_route(handle, simple, control, "Playback ", simple->proute_values); + if (simple->present & MIXER_PRESENT_GLOBAL_ROUTE) + input_put_mute_route(handle, simple, control, "", simple->groute_values); } if (simple->caps & SND_MIXER_SCTCAP_CAPTURE) { // fprintf(stderr, "capture: present = 0x%x\n", simple->present); -- 2.47.1