From d76dcc4b20bb8b256855fd784d8db1229b8fbc3a Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Sat, 12 Dec 2009 21:55:41 +0200 Subject: [PATCH] daemon: Fix #33 JACK graph connections are always visible and match the actual JACK graph connections. So the logic for hiding connections when they are removed should be disabled for JACK graphs. See also commit 5ef9e1e00660b1af8d54c9c6b11204f6fda4a453 where this bug was intoduced. --- daemon/graph.c | 5 +++-- daemon/graph.h | 3 ++- daemon/virtualizer.c | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/daemon/graph.c b/daemon/graph.c index f71efe10..fed9fed3 100644 --- a/daemon/graph.c +++ b/daemon/graph.c @@ -1342,7 +1342,8 @@ ladish_graph_add_connection( void ladish_graph_remove_connection( ladish_graph_handle graph_handle, - uint64_t connection_id) + uint64_t connection_id, + bool force) { struct ladish_graph_connection * connection_ptr; @@ -1353,7 +1354,7 @@ ladish_graph_remove_connection( return; } - if (connection_ptr->changing) + if (force || connection_ptr->changing) { /* log_info( */ /* "removing connection '%s':'%s' - '%s':'%s'", */ diff --git a/daemon/graph.h b/daemon/graph.h index e320616d..942e4a90 100644 --- a/daemon/graph.h +++ b/daemon/graph.h @@ -94,7 +94,8 @@ ladish_graph_add_connection( void ladish_graph_remove_connection( ladish_graph_handle graph_handle, - uint64_t connection_id); + uint64_t connection_id, + bool force); bool ladish_graph_get_connection_ports( diff --git a/daemon/virtualizer.c b/daemon/virtualizer.c index bfd6e9c3..3823f7c4 100644 --- a/daemon/virtualizer.c +++ b/daemon/virtualizer.c @@ -569,12 +569,12 @@ static void ports_connected(void * context, uint64_t client1_id, uint64_t port1_ if (ladish_graph_find_connection(virtualizer_ptr->studio_graph, port1, port2, &connection_id)) { - log_info("showing hidden connection"); + log_info("showing hidden studio connection"); ladish_graph_show_connection(virtualizer_ptr->studio_graph, connection_id); } else { - log_info("creating new connection"); + log_info("creating new studio connection"); ladish_graph_add_connection(virtualizer_ptr->studio_graph, port1, port2, false); } } @@ -603,7 +603,7 @@ static void ports_disconnected(void * context, uint64_t client1_id, uint64_t por if (ladish_graph_find_connection(virtualizer_ptr->jack_graph, port1, port2, &connection_id)) { - ladish_graph_remove_connection(virtualizer_ptr->jack_graph, connection_id); + ladish_graph_remove_connection(virtualizer_ptr->jack_graph, connection_id, true); } else { @@ -612,7 +612,7 @@ static void ports_disconnected(void * context, uint64_t client1_id, uint64_t por if (ladish_graph_find_connection(virtualizer_ptr->studio_graph, port1, port2, &connection_id)) { - ladish_graph_remove_connection(virtualizer_ptr->studio_graph, connection_id); + ladish_graph_remove_connection(virtualizer_ptr->studio_graph, connection_id, false); } else {