• Home
  • Raw
  • Download

Lines Matching refs:elem

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