Jack2 1.9.12

JackControlAPI.h
1 /*
2 JACK control API
3
4 Copyright (C) 2008 Nedko Arnaudov
5 Copyright (C) 2008 Grame
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; version 2 of the License.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 */
21
22 #ifndef __JackControlAPI__
23 #define __JackControlAPI__
24
25 #include "jslist.h"
26 #include "JackCompilerDeps.h"
27
29 typedef enum
30 {
31 JackParamInt = 1,
32 JackParamUInt,
33 JackParamChar,
34 JackParamString,
35 JackParamBool,
36 } jackctl_param_type_t;
37
39 typedef enum
40 {
41 JackMaster = 1,
42 JackSlave,
43 } jackctl_driver_type_t;
44
46 #define JACK_PARAM_MAX (JackParamBool + 1)
47
49 #define JACK_PARAM_STRING_MAX 127
50
52 /* intentionally similar to jack_driver_param_value_t */
53 union jackctl_parameter_value
54 {
55 uint32_t ui;
56 int32_t i;
57 char c;
58 char str[JACK_PARAM_STRING_MAX + 1];
59 bool b;
60 };
61
63 typedef struct jackctl_server jackctl_server_t;
64
66 typedef struct jackctl_driver jackctl_driver_t;
67
69 typedef struct jackctl_internal jackctl_internal_t;
70
72 typedef struct jackctl_parameter jackctl_parameter_t;
73
75 typedef struct jackctl_sigmask jackctl_sigmask_t;
76
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 #if 0
81 } /* Adjust editor indent */
82 #endif
83
84 SERVER_EXPORT jackctl_sigmask_t *
85 jackctl_setup_signals(
86 unsigned int flags);
87
88 SERVER_EXPORT void
89 jackctl_wait_signals(
90 jackctl_sigmask_t * signals);
91
92 SERVER_EXPORT jackctl_server_t *
93 jackctl_server_create(
94 bool (* on_device_acquire)(const char * device_name),
95 void (* on_device_release)(const char * device_name));
96
97 SERVER_EXPORT void
98 jackctl_server_destroy(
99 jackctl_server_t * server);
100
101 SERVER_EXPORT const JSList *
102 jackctl_server_get_drivers_list(
103 jackctl_server_t * server);
104
105 SERVER_EXPORT bool
106 jackctl_server_open(
107 jackctl_server_t * server,
108 jackctl_driver_t * driver);
109
110 SERVER_EXPORT bool
111 jackctl_server_start(
112 jackctl_server_t * server);
113
114 SERVER_EXPORT bool
115 jackctl_server_stop(
116 jackctl_server_t * server);
117
118 SERVER_EXPORT bool
119 jackctl_server_close(
120 jackctl_server_t * server);
121
122 SERVER_EXPORT const JSList *
123 jackctl_server_get_parameters(
124 jackctl_server_t * server);
125
126 SERVER_EXPORT const char *
127 jackctl_driver_get_name(
128 jackctl_driver_t * driver);
129
130 SERVER_EXPORT jackctl_driver_type_t
131 jackctl_driver_get_type(
132 jackctl_driver_t * driver);
133
134 SERVER_EXPORT const JSList *
135 jackctl_driver_get_parameters(
136 jackctl_driver_t * driver);
137
138 SERVER_EXPORT const char *
139 jackctl_parameter_get_name(
140 jackctl_parameter_t * parameter);
141
142 SERVER_EXPORT const char *
143 jackctl_parameter_get_short_description(
144 jackctl_parameter_t * parameter);
145
146 SERVER_EXPORT const char *
147 jackctl_parameter_get_long_description(
148 jackctl_parameter_t * parameter);
149
150 SERVER_EXPORT jackctl_param_type_t
151 jackctl_parameter_get_type(
152 jackctl_parameter_t * parameter);
153
154 SERVER_EXPORT char
155 jackctl_parameter_get_id(
156 jackctl_parameter_t * parameter);
157
158 SERVER_EXPORT bool
159 jackctl_parameter_is_set(
160 jackctl_parameter_t * parameter);
161
162 SERVER_EXPORT bool
163 jackctl_parameter_reset(
164 jackctl_parameter_t * parameter);
165
166 SERVER_EXPORT union jackctl_parameter_value
167 jackctl_parameter_get_value(
168 jackctl_parameter_t * parameter);
169
170 SERVER_EXPORT bool
171 jackctl_parameter_set_value(
172 jackctl_parameter_t * parameter,
173 const union jackctl_parameter_value * value_ptr);
174
175 SERVER_EXPORT union jackctl_parameter_value
176 jackctl_parameter_get_default_value(
177 jackctl_parameter_t * parameter);
178
179 SERVER_EXPORT union jackctl_parameter_value
180 jackctl_parameter_get_default_value(
181 jackctl_parameter *parameter_ptr);
182
183 SERVER_EXPORT bool
184 jackctl_parameter_has_range_constraint(
185 jackctl_parameter_t * parameter_ptr);
186
187 SERVER_EXPORT bool
188 jackctl_parameter_has_enum_constraint(
189 jackctl_parameter_t * parameter_ptr);
190
191 SERVER_EXPORT uint32_t
192 jackctl_parameter_get_enum_constraints_count(
193 jackctl_parameter_t * parameter_ptr);
194
195 SERVER_EXPORT union jackctl_parameter_value
196 jackctl_parameter_get_enum_constraint_value(
197 jackctl_parameter_t * parameter_ptr,
198 uint32_t index);
199
200 SERVER_EXPORT const char *
201 jackctl_parameter_get_enum_constraint_description(
202 jackctl_parameter_t * parameter_ptr,
203 uint32_t index);
204
205 SERVER_EXPORT void
206 jackctl_parameter_get_range_constraint(
207 jackctl_parameter_t * parameter_ptr,
208 union jackctl_parameter_value * min_ptr,
209 union jackctl_parameter_value * max_ptr);
210
211 SERVER_EXPORT bool
212 jackctl_parameter_constraint_is_strict(
213 jackctl_parameter_t * parameter_ptr);
214
215 SERVER_EXPORT bool
216 jackctl_parameter_constraint_is_fake_value(
217 jackctl_parameter_t * parameter_ptr);
218
219 SERVER_EXPORT const JSList *
220 jackctl_server_get_internals_list(
221 jackctl_server *server_ptr);
222
223 SERVER_EXPORT const char *
224 jackctl_internal_get_name(
225 jackctl_internal *internal_ptr);
226
227 SERVER_EXPORT const JSList *
228 jackctl_internal_get_parameters(
229 jackctl_internal *internal_ptr);
230
231 SERVER_EXPORT bool jackctl_server_load_internal(
232 jackctl_server * server,
233 jackctl_internal * internal);
234
235 SERVER_EXPORT bool jackctl_server_unload_internal(
236 jackctl_server * server,
237 jackctl_internal * internal);
238
239 SERVER_EXPORT bool jackctl_server_load_session_file(
240 jackctl_server * server_ptr,
241 const char * file);
242
243 SERVER_EXPORT bool jackctl_server_add_slave(jackctl_server_t * server,
244 jackctl_driver_t * driver);
245
246 SERVER_EXPORT bool jackctl_server_remove_slave(jackctl_server_t * server,
247 jackctl_driver_t * driver);
248
249 SERVER_EXPORT bool
250 jackctl_server_switch_master(jackctl_server_t * server,
251 jackctl_driver_t * driver);
252
253 SERVER_EXPORT int
254 jackctl_parse_driver_params(jackctl_driver * driver_ptr, int argc, char* argv[]);
255
256 #if 0
257 { /* Adjust editor indent */
258 #endif
259 #ifdef __cplusplus
260 } /* extern "C" */
261 #endif
262
263 #endif
264
jackctl_parameter_get_long_description
SERVER_EXPORT const char * jackctl_parameter_get_long_description(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1146
jackctl_driver_type_t
jackctl_driver_type_t
Definition: control.h:50
JackParamInt
value type is a signed integer
Definition: control.h:42
jackctl_parameter_is_set
SERVER_EXPORT bool jackctl_parameter_is_set(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1256
jackctl_parameter_get_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1261
jackctl_setup_signals
SERVER_EXPORT jackctl_sigmask_t * jackctl_setup_signals(unsigned int flags)
Definition: JackControlAPI.cpp:596
jackctl_parameter_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition: JackControlAPI.h:58
jackctl_parameter_get_default_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1302
JackParamUInt
value type is an unsigned integer
Definition: control.h:43
jackctl_server_open
SERVER_EXPORT bool jackctl_server_open(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1001
jackctl_server
Definition: JackControlAPI.cpp:61
jackctl_parameter_get_range_constraint
SERVER_EXPORT void jackctl_parameter_get_range_constraint(jackctl_parameter *parameter_ptr, union jackctl_parameter_value *min_ptr, union jackctl_parameter_value *max_ptr)
Definition: JackControlAPI.cpp:1214
JackParamChar
value type is a char
Definition: control.h:44
jackctl_server_create
SERVER_EXPORT jackctl_server_t * jackctl_server_create(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name))
Definition: JackControlAPI.cpp:744
jackctl_parameter_reset
SERVER_EXPORT bool jackctl_parameter_reset(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1272
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition: JackControlAPI.h:55
jackctl_server_switch_master
SERVER_EXPORT bool jackctl_server_switch_master(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1424
JackParamBool
value type is a boolean
Definition: control.h:46
jackctl_internal_get_name
SERVER_EXPORT const char * jackctl_internal_get_name(jackctl_internal *internal_ptr)
Definition: JackControlAPI.cpp:1320
JackMaster
master driver
Definition: control.h:52
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition: JackControlAPI.h:56
jackctl_parameter_get_name
SERVER_EXPORT const char * jackctl_parameter_get_name(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1136
jackctl_server_stop
SERVER_EXPORT bool jackctl_server_stop(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:958
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition: JackControlAPI.h:59
jackctl_parameter_value
Type for parameter value.
Definition: JackControlAPI.h:53
jackctl_driver_get_parameters
SERVER_EXPORT const JSList * jackctl_driver_get_parameters(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1126
JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition: control.h:45
jackctl_sigmask
Definition: JackControlAPI.cpp:576
jackctl_parameter_has_range_constraint
SERVER_EXPORT bool jackctl_parameter_has_range_constraint(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1151
jackctl_server_close
SERVER_EXPORT bool jackctl_server_close(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:968
jackctl_server_remove_slave
SERVER_EXPORT bool jackctl_server_remove_slave(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1401
jackctl_parameter_get_enum_constraint_description
SERVER_EXPORT const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter *parameter_ptr, uint32_t index)
Definition: JackControlAPI.cpp:1209
jackctl_server_get_internals_list
SERVER_EXPORT const JSList * jackctl_server_get_internals_list(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:1315
jackctl_parameter_get_short_description
SERVER_EXPORT const char * jackctl_parameter_get_short_description(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1141
jackctl_parameter_constraint_is_fake_value
SERVER_EXPORT bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1241
jackctl_parameter_get_type
SERVER_EXPORT jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1246
JackSlave
slave driver
Definition: control.h:53
jackctl_server_get_drivers_list
SERVER_EXPORT const JSList * jackctl_server_get_drivers_list(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:953
jackctl_server_start
SERVER_EXPORT bool jackctl_server_start(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:1100
jackctl_parameter_constraint_is_strict
SERVER_EXPORT bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1236
jackctl_parameter_get_enum_constraints_count
SERVER_EXPORT uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1161
jackctl_parameter_set_value
SERVER_EXPORT bool jackctl_parameter_set_value(jackctl_parameter *parameter_ptr, const union jackctl_parameter_value *value_ptr)
Definition: JackControlAPI.cpp:1290
jackctl_server_add_slave
SERVER_EXPORT bool jackctl_server_add_slave(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1378
JACK_PARAM_STRING_MAX
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition: control.h:60
jackctl_server_load_session_file
SERVER_EXPORT bool jackctl_server_load_session_file(jackctl_server *server_ptr, const char *file)
Definition: JackControlAPI.cpp:1367
jackctl_param_type_t
jackctl_param_type_t
Definition: control.h:40
jackctl_driver_get_name
SERVER_EXPORT const char * jackctl_driver_get_name(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1116
jackctl_parameter_get_enum_constraint_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter *parameter_ptr, uint32_t index)
Definition: JackControlAPI.cpp:1175
jackctl_server_unload_internal
SERVER_EXPORT bool jackctl_server_unload_internal(jackctl_server *server_ptr, jackctl_internal *internal)
Definition: JackControlAPI.cpp:1350
jackctl_parameter_get_id
SERVER_EXPORT char jackctl_parameter_get_id(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1251
jackctl_internal_get_parameters
SERVER_EXPORT const JSList * jackctl_internal_get_parameters(jackctl_internal *internal_ptr)
Definition: JackControlAPI.cpp:1325
jackctl_server_destroy
SERVER_EXPORT void jackctl_server_destroy(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:943
jackctl_driver_get_type
SERVER_EXPORT jackctl_driver_type_t jackctl_driver_get_type(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1121
jackctl_parameter
Definition: JackControlAPI.cpp:128
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition: JackControlAPI.h:57
jackctl_server_get_parameters
SERVER_EXPORT const JSList * jackctl_server_get_parameters(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:995
jackctl_internal
Definition: JackControlAPI.cpp:121
jackctl_parameter_has_enum_constraint
SERVER_EXPORT bool jackctl_parameter_has_enum_constraint(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1156
_JSList
Definition: linux/alsa/jslist.h:35
jackctl_wait_signals
SERVER_EXPORT void jackctl_wait_signals(jackctl_sigmask_t *sigmask)
Definition: JackControlAPI.cpp:678
jackctl_driver
Definition: JackControlAPI.cpp:114
jackctl_server_load_internal
SERVER_EXPORT bool jackctl_server_load_internal(jackctl_server *server_ptr, jackctl_internal *internal)
Definition: JackControlAPI.cpp:1330