[alsa-devel] [PATCH 1/1] Changing the Multi Track Peak control from MIXER to PCM type

pavel.hofman at ivitera.com pavel.hofman at ivitera.com
Tue Oct 6 16:00:16 CEST 2009


From: Pavel Hofman <pavel.hofman at ivitera.com>

* The "Multi Track Peak" control is now of PCM type, to avoid
  confusing users in other alsa mixers.

Signed-off-by: Pavel Hofman <pavel.hofman at ivitera.com>

diff --git a/envy24control/levelmeters.c b/envy24control/levelmeters.c
index 3bf1a94..fa44979 100644
--- a/envy24control/levelmeters.c
+++ b/envy24control/levelmeters.c
@@ -261,9 +261,15 @@ void level_meters_reset_peaks(GtkButton *button, gpointer data)
 
 void level_meters_init(void)
 {
+	int err;
+
 	snd_ctl_elem_value_malloc(&peaks);
-	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_MIXER);
+	snd_ctl_elem_value_set_interface(peaks, SND_CTL_ELEM_IFACE_PCM);
 	snd_ctl_elem_value_set_name(peaks, "Multi Track Peak");
+	if ((err = snd_ctl_elem_read(ctl, peaks)) < 0)
+		/* older ALSA driver, using MIXER type */
+		snd_ctl_elem_value_set_interface(peaks,
+			SND_CTL_ELEM_IFACE_MIXER);
 }
 
 void level_meters_postinit(void)
-- 
1.5.4.3



More information about the Alsa-devel mailing list