Merge branch 'stable' into branch 'main'
[ladish.git] / proxies / jack_proxy.h
blob6a8bc8a9c284f6bf475425638bf44c31aa207a41
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009,2010,2011 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 struct jack_parameter_variant
35 enum
37 jack_byte,
38 jack_boolean,
39 jack_int16,
40 jack_uint16,
41 jack_int32,
42 jack_uint32,
43 jack_int64,
44 jack_uint64,
45 jack_doubl,
46 jack_string,
47 } type;
49 union
51 unsigned char byte;
52 bool boolean;
53 int16_t int16;
54 uint16_t uint16;
55 int32_t int32;
56 uint32_t uint32;
57 int64_t int64;
58 uint64_t uint64;
59 double doubl;
60 char *string;
61 } value;
64 typedef
65 void
66 (* jack_proxy_callback_server_started)(
67 void);
69 typedef
70 void
71 (* jack_proxy_callback_server_stopped)(
72 void);
74 typedef
75 void
76 (* jack_proxy_callback_server_appeared)(
77 void);
79 typedef
80 void
81 (* jack_proxy_callback_server_disappeared)(
82 void);
84 bool
85 jack_proxy_init(
86 jack_proxy_callback_server_started server_started,
87 jack_proxy_callback_server_stopped server_stopped,
88 jack_proxy_callback_server_appeared server_appeared,
89 jack_proxy_callback_server_disappeared server_disappeared);
91 void
92 jack_proxy_uninit(
93 void);
95 bool
96 jack_proxy_is_started(
97 bool * started_ptr);
99 bool jack_proxy_start_server(void);
100 bool jack_proxy_stop_server(void);
102 bool jack_proxy_is_realtime(bool * realtime_ptr);
103 bool jack_proxy_sample_rate(uint32_t * sample_rate_ptr);
104 bool jack_proxy_get_xruns(uint32_t * xruns_ptr);
105 bool jack_proxy_get_dsp_load(double * dsp_load_ptr);
106 bool jack_proxy_get_buffer_size(uint32_t * size_ptr);
107 bool jack_proxy_set_buffer_size(uint32_t size);
108 bool jack_proxy_reset_xruns(void);
110 bool
111 jack_proxy_connect_ports(
112 uint64_t port1_id,
113 uint64_t port2_id);
115 bool
116 jack_proxy_read_conf_container(
117 const char * address,
118 void * callback_context,
119 bool (* callback)(void * context, bool leaf, const char * address, char * child));
121 bool
122 jack_proxy_get_parameter_value(
123 const char * address,
124 bool * is_set_ptr,
125 struct jack_parameter_variant * parameter_ptr);
127 bool
128 jack_proxy_set_parameter_value(
129 const char * address,
130 const struct jack_parameter_variant * parameter_ptr);
132 bool
133 jack_proxy_reset_parameter_value(
134 const char * address);
136 bool jack_reset_all_params(void);
138 bool
139 jack_proxy_session_save_one(
140 bool queue,
141 const char * target,
142 const char * path,
143 void * callback_context,
144 void (* completion_callback)(
145 void * context,
146 const char * commandline));
148 bool
149 jack_proxy_session_has_callback(
150 const char * client,
151 bool * has_callback_ptr);
153 bool jack_proxy_exit(void);
155 #endif /* #ifndef JACK_PROXY_H__88702EEC_4B82_407F_A664_AD70C1E14D02__INCLUDED */