JACK-AUDIO-CONNECTION-KIT: control.h Source File

JACK-AUDIO-CONNECTION-KIT 0.125.0

control.h
Go to the documentation of this file.
1 /* -*- Mode: C ; c-basic-offset: 4 -*- */
2 /*
3 JACK control API
4
5 Copyright (C) 2008 Nedko Arnaudov
6 Copyright (C) 2008 GRAME
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; version 2 of the License.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 */
29 #ifndef __jack_control_h__
30 #define __jack_control_h__
31
32 #include <jack/jslist.h>
33
34 #if !defined (__sun__)
35 #include <stdbool.h>
36 #endif
37
39 typedef enum
40 {
41 JackParamInt = 1,
42 JackParamUInt,
43 JackParamChar,
44 JackParamString,
45 JackParamBool,
46 } jackctl_param_type_t;
47
49 #define JACK_PARAM_MAX (JackParamBool + 1)
50
52 #define JACK_PARAM_STRING_MAX 127
53
55 /* intentionally similar to jack_driver_param_value_t */
56 union jackctl_parameter_value
57 {
58 uint32_t ui;
59 int32_t i;
60 char c;
61 char str[JACK_PARAM_STRING_MAX + 1];
62 bool b;
63 };
64
66 typedef struct jackctl_server jackctl_server_t;
67
69 typedef struct jackctl_driver jackctl_driver_t;
70
72 typedef struct jackctl_internal jackctl_internal_t;
73
75 typedef struct jackctl_parameter jackctl_parameter_t;
76
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 #if 0
81 } /* Adjust editor indent */
82 #endif
83
98 sigset_t
99 jackctl_setup_signals(
100 unsigned int flags);
101
107 void
108 jackctl_wait_signals(
109 sigset_t signals);
110
121 jackctl_server_t *
122 jackctl_server_create(
123 bool (* on_device_acquire)(const char * device_name),
124 void (* on_device_release)(const char * device_name));
125
131 void
132 jackctl_server_destroy(
133 jackctl_server_t * server);
134
143 bool
144 jackctl_server_start(
145 jackctl_server_t * server,
146 jackctl_driver_t * driver);
147
155 bool
156 jackctl_server_stop(
157 jackctl_server_t * server);
158
168 const JSList *
169 jackctl_server_get_drivers_list(
170 jackctl_server_t * server);
171
181 const JSList *
182 jackctl_server_get_parameters(
183 jackctl_server_t * server);
184
194 const JSList *
195 jackctl_server_get_internals_list(
196 jackctl_server_t * server);
197
206 bool
207 jackctl_server_load_internal(
208 jackctl_server_t * server,
209 jackctl_internal_t * internal);
210
219 bool
220 jackctl_server_unload_internal(
221 jackctl_server_t * server,
222 jackctl_internal_t * internal);
223
232 bool
233 jackctl_server_add_slave(jackctl_server_t * server,
234 jackctl_driver_t * driver);
235
244 bool
245 jackctl_server_remove_slave(jackctl_server_t * server,
246 jackctl_driver_t * driver);
247
256 bool
257 jackctl_server_switch_master(jackctl_server_t * server,
258 jackctl_driver_t * driver);
259
260
269 const char *
270 jackctl_driver_get_name(
271 jackctl_driver_t * driver);
272
282 const JSList *
283 jackctl_driver_get_parameters(
284 jackctl_driver_t * driver);
285
294 const char *
295 jackctl_internal_get_name(
296 jackctl_internal_t * internal);
297
307 const JSList *
308 jackctl_internal_get_parameters(
309 jackctl_internal_t * internal);
310
319 const char *
320 jackctl_parameter_get_name(
321 jackctl_parameter_t * parameter);
322
331 const char *
332 jackctl_parameter_get_short_description(
333 jackctl_parameter_t * parameter);
334
343 const char *
344 jackctl_parameter_get_long_description(
345 jackctl_parameter_t * parameter);
346
354 jackctl_param_type_t
355 jackctl_parameter_get_type(
356 jackctl_parameter_t * parameter);
357
365 char
366 jackctl_parameter_get_id(
367 jackctl_parameter_t * parameter);
368
378 bool
379 jackctl_parameter_is_set(
380 jackctl_parameter_t * parameter);
381
389 bool
390 jackctl_parameter_reset(
391 jackctl_parameter_t * parameter);
392
400 union jackctl_parameter_value
401 jackctl_parameter_get_value(
402 jackctl_parameter_t * parameter);
403
412 bool
413 jackctl_parameter_set_value(
414 jackctl_parameter_t * parameter,
415 const union jackctl_parameter_value * value_ptr);
416
424 union jackctl_parameter_value
425 jackctl_parameter_get_default_value(
426 jackctl_parameter_t * parameter);
427
435 bool
436 jackctl_parameter_has_range_constraint(
437 jackctl_parameter_t * parameter);
438
446 bool
447 jackctl_parameter_has_enum_constraint(
448 jackctl_parameter_t * parameter);
449
457 uint32_t
458 jackctl_parameter_get_enum_constraints_count(
459 jackctl_parameter_t * parameter);
460
469 union jackctl_parameter_value
470 jackctl_parameter_get_enum_constraint_value(
471 jackctl_parameter_t * parameter,
472 uint32_t index);
473
482 const char *
483 jackctl_parameter_get_enum_constraint_description(
484 jackctl_parameter_t * parameter,
485 uint32_t index);
486
494 void
495 jackctl_parameter_get_range_constraint(
496 jackctl_parameter_t * parameter,
497 union jackctl_parameter_value * min_ptr,
498 union jackctl_parameter_value * max_ptr);
499
508 bool
509 jackctl_parameter_constraint_is_strict(
510 jackctl_parameter_t * parameter);
511
521 bool
522 jackctl_parameter_constraint_is_fake_value(
523 jackctl_parameter_t * parameter);
524
530 void
531 jack_error(
532 const char *format,
533 ...);
534
540 void
541 jack_info(
542 const char *format,
543 ...);
544
551 void
552 jack_log(
553 const char *format,
554 ...);
555
556 /* @} */
557
558 #if 0
559 { /* Adjust editor indent */
560 #endif
561 #ifdef __cplusplus
562 } /* extern "C" */
563 #endif
564
565 #endif /* __jack_control_h__ */
jackctl_server_switch_master
bool jackctl_server_switch_master(jackctl_server_t *server, jackctl_driver_t *driver)
jack_log
void jack_log(const char *format,...)
jackctl_server_t
struct jackctl_server jackctl_server_t
Definition: control.h:66
jackctl_server_unload_internal
bool jackctl_server_unload_internal(jackctl_server_t *server, jackctl_internal_t *internal)
jackctl_parameter_get_long_description
const char * jackctl_parameter_get_long_description(jackctl_parameter_t *parameter)
jackctl_parameter_constraint_is_strict
bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter)
jackctl_driver_get_parameters
const JSList * jackctl_driver_get_parameters(jackctl_driver_t *driver)
jackctl_parameter_get_enum_constraint_description
const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter_t *parameter, uint32_t index)
JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition: control.h:44
jackctl_parameter_constraint_is_fake_value
bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter)
jackctl_server_add_slave
bool jackctl_server_add_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_internal_t
struct jackctl_internal jackctl_internal_t
Definition: control.h:72
jackctl_parameter_get_type
jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter_t *parameter)
jackctl_driver_get_name
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition: control.h:59
jackctl_server_get_drivers_list
const JSList * jackctl_server_get_drivers_list(jackctl_server_t *server)
jack_error
void jack_error(const char *format,...)
jackctl_parameter_reset
bool jackctl_parameter_reset(jackctl_parameter_t *parameter)
jackctl_server_get_internals_list
const JSList * jackctl_server_get_internals_list(jackctl_server_t *server)
jackctl_parameter_get_short_description
const char * jackctl_parameter_get_short_description(jackctl_parameter_t *parameter)
jackctl_parameter_set_value
bool jackctl_parameter_set_value(jackctl_parameter_t *parameter, const union jackctl_parameter_value *value_ptr)
jackctl_setup_signals
sigset_t jackctl_setup_signals(unsigned int flags)
JackParamInt
value type is a signed integer
Definition: control.h:41
jackctl_parameter_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition: control.h:61
jackctl_server_load_internal
bool jackctl_server_load_internal(jackctl_server_t *server, jackctl_internal_t *internal)
JackParamChar
value type is a char
Definition: control.h:43
jackctl_parameter_get_enum_constraint_value
union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter_t *parameter, uint32_t index)
JackParamUInt
value type is an unsigned integer
Definition: control.h:42
jackctl_internal_get_parameters
const JSList * jackctl_internal_get_parameters(jackctl_internal_t *internal)
jackctl_driver_t
struct jackctl_driver jackctl_driver_t
Definition: control.h:69
jackctl_server_stop
bool jackctl_server_stop(jackctl_server_t *server)
jackctl_server_destroy
void jackctl_server_destroy(jackctl_server_t *server)
jackctl_server_get_parameters
const JSList * jackctl_server_get_parameters(jackctl_server_t *server)
jackctl_parameter_has_enum_constraint
bool jackctl_parameter_has_enum_constraint(jackctl_parameter_t *parameter)
jackctl_parameter_value
Type for parameter value.
Definition: control.h:56
jackctl_wait_signals
void jackctl_wait_signals(sigset_t signals)
JackParamBool
value type is a boolean
Definition: control.h:45
JACK_PARAM_STRING_MAX
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition: control.h:52
jackctl_parameter_get_id
char jackctl_parameter_get_id(jackctl_parameter_t *parameter)
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition: control.h:62
jackctl_parameter_get_name
const char * jackctl_parameter_get_name(jackctl_parameter_t *parameter)
jackctl_server_create
jackctl_server_t * jackctl_server_create(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name))
jackctl_server_remove_slave
bool jackctl_server_remove_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_has_range_constraint
bool jackctl_parameter_has_range_constraint(jackctl_parameter_t *parameter)
jackctl_parameter_is_set
bool jackctl_parameter_is_set(jackctl_parameter_t *parameter)
jackctl_parameter_get_value
union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter_t *parameter)
jackctl_parameter_get_default_value
union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter_t *parameter)
jackctl_server_start
bool jackctl_server_start(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_internal_get_name
const char * jackctl_internal_get_name(jackctl_internal_t *internal)
jackctl_param_type_t
jackctl_param_type_t
Definition: control.h:39
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition: control.h:58
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition: control.h:60
jackctl_parameter_get_range_constraint
void jackctl_parameter_get_range_constraint(jackctl_parameter_t *parameter, union jackctl_parameter_value *min_ptr, union jackctl_parameter_value *max_ptr)
jackctl_parameter_get_enum_constraints_count
uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter_t *parameter)
jackctl_parameter_t
struct jackctl_parameter jackctl_parameter_t
Definition: control.h:75
jack_info
void jack_info(const char *format,...)