Two views, one for raw jack and one for studio
[ladish.git] / graph_proxy.c
blobcafebcc7eef36718db9807627c10d4fe2cee18b3
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 void clear(struct graph * graph_ptr)
73 struct list_head * node_ptr;
74 struct monitor * monitor_ptr;
76 list_for_each(node_ptr, &graph_ptr->monitors)
78 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
79 monitor_ptr->clear(monitor_ptr->context);
83 static void client_appeared(struct graph * graph_ptr, uint64_t id, const char * name)
85 struct list_head * node_ptr;
86 struct monitor * monitor_ptr;
88 list_for_each(node_ptr, &graph_ptr->monitors)
90 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
91 monitor_ptr->client_appeared(monitor_ptr->context, id, name);
95 static void client_disappeared(struct graph * graph_ptr, uint64_t id)
97 struct list_head * node_ptr;
98 struct monitor * monitor_ptr;
100 list_for_each(node_ptr, &graph_ptr->monitors)
102 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
103 monitor_ptr->client_disappeared(monitor_ptr->context, id);
107 static
108 void
109 port_appeared(
110 struct graph * graph_ptr,
111 uint64_t client_id,
112 uint64_t port_id,
113 const char * port_name,
114 uint32_t port_flags,
115 uint32_t port_type)
117 struct list_head * node_ptr;
118 struct monitor * monitor_ptr;
119 bool is_input;
120 bool is_terminal;
121 bool is_midi;
123 if (port_type != JACKDBUS_PORT_TYPE_AUDIO && port_type != JACKDBUS_PORT_TYPE_MIDI)
125 lash_error("Unknown JACK D-Bus port type %d", (unsigned int)port_type);
126 return;
129 is_input = port_flags & JACKDBUS_PORT_FLAG_INPUT;
130 is_terminal = port_flags & JACKDBUS_PORT_FLAG_TERMINAL;
131 is_midi = port_type == JACKDBUS_PORT_TYPE_MIDI;
133 list_for_each(node_ptr, &graph_ptr->monitors)
135 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
136 monitor_ptr->port_appeared(monitor_ptr->context, client_id, port_id, port_name, is_input, is_terminal, is_midi);
140 static
141 void
142 port_disappeared(
143 struct graph * graph_ptr,
144 uint64_t client_id,
145 uint64_t port_id)
147 struct list_head * node_ptr;
148 struct monitor * monitor_ptr;
150 list_for_each(node_ptr, &graph_ptr->monitors)
152 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
153 monitor_ptr->port_disappeared(monitor_ptr->context, client_id, port_id);
157 static
158 void
159 ports_connected(
160 struct graph * graph_ptr,
161 uint64_t client1_id,
162 uint64_t port1_id,
163 uint64_t client2_id,
164 uint64_t port2_id)
166 struct list_head * node_ptr;
167 struct monitor * monitor_ptr;
169 list_for_each(node_ptr, &graph_ptr->monitors)
171 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
172 monitor_ptr->ports_connected(monitor_ptr->context, client1_id, port1_id, client2_id, port2_id);
176 static
177 void
178 ports_disconnected(
179 struct graph * graph_ptr,
180 uint64_t client1_id,
181 uint64_t port1_id,
182 uint64_t client2_id,
183 uint64_t port2_id)
185 struct list_head * node_ptr;
186 struct monitor * monitor_ptr;
188 list_for_each(node_ptr, &graph_ptr->monitors)
190 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
191 monitor_ptr->ports_disconnected(monitor_ptr->context, client1_id, port1_id, client2_id, port2_id);
195 static void refresh_internal(struct graph * graph_ptr, bool force)
197 DBusMessage* reply_ptr;
198 DBusMessageIter iter;
199 dbus_uint64_t version;
200 const char * reply_signature;
201 DBusMessageIter clients_array_iter;
202 DBusMessageIter client_struct_iter;
203 DBusMessageIter ports_array_iter;
204 DBusMessageIter port_struct_iter;
205 DBusMessageIter connections_array_iter;
206 DBusMessageIter connection_struct_iter;
207 dbus_uint64_t client_id;
208 const char *client_name;
209 dbus_uint64_t port_id;
210 const char *port_name;
211 dbus_uint32_t port_flags;
212 dbus_uint32_t port_type;
213 dbus_uint64_t client2_id;
214 const char *client2_name;
215 dbus_uint64_t port2_id;
216 const char *port2_name;
217 dbus_uint64_t connection_id;
219 lash_info("refresh_internal() called");
221 if (force)
223 version = 0; // workaround module split/join stupidity
225 else
227 version = graph_ptr->version;
230 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "GetGraph", "t", &version, NULL, &reply_ptr))
232 lash_error("GetGraph() failed.");
233 return;
236 reply_signature = dbus_message_get_signature(reply_ptr);
238 if (strcmp(reply_signature, "ta(tsa(tsuu))a(tstststst)") != 0)
240 lash_error("GetGraph() reply signature mismatch. '%s'", reply_signature);
241 goto unref;
244 dbus_message_iter_init(reply_ptr, &iter);
246 //info_msg((std::string)"version " + (char)dbus_message_iter_get_arg_type(&iter));
247 dbus_message_iter_get_basic(&iter, &version);
248 dbus_message_iter_next(&iter);
250 if (!force && version <= graph_ptr->version)
252 goto unref;
255 clear(graph_ptr);
257 //info_msg(str(boost::format("got new graph version %llu") % version));
258 graph_ptr->version = version;
260 //info_msg((std::string)"clients " + (char)dbus_message_iter_get_arg_type(&iter));
262 for (dbus_message_iter_recurse(&iter, &clients_array_iter);
263 dbus_message_iter_get_arg_type(&clients_array_iter) != DBUS_TYPE_INVALID;
264 dbus_message_iter_next(&clients_array_iter))
266 //info_msg((std::string)"a client " + (char)dbus_message_iter_get_arg_type(&clients_array_iter));
267 dbus_message_iter_recurse(&clients_array_iter, &client_struct_iter);
269 dbus_message_iter_get_basic(&client_struct_iter, &client_id);
270 dbus_message_iter_next(&client_struct_iter);
272 dbus_message_iter_get_basic(&client_struct_iter, &client_name);
273 dbus_message_iter_next(&client_struct_iter);
275 //info_msg((std::string)"client '" + client_name + "'");
277 client_appeared(graph_ptr, client_id, client_name);
279 for (dbus_message_iter_recurse(&client_struct_iter, &ports_array_iter);
280 dbus_message_iter_get_arg_type(&ports_array_iter) != DBUS_TYPE_INVALID;
281 dbus_message_iter_next(&ports_array_iter))
283 //info_msg((std::string)"a port " + (char)dbus_message_iter_get_arg_type(&ports_array_iter));
284 dbus_message_iter_recurse(&ports_array_iter, &port_struct_iter);
286 dbus_message_iter_get_basic(&port_struct_iter, &port_id);
287 dbus_message_iter_next(&port_struct_iter);
289 dbus_message_iter_get_basic(&port_struct_iter, &port_name);
290 dbus_message_iter_next(&port_struct_iter);
292 dbus_message_iter_get_basic(&port_struct_iter, &port_flags);
293 dbus_message_iter_next(&port_struct_iter);
295 dbus_message_iter_get_basic(&port_struct_iter, &port_type);
296 dbus_message_iter_next(&port_struct_iter);
298 //info_msg((std::string)"port: " + port_name);
300 port_appeared(graph_ptr, client_id, port_id, port_name, port_flags, port_type);
303 dbus_message_iter_next(&client_struct_iter);
306 dbus_message_iter_next(&iter);
308 for (dbus_message_iter_recurse(&iter, &connections_array_iter);
309 dbus_message_iter_get_arg_type(&connections_array_iter) != DBUS_TYPE_INVALID;
310 dbus_message_iter_next(&connections_array_iter))
312 //info_msg((std::string)"a connection " + (char)dbus_message_iter_get_arg_type(&connections_array_iter));
313 dbus_message_iter_recurse(&connections_array_iter, &connection_struct_iter);
315 dbus_message_iter_get_basic(&connection_struct_iter, &client_id);
316 dbus_message_iter_next(&connection_struct_iter);
318 dbus_message_iter_get_basic(&connection_struct_iter, &client_name);
319 dbus_message_iter_next(&connection_struct_iter);
321 dbus_message_iter_get_basic(&connection_struct_iter, &port_id);
322 dbus_message_iter_next(&connection_struct_iter);
324 dbus_message_iter_get_basic(&connection_struct_iter, &port_name);
325 dbus_message_iter_next(&connection_struct_iter);
327 dbus_message_iter_get_basic(&connection_struct_iter, &client2_id);
328 dbus_message_iter_next(&connection_struct_iter);
330 dbus_message_iter_get_basic(&connection_struct_iter, &client2_name);
331 dbus_message_iter_next(&connection_struct_iter);
333 dbus_message_iter_get_basic(&connection_struct_iter, &port2_id);
334 dbus_message_iter_next(&connection_struct_iter);
336 dbus_message_iter_get_basic(&connection_struct_iter, &port2_name);
337 dbus_message_iter_next(&connection_struct_iter);
339 dbus_message_iter_get_basic(&connection_struct_iter, &connection_id);
340 dbus_message_iter_next(&connection_struct_iter);
342 //info_msg(str(boost::format("connection(%llu) %s(%llu):%s(%llu) <-> %s(%llu):%s(%llu)") %
343 // connection_id %
344 // client_name %
345 // client_id %
346 // port_name %
347 // port_id %
348 // client2_name %
349 // client2_id %
350 // port2_name %
351 // port2_id));
353 ports_connected(graph_ptr, client_id, port_id, client2_id, port2_id);
356 unref:
357 dbus_message_unref(reply_ptr);
361 bool
362 graph_create(
363 const char * service,
364 const char * object,
365 graph_handle * graph_handle_ptr)
367 struct graph * graph_ptr;
369 graph_ptr = malloc(sizeof(struct graph));
370 if (graph_ptr == NULL)
372 lash_error("malloc() failed to allocate struct graph");
373 goto fail;
376 graph_ptr->service = strdup(service);
377 if (graph_ptr->service == NULL)
379 lash_error("strdup() failed too duplicate service name '%s'", service);
380 goto free_graph;
383 graph_ptr->object = strdup(object);
384 if (graph_ptr->object == NULL)
386 lash_error("strdup() failed too duplicate object name '%s'", object);
387 goto free_service;
390 INIT_LIST_HEAD(&graph_ptr->monitors);
392 graph_ptr->version = 0;
393 graph_ptr->active = false;
395 *graph_handle_ptr = (graph_handle)graph_ptr;
397 return true;
399 free_service:
400 free(graph_ptr->service);
402 free_graph:
403 free(graph_ptr);
405 fail:
406 return false;
409 #define graph_ptr ((struct graph *)graph)
411 void
412 graph_destroy(
413 graph_handle graph)
415 assert(list_empty(&graph_ptr->monitors));
417 free(graph_ptr->object);
418 free(graph_ptr->service);
419 free(graph_ptr);
422 bool
423 graph_activate(
424 graph_handle graph)
426 char rule[1024];
427 const char ** signal;
429 const char * patchbay_signals[] = {
430 "ClientAppeared",
431 "ClientDisappeared",
432 "PortAppeared",
433 "PortDisappeared",
434 "PortsConnected",
435 "PortsDisconnected",
436 NULL};
438 if (list_empty(&graph_ptr->monitors))
440 lash_error("no monitors to activate");
441 return false;
444 if (graph_ptr->active)
446 lash_error("graph already active");
447 return false;
450 for (signal = patchbay_signals; *signal != NULL; signal++)
452 snprintf(
453 rule,
454 sizeof(rule),
455 "type='signal',sender='%s',path='%s',interface='" JACKDBUS_IFACE_PATCHBAY "',member='%s'",
456 graph_ptr->service,
457 graph_ptr->object,
458 *signal);
460 dbus_bus_add_match(g_dbus_connection, rule, &g_dbus_error);
461 if (dbus_error_is_set(&g_dbus_error))
463 lash_error("Failed to add D-Bus match rule: %s", g_dbus_error.message);
464 dbus_error_free(&g_dbus_error);
465 return false;
469 dbus_connection_add_filter(g_dbus_connection, message_hook, graph_ptr, NULL);
471 graph_ptr->active = true;
473 refresh_internal(graph_ptr, true);
475 return true;
478 bool
479 graph_attach(
480 graph_handle graph,
481 void * context,
482 void (* clear)(void * context),
483 void (* client_appeared)(void * context, uint64_t id, const char * name),
484 void (* client_disappeared)(void * context, uint64_t id),
485 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),
486 void (* port_disappeared)(void * context, uint64_t client_id, uint64_t port_id),
487 void (* ports_connected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id),
488 void (* ports_disconnected)(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id))
490 struct monitor * monitor_ptr;
492 if (graph_ptr->active)
494 return false;
497 monitor_ptr = malloc(sizeof(struct monitor));
498 if (monitor_ptr == NULL)
500 lash_error("malloc() failed to allocate struct monitor");
501 return false;
504 monitor_ptr->context = context;
505 monitor_ptr->clear = clear;
506 monitor_ptr->client_appeared = client_appeared;
507 monitor_ptr->client_disappeared = client_disappeared;
508 monitor_ptr->port_appeared = port_appeared;
509 monitor_ptr->port_disappeared = port_disappeared;
510 monitor_ptr->ports_connected = ports_connected;
511 monitor_ptr->ports_disconnected = ports_disconnected;
513 list_add_tail(&monitor_ptr->siblings, &graph_ptr->monitors);
515 return true;
518 void
519 graph_detach(
520 graph_handle graph,
521 void * context)
523 struct list_head * node_ptr;
524 struct monitor * monitor_ptr;
526 list_for_each(node_ptr, &graph_ptr->monitors)
528 monitor_ptr = list_entry(node_ptr, struct monitor, siblings);
529 if (monitor_ptr->context == context)
531 list_del(&monitor_ptr->siblings);
532 free(monitor_ptr);
533 return;
537 assert(false);
540 void
541 graph_connect_ports(
542 graph_handle graph,
543 uint64_t port1_id,
544 uint64_t port2_id)
546 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "ConnectPortsByID", "tt", &port1_id, &port2_id, ""))
548 lash_error("ConnectPortsByID() failed.");
552 void
553 graph_disconnect_ports(
554 graph_handle graph,
555 uint64_t port1_id,
556 uint64_t port2_id)
558 if (!dbus_call_simple(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "DisconnectPortsByID", "tt", &port1_id, &port2_id, ""))
560 lash_error("DisconnectPortsByID() failed.");
564 static
565 DBusHandlerResult
566 message_hook(
567 DBusConnection * connection,
568 DBusMessage * message,
569 void * graph)
571 const char * object_path;
572 dbus_uint64_t new_graph_version;
573 dbus_uint64_t client_id;
574 const char *client_name;
575 dbus_uint64_t port_id;
576 const char *port_name;
577 dbus_uint32_t port_flags;
578 dbus_uint32_t port_type;
579 dbus_uint64_t client2_id;
580 const char *client2_name;
581 dbus_uint64_t port2_id;
582 const char *port2_name;
583 dbus_uint64_t connection_id;
585 object_path = dbus_message_get_path(message);
586 if (object_path == NULL || strcmp(object_path, graph_ptr->object) != 0)
588 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
591 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "ClientAppeared"))
593 if (!dbus_message_get_args(
594 message,
595 &g_dbus_error,
596 DBUS_TYPE_UINT64, &new_graph_version,
597 DBUS_TYPE_UINT64, &client_id,
598 DBUS_TYPE_STRING, &client_name,
599 DBUS_TYPE_INVALID))
601 lash_error("dbus_message_get_args() failed to extract ClientAppeared signal arguments (%s)", g_dbus_error.message);
602 dbus_error_free(&g_dbus_error);
603 return DBUS_HANDLER_RESULT_HANDLED;
606 //lash_info("ClientAppeared, %s(%llu)", client_name, client_id);
608 client_appeared(graph_ptr, client_id, client_name);
610 return DBUS_HANDLER_RESULT_HANDLED;
613 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "ClientDisappeared"))
615 if (!dbus_message_get_args(
616 message,
617 &g_dbus_error,
618 DBUS_TYPE_UINT64, &new_graph_version,
619 DBUS_TYPE_UINT64, &client_id,
620 DBUS_TYPE_STRING, &client_name,
621 DBUS_TYPE_INVALID))
623 lash_error("dbus_message_get_args() failed to extract ClientDisappeared signal arguments (%s)", g_dbus_error.message);
624 dbus_error_free(&g_dbus_error);
625 return DBUS_HANDLER_RESULT_HANDLED;
628 //lash_info("ClientDisappeared, %s(%llu)", client_name, client_id);
630 client_disappeared(graph_ptr, client_id);
632 return DBUS_HANDLER_RESULT_HANDLED;
635 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortAppeared"))
637 if (!dbus_message_get_args(
638 message,
639 &g_dbus_error,
640 DBUS_TYPE_UINT64, &new_graph_version,
641 DBUS_TYPE_UINT64, &client_id,
642 DBUS_TYPE_STRING, &client_name,
643 DBUS_TYPE_UINT64, &port_id,
644 DBUS_TYPE_STRING, &port_name,
645 DBUS_TYPE_UINT32, &port_flags,
646 DBUS_TYPE_UINT32, &port_type,
647 DBUS_TYPE_INVALID))
649 lash_error("dbus_message_get_args() failed to extract PortAppeared signal arguments (%s)", g_dbus_error.message);
650 dbus_error_free(&g_dbus_error);
651 return DBUS_HANDLER_RESULT_HANDLED;
654 //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));
656 port_appeared(graph_ptr, client_id, port_id, port_name, port_flags, port_type);
658 return DBUS_HANDLER_RESULT_HANDLED;
661 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortDisappeared"))
663 if (!dbus_message_get_args(
664 message,
665 &g_dbus_error,
666 DBUS_TYPE_UINT64, &new_graph_version,
667 DBUS_TYPE_UINT64, &client_id,
668 DBUS_TYPE_STRING, &client_name,
669 DBUS_TYPE_UINT64, &port_id,
670 DBUS_TYPE_STRING, &port_name,
671 DBUS_TYPE_INVALID))
673 lash_error("dbus_message_get_args() failed to extract PortDisappeared signal arguments (%s)", g_dbus_error.message);
674 dbus_error_free(&g_dbus_error);
675 return DBUS_HANDLER_RESULT_HANDLED;
678 //me->info_msg(str(boost::format("PortDisappeared, %s(%llu):%s(%llu)") % client_name % client_id % port_name % port_id));
680 port_disappeared(graph_ptr, client_id, port_id);
682 return DBUS_HANDLER_RESULT_HANDLED;
685 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortsConnected"))
687 if (!dbus_message_get_args(
688 message,
689 &g_dbus_error,
690 DBUS_TYPE_UINT64, &new_graph_version,
691 DBUS_TYPE_UINT64, &client_id,
692 DBUS_TYPE_STRING, &client_name,
693 DBUS_TYPE_UINT64, &port_id,
694 DBUS_TYPE_STRING, &port_name,
695 DBUS_TYPE_UINT64, &client2_id,
696 DBUS_TYPE_STRING, &client2_name,
697 DBUS_TYPE_UINT64, &port2_id,
698 DBUS_TYPE_STRING, &port2_name,
699 DBUS_TYPE_UINT64, &connection_id,
700 DBUS_TYPE_INVALID))
702 lash_error("dbus_message_get_args() failed to extract PortsConnected signal arguments (%s)", g_dbus_error.message);
703 dbus_error_free(&g_dbus_error);
704 return DBUS_HANDLER_RESULT_HANDLED;
707 ports_connected(graph_ptr, client_id, port_id, client2_id, port2_id);
709 return DBUS_HANDLER_RESULT_HANDLED;
712 if (dbus_message_is_signal(message, JACKDBUS_IFACE_PATCHBAY, "PortsDisconnected"))
714 if (!dbus_message_get_args(
715 message,
716 &g_dbus_error,
717 DBUS_TYPE_UINT64, &new_graph_version,
718 DBUS_TYPE_UINT64, &client_id,
719 DBUS_TYPE_STRING, &client_name,
720 DBUS_TYPE_UINT64, &port_id,
721 DBUS_TYPE_STRING, &port_name,
722 DBUS_TYPE_UINT64, &client2_id,
723 DBUS_TYPE_STRING, &client2_name,
724 DBUS_TYPE_UINT64, &port2_id,
725 DBUS_TYPE_STRING, &port2_name,
726 DBUS_TYPE_UINT64, &connection_id,
727 DBUS_TYPE_INVALID))
729 lash_error("dbus_message_get_args() failed to extract PortsConnected signal arguments (%s)", g_dbus_error.message);
730 dbus_error_free(&g_dbus_error);
731 return DBUS_HANDLER_RESULT_HANDLED;
734 ports_disconnected(graph_ptr, client_id, port_id, client2_id, port2_id);
736 return DBUS_HANDLER_RESULT_HANDLED;
739 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;