Lines Matching refs:path

74     struct mixer_path *path;  member
98 static void path_print(struct audio_route *ar, struct mixer_path *path) in path_print() argument
103 ALOGE("Path: %s, length: %d", path->name, path->length); in path_print()
104 for (i = 0; i < path->length; i++) { in path_print()
105 struct mixer_ctl *ctl = index_to_ctl(ar, path->setting[i].ctl_index); in path_print()
108 for (j = 0; j < path->setting[i].num_values; j++) in path_print()
109 ALOGE(" id=%d value=%d", j, path->setting[i].value[j]); in path_print()
177 static int find_ctl_index_in_path(struct mixer_path *path, in find_ctl_index_in_path() argument
182 for (i = 0; i < path->length; i++) in find_ctl_index_in_path()
183 if (path->setting[i].ctl_index == ctl_index) in find_ctl_index_in_path()
189 static int alloc_path_setting(struct mixer_path *path) in alloc_path_setting() argument
195 if (path->size <= path->length) { in alloc_path_setting()
196 if (path->size == 0) in alloc_path_setting()
197 path->size = INITIAL_MIXER_PATH_SIZE; in alloc_path_setting()
199 path->size *= 2; in alloc_path_setting()
201 new_path_setting = realloc(path->setting, in alloc_path_setting()
202 path->size * sizeof(struct mixer_setting)); in alloc_path_setting()
207 path->setting = new_path_setting; in alloc_path_setting()
211 path_index = path->length; in alloc_path_setting()
212 path->length++; in alloc_path_setting()
217 static int path_add_setting(struct audio_route *ar, struct mixer_path *path, in path_add_setting() argument
222 if (find_ctl_index_in_path(path, setting->ctl_index) != -1) { in path_add_setting()
226 mixer_ctl_get_name(ctl), path->name); in path_add_setting()
230 path_index = alloc_path_setting(path); in path_add_setting()
234 path->setting[path_index].ctl_index = setting->ctl_index; in path_add_setting()
235 path->setting[path_index].num_values = setting->num_values; in path_add_setting()
236 path->setting[path_index].value = malloc(setting->num_values * sizeof(int)); in path_add_setting()
238 memcpy(path->setting[path_index].value, setting->value, in path_add_setting()
244 static int path_add_value(struct audio_route *ar, struct mixer_path *path, in path_add_value() argument
261 path_index = find_ctl_index_in_path(path, mixer_value->ctl_index); in path_add_value()
265 path_index = alloc_path_setting(path); in path_add_value()
270 path->setting[path_index].ctl_index = mixer_value->ctl_index; in path_add_value()
271 path->setting[path_index].num_values = num_values; in path_add_value()
272 path->setting[path_index].value = malloc(num_values * sizeof(int)); in path_add_value()
273 path->setting[path_index].value[0] = mixer_value->value; in path_add_value()
279 path->setting[path_index].value[i] = mixer_value->value; in path_add_value()
282 path->setting[path_index].value[mixer_value->index] = mixer_value->value; in path_add_value()
288 static int path_add_path(struct audio_route *ar, struct mixer_path *path, in path_add_path() argument
294 if (path_add_setting(ar, path, &sub_path->setting[i]) < 0) in path_add_path()
300 static int path_apply(struct audio_route *ar, struct mixer_path *path) in path_apply() argument
307 for (i = 0; i < path->length; i++) { in path_apply()
308 ctl_index = path->setting[i].ctl_index; in path_apply()
315 memcpy(ar->mixer_state[ctl_index].new_value, path->setting[i].value, in path_apply()
316 path->setting[i].num_values * sizeof(int)); in path_apply()
322 static int path_reset(struct audio_route *ar, struct mixer_path *path) in path_reset() argument
330 for (i = 0; i < path->length; i++) { in path_reset()
331 ctl_index = path->setting[i].ctl_index; in path_reset()
393 state->path = path_create(ar, (char *)attr_name); in start_tag()
397 path_add_path(ar, state->path, sub_path); in start_tag()
457 path_add_value(ar, state->path, &mixer_value); in start_tag()
608 struct mixer_path *path; in audio_route_apply_path() local
615 path = path_get_by_name(ar, name); in audio_route_apply_path()
616 if (!path) { in audio_route_apply_path()
621 path_apply(ar, path); in audio_route_apply_path()
629 struct mixer_path *path; in audio_route_reset_path() local
636 path = path_get_by_name(ar, name); in audio_route_reset_path()
637 if (!path) { in audio_route_reset_path()
642 path_reset(ar, path); in audio_route_reset_path()
653 struct mixer_path *path; in audio_route_update_path() local
662 path = path_get_by_name(ar, name); in audio_route_update_path()
663 if (!path) { in audio_route_update_path()
668 i = reverse ? (path->length - 1) : 0; in audio_route_update_path()
669 end = reverse ? -1 : (int32_t)path->length; in audio_route_update_path()
675 ctl_index = path->setting[i].ctl_index; in audio_route_update_path()