ladishd: stop apps on studio stop
[ladish.git] / jack_proxy.h
blob15b9707caea9bcc2e7518f13c109a5cc27a57fa8
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 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_get_client_pid(
112 uint64_t client_id,
113 pid_t * pid_ptr);
115 bool
116 jack_proxy_connect_ports(
117 uint64_t port1_id,
118 uint64_t port2_id);
120 bool
121 jack_proxy_read_conf_container(
122 const char * address,
123 void * callback_context,
124 bool (* callback)(void * context, bool leaf, const char * address, char * child));
126 bool
127 jack_proxy_get_parameter_value(
128 const char * address,
129 bool * is_set_ptr,
130 struct jack_parameter_variant * parameter_ptr);
132 bool
133 jack_proxy_set_parameter_value(
134 const char * address,
135 const struct jack_parameter_variant * parameter_ptr);
137 bool
138 jack_proxy_reset_parameter_value(
139 const char * address);
141 bool jack_reset_all_params(void);
143 #endif /* #ifndef JACK_PROXY_H__88702EEC_4B82_407F_A664_AD70C1E14D02__INCLUDED */