diff --git a/src/tools/wpctl.c b/src/tools/wpctl.c index d06f605b..9f507eca 100644 --- a/src/tools/wpctl.c +++ b/src/tools/wpctl.c @@ -299,6 +299,7 @@ static void print_filter_node (const GValue *item, gpointer data) { struct print_context *context = data; + g_autoptr (WpPlugin) def_nodes_api = NULL; WpPipewireObject *obj = g_value_get_object (item); g_autoptr (WpIterator) it = NULL; g_auto (GValue) val = G_VALUE_INIT; @@ -309,6 +310,8 @@ print_filter_node (const GValue *item, gpointer data) if (g_hash_table_contains (context->printed_filters, link_group)) return; + def_nodes_api = wp_plugin_find (context->self->core, "default-nodes-api"); + /* Print all nodes for this link_group */ printf (TREE_INDENT_LINE " - %-60s\n", link_group); it = wp_object_manager_new_filtered_iterator (context->self->om, @@ -329,6 +332,11 @@ print_filter_node (const GValue *item, gpointer data) name = wp_pipewire_object_get_property (node, PW_KEY_NODE_DESCRIPTION); media_class = wp_pipewire_object_get_property (node, PW_KEY_MEDIA_CLASS); + context->default_node = -1; + if (def_nodes_api) + g_signal_emit_by_name (def_nodes_api, "get-default-node", media_class, + &context->default_node); + printf (TREE_INDENT_LINE "%c %4u. %-60s [%s]\n", context->default_node == id ? '*' : ' ', id, name, media_class); }