}
static void node_list_callback(pa_context *c,
- const pa_ext_node_manager_info *info,
- int eol,
- void *userdata) {
+ const pa_ext_node_manager_info *info,
+ int eol,
+ void *userdata) {
if (!eol) {
- const char *node_id = pa_proplist_gets(info->props, "index");
- if (node_id != NULL) {
- printf("Node #%s (%s)\n", node_id, info->name);
- printf("%s\n", pa_proplist_to_string(info->props));
- }
+ const char *node_id = pa_proplist_gets(info->props, "index");
+ if (node_id != NULL) {
+ printf("Node #%s (%s)\n", node_id, info->name);
+ printf("%s\n", pa_proplist_to_string(info->props));
+ }
} else
- complete_action();
+ complete_action();
}
static void node_connect_callback(pa_context *c,
- uint32_t conne_id,
- void *userdata) {
+ uint32_t conne_id,
+ void *userdata) {
printf("New connection id: %d\n", conne_id);
o = pa_context_get_sample_info_list(c, get_sample_info_callback, NULL);
else if (pa_streq(list_type, "cards"))
o = pa_context_get_card_info_list(c, get_card_info_callback, NULL);
- else if (pa_streq(list_type, "nodes"))
- o = pa_ext_node_manager_read_nodes(c, node_list_callback, NULL);
+ else if (pa_streq(list_type, "nodes"))
+ o = pa_ext_node_manager_read_nodes(c, node_list_callback, NULL);
else if (pa_streq(list_type, "volume-controls")
|| pa_streq(list_type, "mute-controls")
|| pa_streq(list_type, "devices")
connect_to_volume_api();
break;
- case NODE_CONNECT:
- pa_operation_unref(pa_ext_node_manager_connect_nodes(c,
- src_node_id,
- dst_node_id,
- node_connect_callback,
- NULL));
- break;
- case NODE_DISCONNECT:
- pa_operation_unref(pa_ext_node_manager_disconnect_nodes(c, conn_id,
- simple_callback,
- NULL));
- break;
+
+ case NODE_CONNECT:
+ pa_operation_unref(pa_ext_node_manager_connect_nodes(c,
+ src_node_id,
+ dst_node_id,
+ node_connect_callback,
+ NULL));
+ break;
+
+ case NODE_DISCONNECT:
+ pa_operation_unref(pa_ext_node_manager_disconnect_nodes(c, conn_id,
+ simple_callback,
+ NULL));
+ break;
default:
pa_assert_not_reached();
}
} else if (pa_streq(argv[optind], "node-connect")) {
- action = NODE_CONNECT;
+ action = NODE_CONNECT;
- if (argc != optind+3) {
- pa_log(_("You have to specify a source and destination node indexes"));
- goto quit;
- }
+ if (argc != optind+3) {
+ pa_log(_("You have to specify a source and destination node indexes"));
+ goto quit;
+ }
- src_node_id = (uint32_t) atoi(argv[optind+1]);
- dst_node_id = (uint32_t) atoi(argv[optind+2]);
+ src_node_id = (uint32_t) atoi(argv[optind+1]);
+ dst_node_id = (uint32_t) atoi(argv[optind+2]);
- } else if (pa_streq(argv[optind], "node-disconnect")) {
- action = NODE_DISCONNECT;
+ } else if (pa_streq(argv[optind], "node-disconnect")) {
+ action = NODE_DISCONNECT;
- if (argc != optind+2) {
- pa_log(_("You have to specify a connection id"));
- goto quit;
- }
+ if (argc != optind+2) {
+ pa_log(_("You have to specify a connection id"));
+ goto quit;
+ }
- conn_id = (uint32_t) atoi(argv[optind+1]);
+ conn_id = (uint32_t) atoi(argv[optind+1]);
} else if (pa_streq(argv[optind], "set-volume-control-volume")) {
action = SET_VOLUME_CONTROL_VOLUME;
goto quit;
}
- } else if (pa_streq(argv[optind], "help")) {
+ } else if (pa_streq(argv[optind], "help")) {
help(bn);
ret = 0;
goto quit;