]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Changed playback switch handling
authorJaroslav Kysela <perex@perex.cz>
Mon, 28 Aug 2000 17:29:36 +0000 (17:29 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 28 Aug 2000 17:29:36 +0000 (17:29 +0000)
src/mixer/simple.c

index 5cd0f12a430df3187d21e25f6199cf732fc8477e..3a11a0922b8a1a0e5c38843b8c8981343966d7ae 100644 (file)
@@ -370,14 +370,25 @@ static int input_put(snd_mixer_t *handle, mixer_simple_t *simple, snd_mixer_simp
                }
        }
        if (simple->caps & SND_MIXER_SCTCAP_MUTE) {
-               if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH) {
-                       input_put_mute_switch(handle, simple, control, "Playback ", simple->pswitch_values);
-               } else if (simple->present & MIXER_PRESENT_GLOBAL_VOLUME) {
-                       input_put_mute_switch(handle, simple, control, "", simple->pvolume_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 ((control->mute & control->channels) != control->channels) {
+                       if (simple->present & MIXER_PRESENT_PLAYBACK_SWITCH)
+                               input_put_mute_switch(handle, simple, control, "Playback ", simple->pswitch_values);
+                       if (simple->present & MIXER_PRESENT_GLOBAL_VOLUME)
+                               input_put_mute_switch(handle, simple, control, "", simple->pvolume_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 ", simple->pswitch_values);
+                       } else if (simple->present & MIXER_PRESENT_GLOBAL_VOLUME) {
+                               input_put_mute_switch(handle, simple, control, "", simple->pvolume_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->caps & SND_MIXER_SCTCAP_CAPTURE) {