Lines Matching refs:ctl
236 snd_ctl_elem_value_t ctl = {0};
240 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
248 snd_ctl_elem_value_get_integer(&ctl, idx1));
255 snd_ctl_elem_value_t ctl = {0};
259 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
265 if (!snd_ctl_elem_value_get_integer(&ctl, idx1))
273 snd_ctl_elem_value_t ctl = {0};
277 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
283 if (!snd_ctl_elem_value_get_integer(&ctl,
292 snd_ctl_elem_value_t ctl = {0};
306 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
313 snd_ctl_elem_value_get_enumerated(&ctl, idx1);
443 snd_ctl_elem_value_t ctl = {0};
445 err = snd_hctl_elem_read(c->elem, &ctl);
452 if (snd_ctl_elem_value_get_enumerated(&ctl, idx1) !=
469 snd_ctl_elem_value_t ctl = {0};
473 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
476 snd_ctl_elem_value_set_integer(&ctl, idx,
478 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
485 snd_ctl_elem_value_t ctl = {0};
489 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
492 snd_ctl_elem_value_set_integer(&ctl, idx,
494 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
501 snd_ctl_elem_value_t ctl = {0};
505 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
508 snd_ctl_elem_value_set_integer(&ctl, idx, !!val);
509 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
516 snd_ctl_elem_value_t ctl = {0};
520 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
523 snd_ctl_elem_value_set_integer(&ctl, idx, 0);
525 snd_ctl_elem_value_set_integer(&ctl, idx * c->values + idx,
527 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
534 snd_ctl_elem_value_t ctl = {0};
548 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
551 snd_ctl_elem_value_set_enumerated(&ctl, idx,
553 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
630 snd_ctl_elem_value_t ctl = {0};
632 if ((err = snd_hctl_elem_read(c->elem, &ctl)) < 0)
636 snd_ctl_elem_value_set_enumerated(&ctl,
639 if ((err = snd_hctl_elem_write(c->elem, &ctl)) < 0)
676 selem_ctl_t *ctl;
687 ctl = &simple->ctls[CTL_SINGLE];
688 if (ctl->elem) {
689 pchannels = cchannels = ctl->values;
690 if (ctl->type == SND_CTL_ELEM_TYPE_INTEGER) {
692 pmin = cmin = ctl->min;
693 pmax = cmax = ctl->max;
697 ctl = &simple->ctls[CTL_GLOBAL_SWITCH];
698 if (ctl->elem) {
699 if (pchannels < ctl->values)
700 pchannels = ctl->values;
701 if (cchannels < ctl->values)
702 cchannels = ctl->values;
705 ctl = &simple->ctls[CTL_GLOBAL_ROUTE];
706 if (ctl->elem) {
707 if (pchannels < ctl->values)
708 pchannels = ctl->values;
709 if (cchannels < ctl->values)
710 cchannels = ctl->values;
713 ctl = &simple->ctls[CTL_GLOBAL_VOLUME];
714 if (ctl->elem) {
715 if (pchannels < ctl->values)
716 pchannels = ctl->values;
717 if (pmin > ctl->min)
718 pmin = ctl->min;
719 if (pmax < ctl->max)
720 pmax = ctl->max;
721 if (cchannels < ctl->values)
722 cchannels = ctl->values;
723 if (cmin > ctl->min)
724 cmin = ctl->min;
725 if (cmax < ctl->max)
726 cmax = ctl->max;
729 ctl = &simple->ctls[CTL_PLAYBACK_SWITCH];
730 if (ctl->elem) {
731 if (pchannels < ctl->values)
732 pchannels = ctl->values;
736 ctl = &simple->ctls[CTL_PLAYBACK_ROUTE];
737 if (ctl->elem) {
738 if (pchannels < ctl->values)
739 pchannels = ctl->values;
743 ctl = &simple->ctls[CTL_CAPTURE_SWITCH];
744 if (ctl->elem) {
745 if (cchannels < ctl->values)
746 cchannels = ctl->values;
750 ctl = &simple->ctls[CTL_CAPTURE_ROUTE];
751 if (ctl->elem) {
752 if (cchannels < ctl->values)
753 cchannels = ctl->values;
757 ctl = &simple->ctls[CTL_PLAYBACK_VOLUME];
758 if (ctl->elem) {
759 if (pchannels < ctl->values)
760 pchannels = ctl->values;
761 if (pmin > ctl->min)
762 pmin = ctl->min;
763 if (pmax < ctl->max)
764 pmax = ctl->max;
768 ctl = &simple->ctls[CTL_CAPTURE_VOLUME];
769 if (ctl->elem) {
770 if (cchannels < ctl->values)
771 cchannels = ctl->values;
772 if (cmin > ctl->min)
773 cmin = ctl->min;
774 if (cmax < ctl->max)
775 cmax = ctl->max;
779 ctl = &simple->ctls[CTL_CAPTURE_SOURCE];
780 if (ctl->elem) {
781 if (cchannels < ctl->values)
782 cchannels = ctl->values;
786 ctl = &simple->ctls[CTL_GLOBAL_ENUM];
787 if (ctl->elem) {
788 if (pchannels < ctl->values)
789 pchannels = ctl->values;
792 ctl = &simple->ctls[CTL_PLAYBACK_ENUM];
793 if (ctl->elem) {
794 if (pchannels < ctl->values)
795 pchannels = ctl->values;
798 ctl = &simple->ctls[CTL_CAPTURE_ENUM];
799 if (ctl->elem) {
800 if (pchannels < ctl->values)
801 pchannels = ctl->values;
1013 selem_ctl_type_t ctl;
1014 for (ctl = CTL_SINGLE; ctl <= CTL_LAST; ctl++)
1015 if (s->ctls[ctl].elem != NULL && s->ctls[ctl].inactive)
1096 static int init_db_range(snd_hctl_elem_t *ctl, struct selem_str *rec);
1098 static int convert_to_dB(snd_hctl_elem_t *ctl, struct selem_str *rec,
1101 if (init_db_range(ctl, rec) < 0)
1109 static int init_db_range(snd_hctl_elem_t *ctl, struct selem_str *rec)
1122 if (snd_hctl_elem_info(ctl, &info) < 0)
1129 if (snd_hctl_elem_tlv_read(ctl, tlv, tlv_size) < 0)
1169 static int get_dB_range(snd_hctl_elem_t *ctl, struct selem_str *rec,
1172 if (init_db_range(ctl, rec) < 0)
1192 static int convert_from_dB(snd_hctl_elem_t *ctl, struct selem_str *rec,
1195 if (init_db_range(ctl, rec) < 0)
1356 snd_ctl_elem_value_t ctl = {0};
1366 err = snd_hctl_elem_read(helem, &ctl);
1368 *itemp = snd_ctl_elem_value_get_enumerated(&ctl, channel);
1377 snd_ctl_elem_value_t ctl = {0};
1399 err = snd_hctl_elem_read(helem, &ctl);
1403 snd_ctl_elem_value_set_enumerated(&ctl, channel, item);
1404 return snd_hctl_elem_write(helem, &ctl);