1 /* -*- Mode: C ; c-basic-offset: 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
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 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
);
54 ladish_graph_set_connection_handlers(
55 ladish_graph_handle graph_handle
,
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
);
67 ladish_graph_remove_client(
68 ladish_graph_handle graph_handle
,
69 ladish_client_handle client_handle
,
73 ladish_graph_add_port(
74 ladish_graph_handle graph_handle
,
75 ladish_client_handle client_handle
,
76 ladish_port_handle port_handle
,
83 ladish_graph_remove_port(
84 ladish_graph_handle graph_handle
,
85 ladish_port_handle port_handle
);
88 ladish_graph_add_connection(
89 ladish_graph_handle graph_handle
,
90 ladish_port_handle port1_handle
,
91 ladish_port_handle port2_handle
,
95 ladish_graph_remove_connection(
96 ladish_graph_handle graph_handle
,
97 uint64_t connection_id
);
100 ladish_graph_get_connection_ports(
101 ladish_graph_handle graph_handle
,
102 uint64_t connection_id
,
103 ladish_port_handle
* port1_handle_ptr
,
104 ladish_port_handle
* port2_handle_ptr
);
107 ladish_graph_find_connection(
108 ladish_graph_handle graph_handle
,
109 ladish_port_handle port1_handle
,
110 ladish_port_handle port2_handle
,
111 uint64_t * connection_id_ptr
);
113 ladish_client_handle
ladish_graph_find_client_by_id(ladish_graph_handle graph_handle
, uint64_t client_id
);
114 ladish_port_handle
ladish_graph_find_port_by_id(ladish_graph_handle graph_handle
, uint64_t port_id
);
115 ladish_client_handle
ladish_graph_find_client_by_jack_id(ladish_graph_handle graph_handle
, uint64_t client_id
);
116 ladish_port_handle
ladish_graph_find_port_by_jack_id(ladish_graph_handle graph_handle
, uint64_t port_id
);
117 ladish_client_handle
ladish_graph_find_client_by_name(ladish_graph_handle graph_handle
, const char * name
);
118 ladish_port_handle
ladish_graph_find_port_by_name(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
, const char * name
);
119 ladish_client_handle
ladish_graph_find_client_by_uuid(ladish_graph_handle graph_handle
, const uuid_t uuid
);
120 ladish_port_handle
ladish_graph_find_port_by_uuid(ladish_graph_handle graph_handle
, const uuid_t uuid
);
121 ladish_client_handle
ladish_graph_get_port_client(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
122 const char * ladish_graph_get_client_name(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
123 bool ladish_graph_is_client_empty(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
124 bool ladish_graph_is_client_looks_empty(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
125 bool ladish_graph_is_port_present(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
126 void ladish_graph_show_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
127 void ladish_graph_hide_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
);
128 void ladish_graph_show_client(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
129 void ladish_graph_hide_client(ladish_graph_handle graph_handle
, ladish_client_handle client_handle
);
130 void ladish_graph_adjust_port(ladish_graph_handle graph_handle
, ladish_port_handle port_handle
, uint32_t type
, uint32_t flags
);
131 void ladish_graph_show_connection(ladish_graph_handle graph_handle
, uint64_t connection_id
);
132 void ladish_try_connect_hidden_connections(ladish_graph_handle graph_handle
);
134 void ladish_graph_dump(ladish_graph_handle graph_handle
);
137 ladish_graph_iterate_nodes(
138 ladish_graph_handle graph_handle
,
139 void * callback_context
,
141 (* client_begin_callback
)(
143 ladish_client_handle client_handle
,
144 const char * client_name
,
145 void ** client_iteration_context_ptr_ptr
),
149 void * client_iteration_context_ptr
,
150 ladish_client_handle client_handle
,
151 const char * client_name
,
152 ladish_port_handle port_handle
,
153 const char * port_name
,
155 uint32_t port_flags
),
157 (* client_end_callback
)(
159 ladish_client_handle client_handle
,
160 const char * client_name
,
161 void * client_iteration_context_ptr
));
164 ladish_graph_iterate_connections(
165 ladish_graph_handle graph_handle
,
166 void * callback_context
,
167 bool (* callback
)(void * context
, ladish_port_handle port1_handle
, ladish_port_handle port2_handle
, ladish_dict_handle dict
));
169 extern const struct dbus_interface_descriptor g_interface_patchbay
;
171 #endif /* #ifndef PATCHBAY_H__30334B9A_8847_4E8C_AFF9_73DB13406C8E__INCLUDED */