gui: remove unused and duplicate dbus helper code
[ladish.git] / daemon / graph.h
blob942e4a909fb709f2f7df1b06ac38041596ba2fa0
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 interface to the D-Bus patchbay interface helpers
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 #ifndef PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED
28 #define PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED
30 #include "client.h"
31 #include "port.h"
33 typedef struct ladish_graph_tag { int unused; } * ladish_graph_handle;
35 typedef
36 bool
37 (* ladish_graph_connect_request_handler)(
38 void * context,
39 ladish_graph_handle graph_handle,
40 ladish_port_handle port1,
41 ladish_port_handle port2);
43 typedef
44 bool
45 (* ladish_graph_disconnect_request_handler)(
46 void * context,
47 ladish_graph_handle graph_handle,
48 uint64_t connection_id);
50 bool ladish_graph_create(ladish_graph_handle * graph_handle_ptr, const char * opath);
51 void ladish_graph_destroy(ladish_graph_handle graph_handle, bool destroy_ports);
53 void
54 ladish_graph_set_connection_handlers(
55 ladish_graph_handle graph_handle,
56 void * graph_context,
57 ladish_graph_connect_request_handler connect_handler,
58 ladish_graph_disconnect_request_handler disconnect_handler);
60 void ladish_graph_clear(ladish_graph_handle graph_handle, bool destroy_ports);
61 void * ladish_graph_get_dbus_context(ladish_graph_handle graph_handle);
62 ladish_dict_handle ladish_graph_get_dict(ladish_graph_handle graph_handle);
63 ladish_dict_handle ladish_graph_get_connection_dict(ladish_graph_handle graph_handle, uint64_t connection_id);
64 bool ladish_graph_add_client(ladish_graph_handle graph_handle, ladish_client_handle client_handle, const char * name, bool hidden);
66 void
67 ladish_graph_remove_client(
68 ladish_graph_handle graph_handle,
69 ladish_client_handle client_handle,
70 bool destroy_ports);
72 bool
73 ladish_graph_add_port(
74 ladish_graph_handle graph_handle,
75 ladish_client_handle client_handle,
76 ladish_port_handle port_handle,
77 const char * name,
78 uint32_t type,
79 uint32_t flags,
80 bool hidden);
82 ladish_client_handle
83 ladish_graph_remove_port(
84 ladish_graph_handle graph_handle,
85 ladish_port_handle port_handle);
87 uint64_t
88 ladish_graph_add_connection(
89 ladish_graph_handle graph_handle,
90 ladish_port_handle port1_handle,
91 ladish_port_handle port2_handle,
92 bool hidden);
94 void
95 ladish_graph_remove_connection(
96 ladish_graph_handle graph_handle,
97 uint64_t connection_id,
98 bool force);
100 bool
101 ladish_graph_get_connection_ports(
102 ladish_graph_handle graph_handle,
103 uint64_t connection_id,
104 ladish_port_handle * port1_handle_ptr,
105 ladish_port_handle * port2_handle_ptr);
107 bool
108 ladish_graph_find_connection(
109 ladish_graph_handle graph_handle,
110 ladish_port_handle port1_handle,
111 ladish_port_handle port2_handle,
112 uint64_t * connection_id_ptr);
114 ladish_client_handle ladish_graph_find_client_by_id(ladish_graph_handle graph_handle, uint64_t client_id);
115 ladish_port_handle ladish_graph_find_port_by_id(ladish_graph_handle graph_handle, uint64_t port_id);
116 ladish_client_handle ladish_graph_find_client_by_jack_id(ladish_graph_handle graph_handle, uint64_t client_id);
117 ladish_port_handle ladish_graph_find_port_by_jack_id(ladish_graph_handle graph_handle, uint64_t port_id);
118 ladish_client_handle ladish_graph_find_client_by_name(ladish_graph_handle graph_handle, const char * name);
119 ladish_port_handle ladish_graph_find_port_by_name(ladish_graph_handle graph_handle, ladish_client_handle client_handle, const char * name);
120 ladish_client_handle ladish_graph_find_client_by_uuid(ladish_graph_handle graph_handle, const uuid_t uuid);
121 ladish_port_handle ladish_graph_find_port_by_uuid(ladish_graph_handle graph_handle, const uuid_t uuid);
122 ladish_client_handle ladish_graph_get_port_client(ladish_graph_handle graph_handle, ladish_port_handle port_handle);
123 const char * ladish_graph_get_client_name(ladish_graph_handle graph_handle, ladish_client_handle client_handle);
124 bool ladish_graph_is_client_empty(ladish_graph_handle graph_handle, ladish_client_handle client_handle);
125 bool ladish_graph_is_client_looks_empty(ladish_graph_handle graph_handle, ladish_client_handle client_handle);
126 bool ladish_graph_is_port_present(ladish_graph_handle graph_handle, ladish_port_handle port_handle);
127 void ladish_graph_show_port(ladish_graph_handle graph_handle, ladish_port_handle port_handle);
128 void ladish_graph_hide_port(ladish_graph_handle graph_handle, ladish_port_handle port_handle);
129 void ladish_graph_show_client(ladish_graph_handle graph_handle, ladish_client_handle client_handle);
130 void ladish_graph_hide_client(ladish_graph_handle graph_handle, ladish_client_handle client_handle);
131 void ladish_graph_adjust_port(ladish_graph_handle graph_handle, ladish_port_handle port_handle, uint32_t type, uint32_t flags);
132 void ladish_graph_show_connection(ladish_graph_handle graph_handle, uint64_t connection_id);
133 void ladish_try_connect_hidden_connections(ladish_graph_handle graph_handle);
134 void ladish_graph_hide_all(ladish_graph_handle graph_handle);
136 void ladish_graph_dump(ladish_graph_handle graph_handle);
138 bool
139 ladish_graph_iterate_nodes(
140 ladish_graph_handle graph_handle,
141 void * callback_context,
142 bool
143 (* client_begin_callback)(
144 void * context,
145 ladish_client_handle client_handle,
146 const char * client_name,
147 void ** client_iteration_context_ptr_ptr),
148 bool
149 (* port_callback)(
150 void * context,
151 void * client_iteration_context_ptr,
152 ladish_client_handle client_handle,
153 const char * client_name,
154 ladish_port_handle port_handle,
155 const char * port_name,
156 uint32_t port_type,
157 uint32_t port_flags),
158 bool
159 (* client_end_callback)(
160 void * context,
161 ladish_client_handle client_handle,
162 const char * client_name,
163 void * client_iteration_context_ptr));
165 bool
166 ladish_graph_iterate_connections(
167 ladish_graph_handle graph_handle,
168 void * callback_context,
169 bool (* callback)(void * context, ladish_port_handle port1_handle, ladish_port_handle port2_handle, ladish_dict_handle dict));
171 extern const struct dbus_interface_descriptor g_interface_patchbay;
173 #endif /* #ifndef PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED */