diff --git a/modules/module-si-audio-adapter.c b/modules/module-si-audio-adapter.c index 82e3150d..6607f459 100644 --- a/modules/module-si-audio-adapter.c +++ b/modules/module-si-audio-adapter.c @@ -391,18 +391,13 @@ si_audio_adapter_get_ports (WpSiPortInfo * item, const gchar * context) g_autoptr (WpIterator) it = NULL; g_auto (GValue) val = G_VALUE_INIT; WpDirection direction = self->direction; - gboolean monitor_context = FALSE; guint32 node_id; - /* context can only be NULL, "reverse" or "monitor" */ + /* context can only be NULL or "reverse" */ if (!g_strcmp0 (context, "reverse")) { direction = (self->direction == WP_DIRECTION_INPUT) ? WP_DIRECTION_OUTPUT : WP_DIRECTION_INPUT; } - else if (!g_strcmp0 (context, "monitor")) { - direction = WP_DIRECTION_OUTPUT; - monitor_context = TRUE; - } else if (context != NULL) { /* on any other context, return an empty list of ports */ return g_variant_new_array (G_VARIANT_TYPE ("(uuu)"), NULL, 0); @@ -417,23 +412,14 @@ si_audio_adapter_get_ports (WpSiPortInfo * item, const gchar * context) { WpPort *port = g_value_get_object (&val); g_autoptr (WpProperties) props = NULL; - const gchar *str; const gchar *channel; guint32 port_id, channel_id = 0; - gboolean is_monitor = FALSE; if (wp_port_get_direction (port) != direction) continue; - /* skip monitor ports if not monitor context, or skip non-monitor ports if - * monitor context */ - props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port)); - str = wp_properties_get (props, PW_KEY_PORT_MONITOR); - is_monitor = str && pw_properties_parse_bool (str); - if (is_monitor != monitor_context) - continue; - port_id = wp_proxy_get_bound_id (WP_PROXY (port)); + props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port)); /* try to find the audio channel; if channel is NULL, this will silently leave the channel_id to its default value, 0 */ diff --git a/modules/module-si-node.c b/modules/module-si-node.c index 1db0dfe9..2bd66b5a 100644 --- a/modules/module-si-node.c +++ b/modules/module-si-node.c @@ -211,18 +211,13 @@ si_node_get_ports (WpSiPortInfo * item, const gchar * context) g_autoptr (WpIterator) it = NULL; g_auto (GValue) val = G_VALUE_INIT; WpDirection direction = self->direction; - gboolean monitor_context = FALSE; guint32 node_id; - /* context can only be NULL, "reverse" or "monitor" */ + /* context can only be NULL, "reverse" */ if (!g_strcmp0 (context, "reverse")) { direction = (self->direction == WP_DIRECTION_INPUT) ? WP_DIRECTION_OUTPUT : WP_DIRECTION_INPUT; } - else if (!g_strcmp0 (context, "monitor")) { - direction = WP_DIRECTION_OUTPUT; - monitor_context = TRUE; - } else if (context != NULL) { /* on any other context, return an empty list of ports */ return g_variant_new_array (G_VARIANT_TYPE ("(uuu)"), NULL, 0); @@ -237,23 +232,14 @@ si_node_get_ports (WpSiPortInfo * item, const gchar * context) { WpPort *port = g_value_get_object (&val); g_autoptr (WpProperties) props = NULL; - const gchar *str; const gchar *channel; guint32 port_id, channel_id = 0; - gboolean is_monitor = FALSE; if (wp_port_get_direction (port) != direction) continue; - /* skip monitor ports if not monitor context, or skip non-monitor ports if - * monitor context */ - props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port)); - str = wp_properties_get (props, PW_KEY_PORT_MONITOR); - is_monitor = str && pw_properties_parse_bool (str); - if (is_monitor != monitor_context) - continue; - port_id = wp_proxy_get_bound_id (WP_PROXY (port)); + props = wp_pipewire_object_get_properties (WP_PIPEWIRE_OBJECT (port)); /* try to find the audio channel; if channel is NULL, this will silently leave the channel_id to its default value, 0 */