jackdbus: implement session command queue
[jack2.git] / dbus / controller_internal.h
blob9dbce2e3e2a59665dfb6478d76fc186db975f7f8
1 /* -*- Mode: C ; c-basic-offset: 4 -*- */
2 /*
3 Copyright (C) 2007,2008,2011 Nedko Arnaudov
4 Copyright (C) 2007-2008 Juuso Alasuutari
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
22 #define CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED
24 #include <stdbool.h>
25 #include "jslist.h"
26 #include "jack/control.h"
27 #include "jack/jack.h"
28 #include "jack/session.h"
29 #include "jackdbus.h"
30 #include "list.h"
31 #include "params.h"
33 struct jack_controller_slave_driver
35 struct list_head siblings;
36 char * name;
37 jackctl_driver_t * handle;
38 bool loaded;
41 struct jack_session_pending_command
43 struct list_head siblings;
44 DBusConnection * connection;
45 DBusMessage * message;
46 jack_session_event_type_t type;
47 const char * target;
48 const char * path;
51 struct jack_controller
53 jackctl_server_t *server;
54 jack_params_handle params;
56 void *patchbay_context;
58 bool started;
59 jack_client_t *client;
60 unsigned int xruns;
62 struct list_head slave_drivers;
63 bool slave_drivers_set;
64 struct jack_parameter slave_drivers_vparam;
65 union jackctl_parameter_value slave_drivers_vparam_value;
67 struct jack_dbus_object_descriptor dbus_descriptor;
69 pthread_mutex_t lock;
70 struct list_head session_pending_commands;
73 #define DEFAULT_DRIVER "dummy"
75 #define JACK_CONF_HEADER_TEXT \
76 "JACK settings, as persisted by D-Bus object.\n" \
77 "You probably don't want to edit this because\n" \
78 "it will be overwritten next time jackdbus saves.\n"
80 bool
81 jack_controller_start_server(
82 struct jack_controller *controller_ptr,
83 void *dbus_call_context_ptr);
85 bool
86 jack_controller_stop_server(
87 struct jack_controller *controller_ptr,
88 void *dbus_call_context_ptr);
90 bool
91 jack_controller_switch_master(
92 struct jack_controller *controller_ptr,
93 void *dbus_call_context_ptr);
95 bool
96 jack_controller_add_slave_driver(
97 struct jack_controller *controller_ptr,
98 const char * driver_name);
100 bool
101 jack_controller_remove_slave_driver(
102 struct jack_controller *controller_ptr,
103 const char * driver_name);
105 bool
106 jack_controller_select_driver(
107 struct jack_controller *controller_ptr,
108 const char * driver_name);
110 bool
111 jack_controller_load_internal(
112 struct jack_controller *controller_ptr,
113 const char * internal_name);
115 bool
116 jack_controller_unload_internal(
117 struct jack_controller *controller_ptr,
118 const char * internal_name);
120 void
121 jack_controller_deserialize_parameter_value(
122 struct jack_controller *controller_ptr,
123 const char * const * address,
124 const char * value);
126 void
127 jack_controller_serialize_parameter_value(
128 const struct jack_parameter * param_ptr,
129 char * value_buffer);
131 bool
132 jack_controller_patchbay_init(
133 struct jack_controller *controller_ptr);
135 void
136 jack_controller_patchbay_uninit(
137 struct jack_controller *controller_ptr);
139 void *
140 jack_controller_patchbay_client_appeared_callback(
141 void * server_context,
142 uint64_t client_id,
143 const char *client_name);
145 void
146 jack_controller_patchbay_client_disappeared_callback(
147 void *server_context,
148 uint64_t client_id,
149 void *client_context);
151 void *
152 jack_controller_patchbay_port_appeared_callback(
153 void *server_context,
154 uint64_t client_id,
155 void *client_context,
156 uint64_t port_id,
157 const char *port_name,
158 uint32_t port_flags,
159 uint32_t port_type);
161 void
162 jack_controller_patchbay_port_disappeared_callback(
163 void *server_context,
164 uint64_t client_id,
165 void *client_context,
166 uint64_t port_id,
167 void *port_context);
169 void *
170 jack_controller_patchbay_ports_connected_callback(
171 void *server_context,
172 uint64_t client1_id,
173 void *client1_context,
174 uint64_t port1_id,
175 void *port1_context,
176 uint64_t client2_id,
177 void *client2_context,
178 uint64_t port2_id,
179 void *port2_context,
180 uint64_t connection_id);
182 void
183 jack_controller_patchbay_ports_disconnected_callback(
184 void *server_context,
185 uint64_t client1_id,
186 void *client1_context,
187 uint64_t port1_id,
188 void *port1_context,
189 uint64_t client2_id,
190 void *client2_context,
191 uint64_t port2_id,
192 void *port2_context,
193 uint64_t connection_id,
194 void *connection_context);
196 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_introspectable;
197 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_control;
198 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_configure;
199 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_patchbay;
200 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_session_manager;
201 extern struct jack_dbus_interface_descriptor g_jack_controller_iface_transport;
203 #endif /* #ifndef CONTROLLER_INTERNAL_H__04D54D51_3D79_49A2_A1DA_F8587E9E7F42__INCLUDED */