ladish_control: python3 improvements
[ladish.git] / graph_proxy.c
blob850726cdf09cc0c29bc9ecf8b029322fb9888de0
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains implementation graph object that is backed through D-Bus
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <dbus/dbus.h>
28 #include <stdlib.h>
29 #include <assert.h>
31 #include "common.h"
32 #include "graph_proxy.h"
33 #include "common/klist.h"
34 #include "common/debug.h"
35 #include "dbus/helpers.h"
36 #include "dbus_constants.h"
38 #define JACKDBUS_PORT_FLAG_INPUT 0x00000001
39 #define JACKDBUS_PORT_FLAG_OUTPUT 0x00000002
40 #define JACKDBUS_PORT_FLAG_PHYSICAL 0x00000004
41 #define JACKDBUS_PORT_FLAG_CAN_MONITOR 0x00000008
42 #define JACKDBUS_PORT_FLAG_TERMINAL 0x00000010
44 #define JACKDBUS_PORT_TYPE_AUDIO 0
45 #define JACKDBUS_PORT_TYPE_MIDI 1
47 struct monitor
49 struct list_head siblings;
50 void * context;
51 void (* clear)(void * context);
52 void (* client_appeared)(void * context, uint64_t id, const char * name);
53 void (* client_disappeared)(void * context, uint64_t id);
54 void (* port_appeared)(void * context, uint64_t client_id, uint64_t port_id, const char * port_name, bool is_input, bool is_terminal, bool is_midi);
55 void (* port_disappeared)(void * context, uint64_t client_id, uint64_t port_id);
56 void (* ports_connected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id);
57 void (* ports_disconnected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id);
60 struct graph
62 struct list_head monitors;
63 char * service;
64 char * object;
65 uint64_t version;
66 bool active;
69 static DBusHandlerResult message_hook(DBusConnection *, DBusMessage *, void *);
71 static const char * g_signals[] =
73 "ClientAppeared",
74 "ClientDisappeared",
75 "PortAppeared",
76 "PortDisappeared",
77 "PortsConnected",
78 "PortsDisconnected",
79 NULL
82 static void clear(struct graph * graph_ptr)
84 struct list_head * node_ptr;
85 struct monitor * monitor_ptr;
87 list_for_each(node_ptr, &graph_ptr->monitors)
89 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
90 monitor_ptr->clear(monitor_ptr->context);
94 static void client_appeared(struct graph * graph_ptr, uint64_t id, const char * name)
96 struct list_head * node_ptr;
97 struct monitor * monitor_ptr;
99 list_for_each(node_ptr, &graph_ptr->monitors)
101 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
102 monitor_ptr->client_appeared(monitor_ptr->context, id, name);
106 static void client_disappeared(struct graph * graph_ptr, uint64_t id)
108 struct list_head * node_ptr;
109 struct monitor * monitor_ptr;
111 list_for_each(node_ptr, &graph_ptr->monitors)
113 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
114 monitor_ptr->client_disappeared(monitor_ptr->context, id);
118 static
119 void
120 port_appeared(
121 struct graph * graph_ptr,
122 uint64_t client_id,
123 uint64_t port_id,
124 const char * port_name,
125 uint32_t port_flags,
126 uint32_t port_type)
128 struct list_head * node_ptr;
129 struct monitor * monitor_ptr;
130 bool is_input;
131 bool is_terminal;
132 bool is_midi;
134 if (port_type != JACKDBUS_PORT_TYPE_AUDIO && port_type != JACKDBUS_PORT_TYPE_MIDI)
136 lash_error("Unknown JACK D-Bus port type %d", (unsigned int)port_type);
137 return;
140 is_input = port_flags & JACKDBUS_PORT_FLAG_INPUT;
141 is_terminal = port_flags & JACKDBUS_PORT_FLAG_TERMINAL;
142 is_midi = port_type == JACKDBUS_PORT_TYPE_MIDI;
144 list_for_each(node_ptr, &graph_ptr->monitors)
146 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
147 monitor_ptr->port_appeared(monitor_ptr->context, client_id, port_id, port_name, is_input, is_terminal, is_midi);
151 static
152 void
153 port_disappeared(
154 struct graph * graph_ptr,
155 uint64_t client_id,
156 uint64_t port_id)
158 struct list_head * node_ptr;
159 struct monitor * monitor_ptr;
161 list_for_each(node_ptr, &graph_ptr->monitors)
163 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
164 monitor_ptr->port_disappeared(monitor_ptr->context, client_id, port_id);
168 static
169 void
170 ports_connected(
171 struct graph * graph_ptr,
172 uint64_t client1_id,
173 uint64_t port1_id,
174 uint64_t client2_id,
175 uint64_t port2_id)
177 struct list_head * node_ptr;
178 struct monitor * monitor_ptr;
180 list_for_each(node_ptr, &graph_ptr->monitors)
182 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
183 monitor_ptr->ports_connected(monitor_ptr->context, client1_id, port1_id, client2_id, port2_id);
187 static
188 void
189 ports_disconnected(
190 struct graph * graph_ptr,
191 uint64_t client1_id,
192 uint64_t port1_id,
193 uint64_t client2_id,
194 uint64_t port2_id)
196 struct list_head * node_ptr;
197 struct monitor * monitor_ptr;
199 list_for_each(node_ptr, &graph_ptr->monitors)
201 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
202 monitor_ptr->ports_disconnected(monitor_ptr->context, client1_id, port1_id, client2_id, port2_id);
206 static void refresh_internal(struct graph * graph_ptr, bool force)
208 DBusMessage* reply_ptr;
209 DBusMessageIter iter;
210 dbus_uint64_t version;
211 const char * reply_signature;
212 DBusMessageIter clients_array_iter;
213 DBusMessageIter client_struct_iter;
214 DBusMessageIter ports_array_iter;
215 DBusMessageIter port_struct_iter;
216 DBusMessageIter connections_array_iter;
217 DBusMessageIter connection_struct_iter;
218 dbus_uint64_t client_id;
219 const char *client_name;
220 dbus_uint64_t port_id;
221 const char *port_name;
222 dbus_uint32_t port_flags;
223 dbus_uint32_t port_type;
224 dbus_uint64_t client2_id;
225 const char *client2_name;
226 dbus_uint64_t port2_id;
227 const char *port2_name;
228 dbus_uint64_t connection_id;
230 lash_info("refresh_internal() called");
232 if (force)
234 version = 0; // workaround module split/join stupidity
236 else
238 version = graph_ptr->version;
241 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "GetGraph", "t", &version, NULL, &reply_ptr))
243 lash_error("GetGraph() failed.");
244 return;
247 reply_signature = dbus_message_get_signature(reply_ptr);
249 if (strcmp(reply_signature, "ta(tsa(tsuu))a(tstststst)") != 0)
251 lash_error("GetGraph() reply signature mismatch. '%s'", reply_signature);
252 goto unref;
255 dbus_message_iter_init(reply_ptr, &iter);
257 //info_msg((std::string)"version " + (char)dbus_message_iter_get_arg_type(&iter));
258 dbus_message_iter_get_basic(&iter, &version);
259 dbus_message_iter_next(&iter);
261 if (!force && version <= graph_ptr->version)
263 goto unref;
266 clear(graph_ptr);
268 //info_msg(str(boost::format("got new graph version %llu") % version));
269 graph_ptr->version = version;
271 //info_msg((std::string)"clients " + (char)dbus_message_iter_get_arg_type(&iter));
273 for (dbus_message_iter_recurse(&iter, &clients_array_iter);
274 dbus_message_iter_get_arg_type(&clients_array_iter) != DBUS_TYPE_INVALID;
275 dbus_message_iter_next(&clients_array_iter))
277 //info_msg((std::string)"a client " + (char)dbus_message_iter_get_arg_type(&clients_array_iter));
278 dbus_message_iter_recurse(&clients_array_iter, &client_struct_iter);
280 dbus_message_iter_get_basic(&client_struct_iter, &client_id);
281 dbus_message_iter_next(&client_struct_iter);
283 dbus_message_iter_get_basic(&client_struct_iter, &client_name);
284 dbus_message_iter_next(&client_struct_iter);
286 //info_msg((std::string)"client '" + client_name + "'");
288 client_appeared(graph_ptr, client_id, client_name);
290 for (dbus_message_iter_recurse(&client_struct_iter, &ports_array_iter);
291 dbus_message_iter_get_arg_type(&ports_array_iter) != DBUS_TYPE_INVALID;
292 dbus_message_iter_next(&ports_array_iter))
294 //info_msg((std::string)"a port " + (char)dbus_message_iter_get_arg_type(&ports_array_iter));
295 dbus_message_iter_recurse(&ports_array_iter, &port_struct_iter);
297 dbus_message_iter_get_basic(&port_struct_iter, &port_id);
298 dbus_message_iter_next(&port_struct_iter);
300 dbus_message_iter_get_basic(&port_struct_iter, &port_name);
301 dbus_message_iter_next(&port_struct_iter);
303 dbus_message_iter_get_basic(&port_struct_iter, &port_flags);
304 dbus_message_iter_next(&port_struct_iter);
306 dbus_message_iter_get_basic(&port_struct_iter, &port_type);
307 dbus_message_iter_next(&port_struct_iter);
309 //info_msg((std::string)"port: " + port_name);
311 port_appeared(graph_ptr, client_id, port_id, port_name, port_flags, port_type);
314 dbus_message_iter_next(&client_struct_iter);
317 dbus_message_iter_next(&iter);
319 for (dbus_message_iter_recurse(&iter, &connections_array_iter);
320 dbus_message_iter_get_arg_type(&connections_array_iter) != DBUS_TYPE_INVALID;
321 dbus_message_iter_next(&connections_array_iter))
323 //info_msg((std::string)"a connection " + (char)dbus_message_iter_get_arg_type(&connections_array_iter));
324 dbus_message_iter_recurse(&connections_array_iter, &connection_struct_iter);
326 dbus_message_iter_get_basic(&connection_struct_iter, &client_id);
327 dbus_message_iter_next(&connection_struct_iter);
329 dbus_message_iter_get_basic(&connection_struct_iter, &client_name);
330 dbus_message_iter_next(&connection_struct_iter);
332 dbus_message_iter_get_basic(&connection_struct_iter, &port_id);
333 dbus_message_iter_next(&connection_struct_iter);
335 dbus_message_iter_get_basic(&connection_struct_iter, &port_name);
336 dbus_message_iter_next(&connection_struct_iter);
338 dbus_message_iter_get_basic(&connection_struct_iter, &client2_id);
339 dbus_message_iter_next(&connection_struct_iter);
341 dbus_message_iter_get_basic(&connection_struct_iter, &client2_name);
342 dbus_message_iter_next(&connection_struct_iter);
344 dbus_message_iter_get_basic(&connection_struct_iter, &port2_id);
345 dbus_message_iter_next(&connection_struct_iter);
347 dbus_message_iter_get_basic(&connection_struct_iter, &port2_name);
348 dbus_message_iter_next(&connection_struct_iter);
350 dbus_message_iter_get_basic(&connection_struct_iter, &connection_id);
351 dbus_message_iter_next(&connection_struct_iter);
353 //info_msg(str(boost::format("connection(%llu) %s(%llu):%s(%llu) <-> %s(%llu):%s(%llu)") %
354 // connection_id %
355 // client_name %
356 // client_id %
357 // port_name %
358 // port_id %
359 // client2_name %
360 // client2_id %
361 // port2_name %
362 // port2_id));
364 ports_connected(graph_ptr, client_id, port_id, client2_id, port2_id);
367 unref:
368 dbus_message_unref(reply_ptr);
371 bool
372 graph_create(
373 const char * service,
374 const char * object,
375 graph_handle * graph_handle_ptr)
377 struct graph * graph_ptr;
379 graph_ptr = malloc(sizeof(struct graph));
380 if (graph_ptr == NULL)
382 lash_error("malloc() failed to allocate struct graph");
383 goto fail;
386 graph_ptr->service = strdup(service);
387 if (graph_ptr->service == NULL)
389 lash_error("strdup() failed too duplicate service name '%s'", service);
390 goto free_graph;
393 graph_ptr->object = strdup(object);
394 if (graph_ptr->object == NULL)
396 lash_error("strdup() failed too duplicate object name '%s'", object);
397 goto free_service;
400 INIT_LIST_HEAD(&graph_ptr->monitors);
402 graph_ptr->version = 0;
403 graph_ptr->active = false;
405 *graph_handle_ptr = (graph_handle)graph_ptr;
407 return true;
409 free_service:
410 free(graph_ptr->service);
412 free_graph:
413 free(graph_ptr);
415 fail:
416 return false;
419 #define graph_ptr ((struct graph *)graph)
421 void
422 graph_destroy(
423 graph_handle graph)
425 assert(list_empty(&graph_ptr->monitors));
427 if (graph_ptr->active)
429 dbus_unregister_object_signal_handler(
430 g_dbus_connection,
431 graph_ptr->service,
432 graph_ptr->object,
433 JACKDBUS_IFACE_PATCHBAY,
434 g_signals,
435 message_hook,
436 graph_ptr);
439 free(graph_ptr->object);
440 free(graph_ptr->service);
441 free(graph_ptr);
444 bool
445 graph_activate(
446 graph_handle graph)
448 if (list_empty(&graph_ptr->monitors))
450 lash_error("no monitors to activate");
451 return false;
454 if (graph_ptr->active)
456 lash_error("graph already active");
457 return false;
460 if (!dbus_register_object_signal_handler(
461 g_dbus_connection,
462 graph_ptr->service,
463 graph_ptr->object,
464 JACKDBUS_IFACE_PATCHBAY,
465 g_signals,
466 message_hook,
467 graph_ptr))
469 return false;
472 graph_ptr->active = true;
474 refresh_internal(graph_ptr, true);
476 return true;
479 bool
480 graph_attach(
481 graph_handle graph,
482 void * context,
483 void (* clear)(void * context),
484 void (* client_appeared)(void * context, uint64_t id, const char * name),
485 void (* client_disappeared)(void * context, uint64_t id),
486 void (* port_appeared)(void * context, uint64_t client_id, uint64_t port_id, const char * port_name, bool is_input, bool is_terminal, bool is_midi),
487 void (* port_disappeared)(void * context, uint64_t client_id, uint64_t port_id),
488 void (* ports_connected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id),
489 void (* ports_disconnected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id))
491 struct monitor * monitor_ptr;
493 if (graph_ptr->active)
495 return false;
498 monitor_ptr = malloc(sizeof(struct monitor));
499 if (monitor_ptr == NULL)
501 lash_error("malloc() failed to allocate struct monitor");
502 return false;
505 monitor_ptr->context = context;
506 monitor_ptr->clear = clear;
507 monitor_ptr->client_appeared = client_appeared;
508 monitor_ptr->client_disappeared = client_disappeared;
509 monitor_ptr->port_appeared = port_appeared;
510 monitor_ptr->port_disappeared = port_disappeared;
511 monitor_ptr->ports_connected = ports_connected;
512 monitor_ptr->ports_disconnected = ports_disconnected;
514 list_add_tail(&monitor_ptr->siblings, &graph_ptr->monitors);
516 return true;
519 void
520 graph_detach(
521 graph_handle graph,
522 void * context)
524 struct list_head * node_ptr;
525 struct monitor * monitor_ptr;
527 list_for_each(node_ptr, &graph_ptr->monitors)
529 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
530 if (monitor_ptr->context == context)
532 list_del(&monitor_ptr->siblings);
533 free(monitor_ptr);
534 return;
538 assert(false);
541 void
542 graph_connect_ports(
543 graph_handle graph,
544 uint64_t port1_id,
545 uint64_t port2_id)
547 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "ConnectPortsByID", "tt", &port1_id, &port2_id, ""))
549 lash_error("ConnectPortsByID() failed.");
553 void
554 graph_disconnect_ports(
555 graph_handle graph,
556 uint64_t port1_id,
557 uint64_t port2_id)
559 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "DisconnectPortsByID", "tt", &port1_id, &port2_id, ""))
561 lash_error("DisconnectPortsByID() failed.");
565 static
566 DBusHandlerResult
567 message_hook(
568 DBusConnection * connection,
569 DBusMessage * message,
570 void * graph)
572 const char * object_path;
573 dbus_uint64_t new_graph_version;
574 dbus_uint64_t client_id;
575 const char *client_name;
576 dbus_uint64_t port_id;
577 const char *port_name;
578 dbus_uint32_t port_flags;
579 dbus_uint32_t port_type;
580 dbus_uint64_t client2_id;
581 const char *client2_name;
582 dbus_uint64_t port2_id;
583 const char *port2_name;
584 dbus_uint64_t connection_id;
586 object_path = dbus_message_get_path(message);
587 if (object_path == NULL || strcmp(object_path, graph_ptr->object) != 0)
589 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
592 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "ClientAppeared"))
594 if (!dbus_message_get_args(
595 message,
596 &g_dbus_error,
597 DBUS_TYPE_UINT64, &new_graph_version,
598 DBUS_TYPE_UINT64, &client_id,
599 DBUS_TYPE_STRING, &client_name,
600 DBUS_TYPE_INVALID))
602 lash_error("dbus_message_get_args() failed to extract ClientAppeared signal arguments (%s)", g_dbus_error.message);
603 dbus_error_free(&g_dbus_error);
604 return DBUS_HANDLER_RESULT_HANDLED;
607 //lash_info("ClientAppeared, %s(%llu)", client_name, client_id);
609 client_appeared(graph_ptr, client_id, client_name);
611 return DBUS_HANDLER_RESULT_HANDLED;
614 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "ClientDisappeared"))
616 if (!dbus_message_get_args(
617 message,
618 &g_dbus_error,
619 DBUS_TYPE_UINT64, &new_graph_version,
620 DBUS_TYPE_UINT64, &client_id,
621 DBUS_TYPE_STRING, &client_name,
622 DBUS_TYPE_INVALID))
624 lash_error("dbus_message_get_args() failed to extract ClientDisappeared signal arguments (%s)", g_dbus_error.message);
625 dbus_error_free(&g_dbus_error);
626 return DBUS_HANDLER_RESULT_HANDLED;
629 //lash_info("ClientDisappeared, %s(%llu)", client_name, client_id);
631 client_disappeared(graph_ptr, client_id);
633 return DBUS_HANDLER_RESULT_HANDLED;
636 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortAppeared"))
638 if (!dbus_message_get_args(
639 message,
640 &g_dbus_error,
641 DBUS_TYPE_UINT64, &new_graph_version,
642 DBUS_TYPE_UINT64, &client_id,
643 DBUS_TYPE_STRING, &client_name,
644 DBUS_TYPE_UINT64, &port_id,
645 DBUS_TYPE_STRING, &port_name,
646 DBUS_TYPE_UINT32, &port_flags,
647 DBUS_TYPE_UINT32, &port_type,
648 DBUS_TYPE_INVALID))
650 lash_error("dbus_message_get_args() failed to extract PortAppeared signal arguments (%s)", g_dbus_error.message);
651 dbus_error_free(&g_dbus_error);
652 return DBUS_HANDLER_RESULT_HANDLED;
655 //me->info_msg(str(boost::format("PortAppeared, %s(%llu):%s(%llu), %lu, %lu") % client_name % client_id % port_name % port_id % port_flags % port_type));
657 port_appeared(graph_ptr, client_id, port_id, port_name, port_flags, port_type);
659 return DBUS_HANDLER_RESULT_HANDLED;
662 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortDisappeared"))
664 if (!dbus_message_get_args(
665 message,
666 &g_dbus_error,
667 DBUS_TYPE_UINT64, &new_graph_version,
668 DBUS_TYPE_UINT64, &client_id,
669 DBUS_TYPE_STRING, &client_name,
670 DBUS_TYPE_UINT64, &port_id,
671 DBUS_TYPE_STRING, &port_name,
672 DBUS_TYPE_INVALID))
674 lash_error("dbus_message_get_args() failed to extract PortDisappeared signal arguments (%s)", g_dbus_error.message);
675 dbus_error_free(&g_dbus_error);
676 return DBUS_HANDLER_RESULT_HANDLED;
679 //me->info_msg(str(boost::format("PortDisappeared, %s(%llu):%s(%llu)") % client_name % client_id % port_name % port_id));
681 port_disappeared(graph_ptr, client_id, port_id);
683 return DBUS_HANDLER_RESULT_HANDLED;
686 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortsConnected"))
688 if (!dbus_message_get_args(
689 message,
690 &g_dbus_error,
691 DBUS_TYPE_UINT64, &new_graph_version,
692 DBUS_TYPE_UINT64, &client_id,
693 DBUS_TYPE_STRING, &client_name,
694 DBUS_TYPE_UINT64, &port_id,
695 DBUS_TYPE_STRING, &port_name,
696 DBUS_TYPE_UINT64, &client2_id,
697 DBUS_TYPE_STRING, &client2_name,
698 DBUS_TYPE_UINT64, &port2_id,
699 DBUS_TYPE_STRING, &port2_name,
700 DBUS_TYPE_UINT64, &connection_id,
701 DBUS_TYPE_INVALID))
703 lash_error("dbus_message_get_args() failed to extract PortsConnected signal arguments (%s)", g_dbus_error.message);
704 dbus_error_free(&g_dbus_error);
705 return DBUS_HANDLER_RESULT_HANDLED;
708 ports_connected(graph_ptr, client_id, port_id, client2_id, port2_id);
710 return DBUS_HANDLER_RESULT_HANDLED;
713 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortsDisconnected"))
715 if (!dbus_message_get_args(
716 message,
717 &g_dbus_error,
718 DBUS_TYPE_UINT64, &new_graph_version,
719 DBUS_TYPE_UINT64, &client_id,
720 DBUS_TYPE_STRING, &client_name,
721 DBUS_TYPE_UINT64, &port_id,
722 DBUS_TYPE_STRING, &port_name,
723 DBUS_TYPE_UINT64, &client2_id,
724 DBUS_TYPE_STRING, &client2_name,
725 DBUS_TYPE_UINT64, &port2_id,
726 DBUS_TYPE_STRING, &port2_name,
727 DBUS_TYPE_UINT64, &connection_id,
728 DBUS_TYPE_INVALID))
730 lash_error("dbus_message_get_args() failed to extract PortsConnected signal arguments (%s)", g_dbus_error.message);
731 dbus_error_free(&g_dbus_error);
732 return DBUS_HANDLER_RESULT_HANDLED;
735 ports_disconnected(graph_ptr, client_id, port_id, client2_id, port2_id);
737 return DBUS_HANDLER_RESULT_HANDLED;
740 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;