1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009, 2010 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
33 typedef struct ladish_graph_tag
{ int unused
; } * ladish_graph_handle
;
37 (* ladish_graph_connect_request_handler
)(
39 ladish_graph_handle graph_handle
,
40 ladish_port_handle port1
,
41 ladish_port_handle port2
);
45 (* ladish_graph_disconnect_request_handler
)(
47 ladish_graph_handle graph_handle
,
48 uint64_t connection_id
);
50 typedef void (* ladish_graph_simple_port_callback
)(ladish_port_handle port_handle
);
52 bool ladish_graph_create(ladish_graph_handle
* graph_handle_ptr
, const char * opath
);
53 bool ladish_graph_copy(ladish_graph_handle src
, ladish_graph_handle dest
, bool skip_hidden
);
54 void ladish_graph_destroy(ladish_graph_handle graph_handle
);
56 const char * ladish_graph_get_opath(ladish_graph_handle graph_handle
);
57 const char * ladish_graph_get_description(ladish_graph_handle graph_handle
);
60 ladish_graph_set_connection_handlers(
61 ladish_graph_handle graph_handle
,
63 ladish_graph_connect_request_handler connect_handler
,
64 ladish_graph_disconnect_request_handler disconnect_handler
);
66 void ladish_graph_clear(ladish_graph_handle graph_handle
, ladish_graph_simple_port_callback port_callback
);
67 void * ladish_graph_get_dbus_context(ladish_graph_handle graph_handle
);
68 ladish_dict_handle
ladish_graph_get_dict(ladish_graph_handle graph_handle
);
69 ladish_dict_handle
ladish_graph_get_connection_dict(ladish_graph_handle graph_handle
, uint64_t connection_id
);
70 bool ladish_graph_add_client(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
, const char * name
, bool hidden
);
73 ladish_graph_remove_client(
74 ladish_graph_handle graph_handle
,
75 ladish_client_handle client_handle
);
78 ladish_graph_rename_client(
79 ladish_graph_handle graph_handle
,
80 ladish_client_handle client_handle
,
81 const char * new_client_name
);
84 ladish_graph_add_port(
85 ladish_graph_handle graph_handle
,
86 ladish_client_handle client_handle
,
87 ladish_port_handle port_handle
,
94 ladish_graph_remove_port(
95 ladish_graph_handle graph_handle
,
96 ladish_port_handle port_handle
);
99 ladish_graph_remove_port_by_jack_id(
100 ladish_graph_handle graph_handle
,
101 uint64_t jack_port_id
,
106 ladish_graph_rename_port(
107 ladish_graph_handle graph_handle
,
108 ladish_port_handle port_handle
,
109 const char * new_port_name
);
112 ladish_graph_add_connection(
113 ladish_graph_handle graph_handle
,
114 ladish_port_handle port1_handle
,
115 ladish_port_handle port2_handle
,
119 ladish_graph_remove_connection(
120 ladish_graph_handle graph_handle
,
121 uint64_t connection_id
,
125 ladish_graph_get_connection_ports(
126 ladish_graph_handle graph_handle
,
127 uint64_t connection_id
,
128 ladish_port_handle
* port1_handle_ptr
,
129 ladish_port_handle
* port2_handle_ptr
);
132 ladish_graph_find_connection(
133 ladish_graph_handle graph_handle
,
134 ladish_port_handle port1_handle
,
135 ladish_port_handle port2_handle
,
136 uint64_t * connection_id_ptr
);
138 ladish_client_handle
ladish_graph_find_client_by_id(ladish_graph_handle graph_handle
, uint64_t client_id
);
139 ladish_port_handle
ladish_graph_find_port_by_id(ladish_graph_handle graph_handle
, uint64_t port_id
);
140 ladish_client_handle
ladish_graph_find_client_by_jack_id(ladish_graph_handle graph_handle
, uint64_t client_id
);
141 ladish_port_handle
ladish_graph_find_port_by_jack_id(ladish_graph_handle graph_handle
, uint64_t port_id
, bool room
, bool studio
);
142 ladish_client_handle
ladish_graph_find_client_by_name(ladish_graph_handle graph_handle
, const char * name
);
143 ladish_port_handle
ladish_graph_find_port_by_name(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
, const char * name
);
144 ladish_client_handle
ladish_graph_find_client_by_uuid(ladish_graph_handle graph_handle
, const uuid_t uuid
);
145 ladish_port_handle
ladish_graph_find_port_by_uuid(ladish_graph_handle graph_handle
, const uuid_t uuid
, bool use_link_override_uuids
);
146 ladish_client_handle
ladish_graph_get_port_client(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
147 const char * ladish_graph_get_client_name(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
148 const char * ladish_graph_get_port_name(ladish_graph_handle graph
, ladish_port_handle port
);
149 bool ladish_graph_client_is_empty(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
150 bool ladish_graph_client_looks_empty(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
151 bool ladish_graph_is_port_present(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
152 void ladish_graph_show_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
153 void ladish_graph_hide_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
154 void ladish_graph_show_client(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
155 void ladish_graph_hide_client(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
156 void ladish_graph_adjust_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
, uint32_t type
, uint32_t flags
);
157 void ladish_graph_show_connection(ladish_graph_handle graph_handle
, uint64_t connection_id
);
158 void ladish_try_connect_hidden_connections(ladish_graph_handle graph_handle
);
159 void ladish_graph_hide_non_virtual(ladish_graph_handle graph_handle
);
160 void ladish_graph_get_port_uuid(ladish_graph_handle graph
, ladish_port_handle port
, uuid_t uuid_ptr
);
162 void ladish_graph_dump(ladish_graph_handle graph_handle
);
165 ladish_graph_iterate_nodes(
166 ladish_graph_handle graph_handle
,
168 void * callback_context
,
170 (* client_begin_callback
)(
172 ladish_client_handle client_handle
,
173 const char * client_name
,
174 void ** client_iteration_context_ptr_ptr
),
178 void * client_iteration_context_ptr
,
179 ladish_client_handle client_handle
,
180 const char * client_name
,
181 ladish_port_handle port_handle
,
182 const char * port_name
,
184 uint32_t port_flags
),
186 (* client_end_callback
)(
188 ladish_client_handle client_handle
,
189 const char * client_name
,
190 void * client_iteration_context_ptr
));
193 ladish_graph_iterate_connections(
194 ladish_graph_handle graph_handle
,
196 void * callback_context
,
197 bool (* callback
)(void * context
, ladish_port_handle port1_handle
, ladish_port_handle port2_handle
, ladish_dict_handle dict
));
199 void ladish_graph_clear_persist(ladish_graph_handle graph_handle
);
200 bool ladish_graph_is_persist(ladish_graph_handle graph_handle
);
201 bool ladish_graph_looks_empty(ladish_graph_handle graph_handle
);
203 extern const struct dbus_interface_descriptor g_interface_patchbay
;
205 #endif /* #ifndef PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED */