patchbay interface
[ladish.git] / jack_proxy.h
blob7a6d15ec1e380acedce1811e100b42e54e95ef5b
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 helper functionality for accessing
9 * JACK through D-Bus
10 **************************************************************************
12 * LADI Session Handler is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * LADI Session Handler is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
24 * or write to the Free Software Foundation, Inc.,
25 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28 #ifndef JACK_PROXY_H__88702EEC_4B82_407F_A664_AD70C1E14D02__INCLUDED
29 #define JACK_PROXY_H__88702EEC_4B82_407F_A664_AD70C1E14D02__INCLUDED
31 #include "common.h"
33 #define JACKDBUS_SERVICE "org.jackaudio.service"
34 #define JACKDBUS_OBJECT "/org/jackaudio/Controller"
36 struct jack_parameter_variant
38 enum
40 jack_byte,
41 jack_boolean,
42 jack_int16,
43 jack_uint16,
44 jack_int32,
45 jack_uint32,
46 jack_int64,
47 jack_uint64,
48 jack_doubl,
49 jack_string,
50 } type;
52 union
54 unsigned char byte;
55 bool boolean;
56 int16_t int16;
57 uint16_t uint16;
58 int32_t int32;
59 uint32_t uint32;
60 int64_t int64;
61 uint64_t uint64;
62 double doubl;
63 char *string;
64 } value;
67 typedef
68 void
69 (* jack_proxy_callback_server_started)(
70 void);
72 typedef
73 void
74 (* jack_proxy_callback_server_stopped)(
75 void);
77 typedef
78 void
79 (* jack_proxy_callback_server_appeared)(
80 void);
82 typedef
83 void
84 (* jack_proxy_callback_server_disappeared)(
85 void);
87 bool
88 jack_proxy_init(
89 jack_proxy_callback_server_started server_started,
90 jack_proxy_callback_server_stopped server_stopped,
91 jack_proxy_callback_server_appeared server_appeared,
92 jack_proxy_callback_server_disappeared server_disappeared);
94 void
95 jack_proxy_uninit(
96 void);
98 bool
99 jack_proxy_is_started(
100 bool * started_ptr);
102 bool jack_proxy_start_server(void);
103 bool jack_proxy_stop_server(void);
105 bool jack_proxy_is_realtime(bool * realtime_ptr);
106 bool jack_proxy_sample_rate(uint32_t * sample_rate_ptr);
107 bool jack_proxy_get_xruns(uint32_t * xruns_ptr);
108 bool jack_proxy_get_dsp_load(double * dsp_load_ptr);
109 bool jack_proxy_get_buffer_size(uint32_t * size_ptr);
110 bool jack_proxy_set_buffer_size(uint32_t size);
111 bool jack_proxy_reset_xruns(void);
113 bool
114 jack_proxy_get_client_pid(
115 uint64_t client_id,
116 pid_t * pid_ptr);
118 bool
119 jack_proxy_connect_ports(
120 uint64_t port1_id,
121 uint64_t port2_id);
123 bool
124 jack_proxy_read_conf_container(
125 const char * address,
126 void * callback_context,
127 bool (* callback)(void * context, bool leaf, const char * address, char * child));
129 bool
130 jack_proxy_get_parameter_value(
131 const char * address,
132 bool * is_set_ptr,
133 struct jack_parameter_variant * parameter_ptr);
135 #endif /* #ifndef JACK_PROXY_H__88702EEC_4B82_407F_A664_AD70C1E14D02__INCLUDED */