mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-11-04 13:30:08 -05:00
sound - fix .iface field of mixer control elements
This patch changes .iface to SNDRV_CTL_ELEM_IFACE_MIXER whre _PCM or _HWDEP was used in controls that are not associated with a specific PCM (sub)stream or hwdep device, and changes some controls that got inconsitent .iface values due to copy+paste errors. Furthermore, it makes sure that all control that do use _PCM or _HWDEP use the correct number in the .device field.
This commit is contained in:
parent
2ec6fcc317
commit
7fcbc9917e
11 changed files with 87 additions and 69 deletions
|
|
@ -45,10 +45,7 @@ void spdif_in_cb(Fl_Widget *w, void *arg)
|
|||
snd_ctl_elem_value_alloca(&ctl);
|
||||
snd_ctl_elem_id_alloca(&id);
|
||||
snd_ctl_elem_id_set_name(id, "IEC958 Input Connector");
|
||||
snd_ctl_elem_id_set_numid(id, 0);
|
||||
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_PCM);
|
||||
snd_ctl_elem_id_set_device(id, 0);
|
||||
snd_ctl_elem_id_set_subdevice(id, 0);
|
||||
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_MIXER);
|
||||
snd_ctl_elem_id_set_index(id, 0);
|
||||
snd_ctl_elem_value_set_id(ctl, id);
|
||||
snd_ctl_elem_value_set_enumerated(ctl, 0, in);
|
||||
|
|
@ -57,8 +54,13 @@ void spdif_in_cb(Fl_Widget *w, void *arg)
|
|||
return;
|
||||
}
|
||||
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
|
||||
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
|
||||
return;
|
||||
snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_PCM);
|
||||
snd_ctl_elem_value_set_id(ctl, id);
|
||||
if ((err = snd_ctl_elem_write(handle, ctl)) < 0) {
|
||||
fprintf(stderr, "Error accessing ctl interface on card %s\n", card_name);
|
||||
snd_ctl_close(handle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
snd_ctl_close(handle);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue