Lines Matching refs:elem

202 			 snd_hctl_elem_t *elem)
205 return hctl->callback(hctl, mask, elem);
209 static int snd_hctl_elem_throw_event(snd_hctl_elem_t *elem,
212 if (elem->callback)
213 return elem->callback(elem, mask);
346 static int snd_hctl_elem_add(snd_hctl_t *hctl, snd_hctl_elem_t *elem)
350 elem->compare_weight = get_compare_weight(&elem->id);
362 list_add_tail(&elem->list, &hctl->elems);
363 hctl->pelems[0] = elem;
365 idx = _snd_hctl_find_elem(hctl, &elem->id, &dir);
368 list_add(&elem->list, &hctl->pelems[idx]->list);
371 list_add_tail(&elem->list, &hctl->pelems[idx]->list);
376 hctl->pelems[idx] = elem;
379 return snd_hctl_throw_event(hctl, SNDRV_CTL_EVENT_MASK_ADD, elem);
384 snd_hctl_elem_t *elem = hctl->pelems[idx];
386 snd_hctl_elem_throw_event(elem, SNDRV_CTL_EVENT_MASK_REMOVE);
387 list_del(&elem->list);
388 free(elem);
521 * \param elem HCTL element
524 snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem)
526 assert(elem);
527 if (elem->list.next == &elem->hctl->elems)
529 return list_entry(elem->list.next, snd_hctl_elem_t, list);
534 * \param elem HCTL element
537 snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem)
539 assert(elem);
540 if (elem->list.prev == &elem->hctl->elems)
542 return list_entry(elem->list.prev, snd_hctl_elem_t, list);
595 snd_hctl_elem_t *elem;
596 elem = calloc(1, sizeof(snd_hctl_elem_t));
597 if (elem == NULL) {
602 elem->id = list.pids[idx];
603 elem->hctl = hctl;
604 elem->compare_weight = get_compare_weight(&elem->id);
605 hctl->pelems[idx] = elem;
606 list_add_tail(&elem->list, &hctl->elems);
731 snd_hctl_elem_t *elem;
742 if (event->data.elem.mask == SNDRV_CTL_EVENT_MASK_REMOVE) {
744 res = _snd_hctl_find_elem(hctl, &event->data.elem.id, &dir);
750 if (event->data.elem.mask & SNDRV_CTL_EVENT_MASK_ADD) {
751 elem = calloc(1, sizeof(snd_hctl_elem_t));
752 if (elem == NULL)
754 elem->id = event->data.elem.id;
755 elem->hctl = hctl;
756 res = snd_hctl_elem_add(hctl, elem);
760 if (event->data.elem.mask & (SNDRV_CTL_EVENT_MASK_VALUE |
762 elem = snd_hctl_find_elem(hctl, &event->data.elem.id);
763 if (!elem)
765 res = snd_hctl_elem_throw_event(elem, event->data.elem.mask &
801 * \param elem HCTL element
805 int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t *info)
807 assert(elem);
808 assert(elem->hctl);
810 info->id = elem->id;
811 return snd_ctl_elem_info(elem->hctl->ctl, info);
816 * \param elem HCTL element
820 int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
822 assert(elem);
823 assert(elem->hctl);
825 value->id = elem->id;
826 return snd_ctl_elem_read(elem->hctl->ctl, value);
831 * \param elem HCTL element
837 int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value)
839 assert(elem);
840 assert(elem->hctl);
842 value->id = elem->id;
843 return snd_ctl_elem_write(elem->hctl->ctl, value);
848 * \param elem HCTL element
853 int snd_hctl_elem_tlv_read(snd_hctl_elem_t *elem, unsigned int *tlv, unsigned int tlv_size)
855 assert(elem);
858 return snd_ctl_elem_tlv_read(elem->hctl->ctl, &elem->id, tlv, tlv_size);
863 * \param elem HCTL element
869 int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv)
871 assert(elem);
874 return snd_ctl_elem_tlv_write(elem->hctl->ctl, &elem->id, tlv);
879 * \param elem HCTL element
885 int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv)
887 assert(elem);
890 return snd_ctl_elem_tlv_command(elem->hctl->ctl, &elem->id, tlv);
895 * \param elem HCTL element
898 snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem)
900 assert(elem);
901 return elem->hctl;