Jack2 1.9.12

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 JACKCTL_H__2EEDAD78_DF4C_4B26_83B7_4FF1A446A47E__INCLUDED
30 #define JACKCTL_H__2EEDAD78_DF4C_4B26_83B7_4FF1A446A47E__INCLUDED
31
32 #include <jack/types.h>
33 #include <jack/jslist.h>
34 #include <jack/systemdeps.h>
35 #if !defined(sun) && !defined(__sun__)
36 #include <stdbool.h>
37 #endif
38
40 typedef enum
41 {
42 JackParamInt = 1,
43 JackParamUInt,
44 JackParamChar,
45 JackParamString,
46 JackParamBool,
47 } jackctl_param_type_t;
48
50 typedef enum
51 {
52 JackMaster = 1,
53 JackSlave
54 } jackctl_driver_type_t;
55
57 #define JACK_PARAM_MAX (JackParamBool + 1)
58
60 #define JACK_PARAM_STRING_MAX 127
61
63 /* intentionally similar to jack_driver_param_value_t */
64 union jackctl_parameter_value
65 {
66 uint32_t ui;
67 int32_t i;
68 char c;
69 char str[JACK_PARAM_STRING_MAX + 1];
70 bool b;
71 };
72
74 typedef struct jackctl_server jackctl_server_t;
75
77 typedef struct jackctl_driver jackctl_driver_t;
78
80 typedef struct jackctl_internal jackctl_internal_t;
81
83 typedef struct jackctl_parameter jackctl_parameter_t;
84
86 typedef struct jackctl_sigmask jackctl_sigmask_t;
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif
91 #if 0
92 } /* Adjust editor indent */
93 #endif
94
109 jackctl_sigmask_t *
110 jackctl_setup_signals(
111 unsigned int flags);
112
118 void
119 jackctl_wait_signals(
120 jackctl_sigmask_t * signals);
121
132 jackctl_server_t *
133 jackctl_server_create(
134 bool (* on_device_acquire)(const char * device_name),
135 void (* on_device_release)(const char * device_name));
136
142 void
143 jackctl_server_destroy(
144 jackctl_server_t * server);
145
154 bool
155 jackctl_server_open(
156 jackctl_server_t * server,
157 jackctl_driver_t * driver);
158
166 bool
167 jackctl_server_start(
168 jackctl_server_t * server);
169
177 bool
178 jackctl_server_stop(
179 jackctl_server_t * server);
180
188 bool
189 jackctl_server_close(
190 jackctl_server_t * server);
191
201 const JSList *
202 jackctl_server_get_drivers_list(
203 jackctl_server_t * server);
204
214 const JSList *
215 jackctl_server_get_parameters(
216 jackctl_server_t * server);
217
227 const JSList *
228 jackctl_server_get_internals_list(
229 jackctl_server_t * server);
230
240 bool
241 jackctl_server_load_internal(
242 jackctl_server_t * server,
243 jackctl_internal_t * internal);
244
254 bool
255 jackctl_server_unload_internal(
256 jackctl_server_t * server,
257 jackctl_internal_t * internal);
258
269 bool jackctl_server_load_session_file(
270 jackctl_server_t * server_ptr,
271 const char * file);
272
283 bool
284 jackctl_server_add_slave(jackctl_server_t * server,
285 jackctl_driver_t * driver);
286
297 bool
298 jackctl_server_remove_slave(jackctl_server_t * server,
299 jackctl_driver_t * driver);
300
309 bool
310 jackctl_server_switch_master(jackctl_server_t * server,
311 jackctl_driver_t * driver);
312
313
322 const char *
323 jackctl_driver_get_name(
324 jackctl_driver_t * driver);
325
334 jackctl_driver_type_t
335 jackctl_driver_get_type(
336 jackctl_driver_t * driver);
337
347 const JSList *
348 jackctl_driver_get_parameters(
349 jackctl_driver_t * driver);
350
360 int
361 jackctl_driver_params_parse(
362 jackctl_driver_t * driver,
363 int argc,
364 char* argv[]);
365
374 const char *
375 jackctl_internal_get_name(
376 jackctl_internal_t * internal);
377
387 const JSList *
388 jackctl_internal_get_parameters(
389 jackctl_internal_t * internal);
390
399 const char *
400 jackctl_parameter_get_name(
401 jackctl_parameter_t * parameter);
402
411 const char *
412 jackctl_parameter_get_short_description(
413 jackctl_parameter_t * parameter);
414
423 const char *
424 jackctl_parameter_get_long_description(
425 jackctl_parameter_t * parameter);
426
434 jackctl_param_type_t
435 jackctl_parameter_get_type(
436 jackctl_parameter_t * parameter);
437
445 char
446 jackctl_parameter_get_id(
447 jackctl_parameter_t * parameter);
448
458 bool
459 jackctl_parameter_is_set(
460 jackctl_parameter_t * parameter);
461
469 bool
470 jackctl_parameter_reset(
471 jackctl_parameter_t * parameter);
472
480 union jackctl_parameter_value
481 jackctl_parameter_get_value(
482 jackctl_parameter_t * parameter);
483
492 bool
493 jackctl_parameter_set_value(
494 jackctl_parameter_t * parameter,
495 const union jackctl_parameter_value * value_ptr);
496
504 union jackctl_parameter_value
505 jackctl_parameter_get_default_value(
506 jackctl_parameter_t * parameter);
507
515 bool
516 jackctl_parameter_has_range_constraint(
517 jackctl_parameter_t * parameter);
518
526 bool
527 jackctl_parameter_has_enum_constraint(
528 jackctl_parameter_t * parameter);
529
537 uint32_t
538 jackctl_parameter_get_enum_constraints_count(
539 jackctl_parameter_t * parameter);
540
549 union jackctl_parameter_value
550 jackctl_parameter_get_enum_constraint_value(
551 jackctl_parameter_t * parameter,
552 uint32_t index);
553
562 const char *
563 jackctl_parameter_get_enum_constraint_description(
564 jackctl_parameter_t * parameter,
565 uint32_t index);
566
574 void
575 jackctl_parameter_get_range_constraint(
576 jackctl_parameter_t * parameter,
577 union jackctl_parameter_value * min_ptr,
578 union jackctl_parameter_value * max_ptr);
579
588 bool
589 jackctl_parameter_constraint_is_strict(
590 jackctl_parameter_t * parameter);
591
601 bool
602 jackctl_parameter_constraint_is_fake_value(
603 jackctl_parameter_t * parameter);
604
610 void
611 jack_error(
612 const char *format,
613 ...);
614
620 void
621 jack_info(
622 const char *format,
623 ...);
624
631 void
632 jack_log(
633 const char *format,
634 ...);
635
636 /* @} */
637
638 #if 0
639 { /* Adjust editor indent */
640 #endif
641 #ifdef __cplusplus
642 } /* extern "C" */
643 #endif
644
645 #endif /* #ifndef JACKCTL_H__2EEDAD78_DF4C_4B26_83B7_4FF1A446A47E__INCLUDED */
jackctl_parameter_get_long_description
const char * jackctl_parameter_get_long_description(jackctl_parameter_t *parameter)
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_driver_params_parse
int jackctl_driver_params_parse(jackctl_driver_t *driver, int argc, char *argv[])
Definition: JackDriverLoader.cpp:264
jackctl_parameter_is_set
bool jackctl_parameter_is_set(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1256
jackctl_parameter_get_value
union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1261
jackctl_setup_signals
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
union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1302
JackParamUInt
value type is an unsigned integer
Definition: control.h:43
jackctl_server_open
bool jackctl_server_open(jackctl_server_t *server, jackctl_driver_t *driver)
Definition: JackControlAPI.cpp:1001
jackctl_server
Definition: JackControlAPI.cpp:61
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)
Definition: JackControlAPI.cpp:1214
JackParamChar
value type is a char
Definition: control.h:44
jack_error
void jack_error(const char *format,...)
Definition: JackError.cpp:92
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))
Definition: JackControlAPI.cpp:744
jackctl_parameter_reset
bool jackctl_parameter_reset(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1272
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition: JackControlAPI.h:55
jack_info
void jack_info(const char *format,...)
Definition: JackError.cpp:100
jackctl_server_switch_master
bool jackctl_server_switch_master(jackctl_server_t *server, jackctl_driver_t *driver)
Definition: JackControlAPI.cpp:1424
JackParamBool
value type is a boolean
Definition: control.h:46
jackctl_internal_get_name
const char * jackctl_internal_get_name(jackctl_internal_t *internal)
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
const char * jackctl_parameter_get_name(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1136
jackctl_server_stop
bool jackctl_server_stop(jackctl_server_t *server)
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
const JSList * jackctl_driver_get_parameters(jackctl_driver_t *driver)
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
bool jackctl_parameter_has_range_constraint(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1151
jackctl_server_close
bool jackctl_server_close(jackctl_server_t *server)
Definition: JackControlAPI.cpp:968
jackctl_server_remove_slave
bool jackctl_server_remove_slave(jackctl_server_t *server, jackctl_driver_t *driver)
Definition: JackControlAPI.cpp:1401
jackctl_parameter_get_enum_constraint_description
const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter_t *parameter, uint32_t index)
Definition: JackControlAPI.cpp:1209
jackctl_server_get_internals_list
const JSList * jackctl_server_get_internals_list(jackctl_server_t *server)
Definition: JackControlAPI.cpp:1315
jackctl_parameter_get_short_description
const char * jackctl_parameter_get_short_description(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1141
jackctl_parameter_constraint_is_fake_value
bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1241
jackctl_parameter_get_type
jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1246
JackSlave
slave driver
Definition: control.h:53
jackctl_server_get_drivers_list
const JSList * jackctl_server_get_drivers_list(jackctl_server_t *server)
Definition: JackControlAPI.cpp:953
jackctl_server_start
bool jackctl_server_start(jackctl_server_t *server)
Definition: JackControlAPI.cpp:1100
jackctl_parameter_constraint_is_strict
bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1236
jackctl_parameter_get_enum_constraints_count
uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1161
jackctl_parameter_set_value
bool jackctl_parameter_set_value(jackctl_parameter_t *parameter, const union jackctl_parameter_value *value_ptr)
Definition: JackControlAPI.cpp:1290
jackctl_server_add_slave
bool jackctl_server_add_slave(jackctl_server_t *server, jackctl_driver_t *driver)
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
bool jackctl_server_load_session_file(jackctl_server_t *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
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
Definition: JackControlAPI.cpp:1116
jackctl_parameter_get_enum_constraint_value
union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter_t *parameter, uint32_t index)
Definition: JackControlAPI.cpp:1175
jackctl_server_unload_internal
bool jackctl_server_unload_internal(jackctl_server_t *server, jackctl_internal_t *internal)
Definition: JackControlAPI.cpp:1350
jackctl_parameter_get_id
char jackctl_parameter_get_id(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1251
jackctl_internal_get_parameters
const JSList * jackctl_internal_get_parameters(jackctl_internal_t *internal)
Definition: JackControlAPI.cpp:1325
jackctl_server_destroy
void jackctl_server_destroy(jackctl_server_t *server)
Definition: JackControlAPI.cpp:943
jackctl_driver_get_type
jackctl_driver_type_t jackctl_driver_get_type(jackctl_driver_t *driver)
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
const JSList * jackctl_server_get_parameters(jackctl_server_t *server)
Definition: JackControlAPI.cpp:995
jackctl_internal
Definition: JackControlAPI.cpp:121
jackctl_parameter_has_enum_constraint
bool jackctl_parameter_has_enum_constraint(jackctl_parameter_t *parameter)
Definition: JackControlAPI.cpp:1156
_JSList
Definition: linux/alsa/jslist.h:35
jackctl_wait_signals
void jackctl_wait_signals(jackctl_sigmask_t *signals)
Definition: JackControlAPI.cpp:678
jack_log
void jack_log(const char *format,...)
Definition: JackError.cpp:108
jackctl_driver
Definition: JackControlAPI.cpp:114
jackctl_server_load_internal
bool jackctl_server_load_internal(jackctl_server_t *server, jackctl_internal_t *internal)
Definition: JackControlAPI.cpp:1330