mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-20 07:40:03 +01:00
wpctl: Make sure default node Id is updated when printing filters
This will properly show '*' for default sink filters in the status output.
This commit is contained in:
parent
11f10b4f45
commit
c60475b293
1 changed files with 8 additions and 0 deletions
|
|
@ -299,6 +299,7 @@ static void
|
||||||
print_filter_node (const GValue *item, gpointer data)
|
print_filter_node (const GValue *item, gpointer data)
|
||||||
{
|
{
|
||||||
struct print_context *context = data;
|
struct print_context *context = data;
|
||||||
|
g_autoptr (WpPlugin) def_nodes_api = NULL;
|
||||||
WpPipewireObject *obj = g_value_get_object (item);
|
WpPipewireObject *obj = g_value_get_object (item);
|
||||||
g_autoptr (WpIterator) it = NULL;
|
g_autoptr (WpIterator) it = NULL;
|
||||||
g_auto (GValue) val = G_VALUE_INIT;
|
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))
|
if (g_hash_table_contains (context->printed_filters, link_group))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
def_nodes_api = wp_plugin_find (context->self->core, "default-nodes-api");
|
||||||
|
|
||||||
/* Print all nodes for this link_group */
|
/* Print all nodes for this link_group */
|
||||||
printf (TREE_INDENT_LINE " - %-60s\n", link_group);
|
printf (TREE_INDENT_LINE " - %-60s\n", link_group);
|
||||||
it = wp_object_manager_new_filtered_iterator (context->self->om,
|
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);
|
name = wp_pipewire_object_get_property (node, PW_KEY_NODE_DESCRIPTION);
|
||||||
media_class = wp_pipewire_object_get_property (node, PW_KEY_MEDIA_CLASS);
|
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",
|
printf (TREE_INDENT_LINE "%c %4u. %-60s [%s]\n",
|
||||||
context->default_node == id ? '*' : ' ', id, name, media_class);
|
context->default_node == id ? '*' : ' ', id, name, media_class);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue