]> git.alsa-project.org Git - alsa-tools.git/commitdiff
envy24control: Changing the Multi Track Peak control from MIXER to PCM type
authorPavel Hofman <pavel.hofman@ivitera.com>
Tue, 6 Oct 2009 14:00:16 +0000 (16:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 6 Oct 2009 14:46:03 +0000 (16:46 +0200)
* 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@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
envy24control/levelmeters.c

index 3bf1a9453bc6c0133ea5388ac4c4a58c0363b532..fa449797bc308fdd7b1463886547369f1c3e7d0a 100644 (file)
@@ -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)