• Home
  • Raw
  • Download

Lines Matching full:path

95      parsed values are updated to either setting value within a path,
121 struct mixer_path *path; member
160 /* path functions */
201 static void path_print(struct audio_route *ar, struct mixer_path *path)
206 ALOGE("Path: %s, length: %d", path->name, path->length);
207 for (i = 0; i < path->length; i++) {
208 struct mixer_ctl *ctl = index_to_ctl(ar, path->setting[i].ctl_index);
212 for (j = 0; j < path->setting[i].num_values; j++)
213 ALOGE(" id=%d value=0x%02x", j, path->setting[i].value.bytes[j]);
215 for (j = 0; j < path->setting[i].num_values; j++)
216 ALOGE(" id=%d value=%d", j, path->setting[i].value.enumerated[j]);
218 for (j = 0; j < path->setting[i].num_values; j++)
219 ALOGE(" id=%d value=%ld", j, path->setting[i].value.integer[j]);
265 ALOGW("Path name '%s' already exists", name); in path_create()
286 /* initialise the new mixer path */ in path_create()
292 /* return the mixer path just added, then increment number of them */ in path_create()
296 static int find_ctl_index_in_path(struct mixer_path *path, in find_ctl_index_in_path() argument
301 for (i = 0; i < path->length; i++) in find_ctl_index_in_path()
302 if (path->setting[i].ctl_index == ctl_index) in find_ctl_index_in_path()
308 static int alloc_path_setting(struct mixer_path *path) in alloc_path_setting() argument
313 /* check if we need to allocate more space for path settings */ in alloc_path_setting()
314 if (path->size <= path->length) { in alloc_path_setting()
315 if (path->size == 0) in alloc_path_setting()
316 path->size = INITIAL_MIXER_PATH_SIZE; in alloc_path_setting()
318 path->size *= 2; in alloc_path_setting()
320 new_path_setting = realloc(path->setting, in alloc_path_setting()
321 path->size * sizeof(struct mixer_setting)); in alloc_path_setting()
323 ALOGE("Unable to allocate more path settings"); in alloc_path_setting()
326 path->setting = new_path_setting; in alloc_path_setting()
330 path_index = path->length; in alloc_path_setting()
331 path->length++; in alloc_path_setting()
336 static int path_add_setting(struct audio_route *ar, struct mixer_path *path, in path_add_setting() argument
342 if (find_ctl_index_in_path(path, setting->ctl_index) != -1) { in path_add_setting()
345 ALOGW("Control '%s' already exists in path '%s' - Ignore one in the new sub path", in path_add_setting()
346 mixer_ctl_get_name(ctl), path->name); in path_add_setting()
355 path_index = alloc_path_setting(path); in path_add_setting()
359 path->setting[path_index].ctl_index = setting->ctl_index; in path_add_setting()
360 path->setting[path_index].type = setting->type; in path_add_setting()
361 path->setting[path_index].num_values = setting->num_values; in path_add_setting()
363 rc = ctl_values_alloc(&path->setting[path_index].value, setting->num_values, setting->type); in path_add_setting()
365 ALOGE("failed to allocate mem for path setting"); in path_add_setting()
369 ctl_values_copy(&path->setting[path_index].value, &setting->value); in path_add_setting()
374 static int path_add_value(struct audio_route *ar, struct mixer_path *path, in path_add_value() argument
392 path_index = find_ctl_index_in_path(path, mixer_value->ctl_index); in path_add_value()
394 /* New path */ in path_add_value()
401 path_index = alloc_path_setting(path); in path_add_value()
405 /* initialise the new path setting */ in path_add_value()
406 path->setting[path_index].ctl_index = mixer_value->ctl_index; in path_add_value()
407 path->setting[path_index].num_values = num_values; in path_add_value()
408 path->setting[path_index].type = type; in path_add_value()
410 rc = ctl_values_alloc(&path->setting[path_index].value, num_values, type); in path_add_value()
412 ALOGE("failed to allocate mem for path setting"); in path_add_value()
415 if (path->setting[path_index].type == MIXER_CTL_TYPE_BYTE) in path_add_value()
416 path->setting[path_index].value.bytes[0] = mixer_value->value; in path_add_value()
417 else if (path->setting[path_index].type == MIXER_CTL_TYPE_ENUM) in path_add_value()
418 path->setting[path_index].value.enumerated[0] = mixer_value->value; in path_add_value()
420 path->setting[path_index].value.integer[0] = mixer_value->value; in path_add_value()
425 if (path->setting[path_index].type == MIXER_CTL_TYPE_BYTE) { in path_add_value()
428 path->setting[path_index].value.bytes[i] = mixer_value->values[i]; in path_add_value()
429 path->setting[path_index].value.byte_size = mixer_value->num_values_in_array; in path_add_value()
430 } else if (path->setting[path_index].type == MIXER_CTL_TYPE_INT) { in path_add_value()
432 path->setting[path_index].value.integer[i] = mixer_value->values[i]; in path_add_value()
433 } else if (path->setting[path_index].type == MIXER_CTL_TYPE_ENUM) { in path_add_value()
435 path->setting[path_index].value.enumerated[i] = mixer_value->value; in path_add_value()
438 path->setting[path_index].value.integer[i] = mixer_value->value; in path_add_value()
442 if (path->setting[path_index].type == MIXER_CTL_TYPE_BYTE) in path_add_value()
443 path->setting[path_index].value.bytes[mixer_value->index] = mixer_value->value; in path_add_value()
444 else if (path->setting[path_index].type == MIXER_CTL_TYPE_ENUM) in path_add_value()
445 path->setting[path_index].value.enumerated[mixer_value->index] = mixer_value->value; in path_add_value()
447 path->setting[path_index].value.integer[mixer_value->index] = mixer_value->value; in path_add_value()
453 static int path_add_path(struct audio_route *ar, struct mixer_path *path, in path_add_path() argument
459 int retVal = path_add_setting(ar, path, &sub_path->setting[i]); in path_add_path()
470 static int path_apply(struct audio_route *ar, struct mixer_path *path) in path_apply() argument
477 ALOGD("Apply path: %s", path->name != NULL ? path->name : "none"); in path_apply()
478 for (i = 0; i < path->length; i++) { in path_apply()
479 ctl_index = path->setting[i].ctl_index; in path_apply()
484 ctl_values_copy(&ar->mixer_state[ctl_index].new_value, &path->setting[i].value); in path_apply()
490 static int path_reset(struct audio_route *ar, struct mixer_path *path) in path_reset() argument
497 ALOGV("Reset path: %s", path->name != NULL ? path->name : "none"); in path_reset()
498 for (i = 0; i < path->length; i++) { in path_reset()
499 ctl_index = path->setting[i].ctl_index; in path_reset()
642 } else if (strcmp(tag_name, "path") == 0) { in start_tag()
644 ALOGE("Unnamed path!"); in start_tag()
647 /* top level path: create and stash the path */ in start_tag()
648 state->path = path_create(ar, (char *)attr_name); in start_tag()
649 if (state->path == NULL) in start_tag()
650 ALOGW("path creation failed, please check if the path exists"); in start_tag()
652 /* nested path */ in start_tag()
655 ALOGW("unable to find sub path '%s'", attr_name); in start_tag()
656 } else if (state->path != NULL) { in start_tag()
657 path_add_path(ar, state->path, sub_path); in start_tag()
795 /* nested ctl (within a path) */ in start_tag()
809 if (state->path != NULL) in start_tag()
810 path_add_value(ar, state->path, &mixer_value); in start_tag()
985 /* Apply an audio route path by name */
988 struct mixer_path *path; in audio_route_apply_path() local
995 path = path_get_by_name(ar, name); in audio_route_apply_path()
996 if (!path) { in audio_route_apply_path()
997 ALOGE("unable to find path '%s'", name); in audio_route_apply_path()
1001 path_apply(ar, path); in audio_route_apply_path()
1006 /* Reset an audio route path by name */
1009 struct mixer_path *path; in audio_route_reset_path() local
1016 path = path_get_by_name(ar, name); in audio_route_reset_path()
1017 if (!path) { in audio_route_reset_path()
1018 ALOGE("unable to find path '%s'", name); in audio_route_reset_path()
1022 path_reset(ar, path); in audio_route_reset_path()
1028 * Operates on the specified path .. controls will be updated in the
1033 struct mixer_path *path; in audio_route_update_path() local
1043 path = path_get_by_name(ar, name); in audio_route_update_path()
1044 if (!path) { in audio_route_update_path()
1045 ALOGE("unable to find path '%s'", name); in audio_route_update_path()
1049 for (size_t i = 0; i < path->length; ++i) { in audio_route_update_path()
1053 ctl_index = path->setting[reverse ? path->length - 1 - i : i].ctl_index; in audio_route_update_path()
1066 ALOGD("%s: skip to reset mixer control '%s' in path '%s' " in audio_route_update_path()
1143 /* use the default XML path if none is provided */ in audio_route_init()