Jack2 1.9.21

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
128 jackctl_server_t *
129 jackctl_server_create(
130 bool (* on_device_acquire)(const char * device_name),
131 void (* on_device_release)(const char * device_name));
132
144 jackctl_server_t *
145 jackctl_server_create2(
146 bool (* on_device_acquire)(const char * device_name),
147 void (* on_device_release)(const char * device_name),
148 void (* on_device_reservation_loop)(void));
149
155 void
156 jackctl_server_destroy(
157 jackctl_server_t * server);
158
167 bool
168 jackctl_server_open(
169 jackctl_server_t * server,
170 jackctl_driver_t * driver);
171
179 bool
180 jackctl_server_start(
181 jackctl_server_t * server);
182
190 bool
191 jackctl_server_stop(
192 jackctl_server_t * server);
193
201 bool
202 jackctl_server_close(
203 jackctl_server_t * server);
204
214 const JSList *
215 jackctl_server_get_drivers_list(
216 jackctl_server_t * server);
217
227 const JSList *
228 jackctl_server_get_parameters(
229 jackctl_server_t * server);
230
240 const JSList *
241 jackctl_server_get_internals_list(
242 jackctl_server_t * server);
243
253 bool
254 jackctl_server_load_internal(
255 jackctl_server_t * server,
256 jackctl_internal_t * internal);
257
267 bool
268 jackctl_server_unload_internal(
269 jackctl_server_t * server,
270 jackctl_internal_t * internal);
271
282 bool jackctl_server_load_session_file(
283 jackctl_server_t * server_ptr,
284 const char * file);
285
296 bool
297 jackctl_server_add_slave(jackctl_server_t * server,
298 jackctl_driver_t * driver);
299
310 bool
311 jackctl_server_remove_slave(jackctl_server_t * server,
312 jackctl_driver_t * driver);
313
322 bool
323 jackctl_server_switch_master(jackctl_server_t * server,
324 jackctl_driver_t * driver);
325
326
335 const char *
336 jackctl_driver_get_name(
337 jackctl_driver_t * driver);
338
347 jackctl_driver_type_t
348 jackctl_driver_get_type(
349 jackctl_driver_t * driver);
350
360 const JSList *
361 jackctl_driver_get_parameters(
362 jackctl_driver_t * driver);
363
373 int
374 jackctl_driver_params_parse(
375 jackctl_driver_t * driver,
376 int argc,
377 char* argv[]);
378
387 const char *
388 jackctl_internal_get_name(
389 jackctl_internal_t * internal);
390
400 const JSList *
401 jackctl_internal_get_parameters(
402 jackctl_internal_t * internal);
403
412 const char *
413 jackctl_parameter_get_name(
414 jackctl_parameter_t * parameter);
415
424 const char *
425 jackctl_parameter_get_short_description(
426 jackctl_parameter_t * parameter);
427
436 const char *
437 jackctl_parameter_get_long_description(
438 jackctl_parameter_t * parameter);
439
447 jackctl_param_type_t
448 jackctl_parameter_get_type(
449 jackctl_parameter_t * parameter);
450
458 char
459 jackctl_parameter_get_id(
460 jackctl_parameter_t * parameter);
461
471 bool
472 jackctl_parameter_is_set(
473 jackctl_parameter_t * parameter);
474
482 bool
483 jackctl_parameter_reset(
484 jackctl_parameter_t * parameter);
485
493 union jackctl_parameter_value
494 jackctl_parameter_get_value(
495 jackctl_parameter_t * parameter);
496
505 bool
506 jackctl_parameter_set_value(
507 jackctl_parameter_t * parameter,
508 const union jackctl_parameter_value * value_ptr);
509
517 union jackctl_parameter_value
518 jackctl_parameter_get_default_value(
519 jackctl_parameter_t * parameter);
520
528 bool
529 jackctl_parameter_has_range_constraint(
530 jackctl_parameter_t * parameter);
531
539 bool
540 jackctl_parameter_has_enum_constraint(
541 jackctl_parameter_t * parameter);
542
550uint32_t
551 jackctl_parameter_get_enum_constraints_count(
552 jackctl_parameter_t * parameter);
553
562 union jackctl_parameter_value
563 jackctl_parameter_get_enum_constraint_value(
564 jackctl_parameter_t * parameter,
565 uint32_t index);
566
575 const char *
576 jackctl_parameter_get_enum_constraint_description(
577 jackctl_parameter_t * parameter,
578 uint32_t index);
579
587 void
588 jackctl_parameter_get_range_constraint(
589 jackctl_parameter_t * parameter,
590 union jackctl_parameter_value * min_ptr,
591 union jackctl_parameter_value * max_ptr);
592
601 bool
602 jackctl_parameter_constraint_is_strict(
603 jackctl_parameter_t * parameter);
604
614 bool
615 jackctl_parameter_constraint_is_fake_value(
616 jackctl_parameter_t * parameter);
617
623 void
624 jack_error(
625 const char *format,
626 ...);
627
633 void
634 jack_info(
635 const char *format,
636 ...);
637
644 void
645 jack_log(
646 const char *format,
647 ...);
648
651#if 0
652{ /* Adjust editor indent */
653#endif
654#ifdef __cplusplus
655} /* extern "C" */
656#endif
657
658#endif /* #ifndef JACKCTL_H__2EEDAD78_DF4C_4B26_83B7_4FF1A446A47E__INCLUDED */
jackctl_server_t
struct jackctl_server jackctl_server_t
Definition: control.h:74
jackctl_driver_type_t
jackctl_driver_type_t
Definition: control.h:51
JackSlave
@ JackSlave
slave driver
Definition: control.h:53
JackMaster
@ JackMaster
master driver
Definition: control.h:52
JACK_PARAM_STRING_MAX
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition: control.h:60
jackctl_parameter_t
struct jackctl_parameter jackctl_parameter_t
Definition: control.h:83
jackctl_sigmask_t
struct jackctl_sigmask jackctl_sigmask_t
Definition: control.h:86
jackctl_internal_t
struct jackctl_internal jackctl_internal_t
Definition: control.h:80
jackctl_param_type_t
jackctl_param_type_t
Definition: control.h:41
JackParamInt
@ JackParamInt
value type is a signed integer
Definition: control.h:42
JackParamUInt
@ JackParamUInt
value type is an unsigned integer
Definition: control.h:43
JackParamBool
@ JackParamBool
value type is a boolean
Definition: control.h:46
JackParamChar
@ JackParamChar
value type is a char
Definition: control.h:44
JackParamString
@ JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition: control.h:45
jackctl_driver_t
struct jackctl_driver jackctl_driver_t
Definition: control.h:77
jackctl_server_get_internals_list
const JSList * jackctl_server_get_internals_list(jackctl_server_t *server)
jackctl_parameter_get_name
const char * jackctl_parameter_get_name(jackctl_parameter_t *parameter)
jackctl_parameter_get_long_description
const char * jackctl_parameter_get_long_description(jackctl_parameter_t *parameter)
jackctl_parameter_get_enum_constraint_value
union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter_t *parameter, uint32_t index)
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_driver_params_parse
int jackctl_driver_params_parse(jackctl_driver_t *driver, int argc, char *argv[])
jackctl_server_load_session_file
bool jackctl_server_load_session_file(jackctl_server_t *server_ptr, const char *file)
jack_info
void jack_info(const char *format,...)
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_wait_signals
void jackctl_wait_signals(jackctl_sigmask_t *signals)
jackctl_driver_get_parameters
const JSList * jackctl_driver_get_parameters(jackctl_driver_t *driver)
jackctl_server_load_internal
bool jackctl_server_load_internal(jackctl_server_t *server, jackctl_internal_t *internal)
jack_log
void jack_log(const char *format,...)
jackctl_parameter_get_type
jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter_t *parameter)
jackctl_parameter_get_enum_constraint_description
const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter_t *parameter, uint32_t index)
jackctl_server_switch_master
bool jackctl_server_switch_master(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_get_short_description
const char * jackctl_parameter_get_short_description(jackctl_parameter_t *parameter)
jackctl_parameter_is_set
bool jackctl_parameter_is_set(jackctl_parameter_t *parameter)
jackctl_driver_get_type
jackctl_driver_type_t jackctl_driver_get_type(jackctl_driver_t *driver)
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_internal_get_name
const char * jackctl_internal_get_name(jackctl_internal_t *internal)
jackctl_internal_get_parameters
const JSList * jackctl_internal_get_parameters(jackctl_internal_t *internal)
jackctl_parameter_get_id
char jackctl_parameter_get_id(jackctl_parameter_t *parameter)
jackctl_parameter_get_value
union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter_t *parameter)
jackctl_server_start
bool jackctl_server_start(jackctl_server_t *server)
jackctl_parameter_get_default_value
union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter_t *parameter)
jackctl_server_create2
jackctl_server_t * jackctl_server_create2(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name), void(*on_device_reservation_loop)(void))
jackctl_driver_get_name
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
jackctl_server_close
bool jackctl_server_close(jackctl_server_t *server)
jackctl_server_destroy
void jackctl_server_destroy(jackctl_server_t *server)
jackctl_parameter_set_value
bool jackctl_parameter_set_value(jackctl_parameter_t *parameter, const union jackctl_parameter_value *value_ptr)
jackctl_server_unload_internal
bool jackctl_server_unload_internal(jackctl_server_t *server, jackctl_internal_t *internal)
jackctl_parameter_constraint_is_strict
bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter)
jack_error
void jack_error(const char *format,...)
jackctl_server_remove_slave
bool jackctl_server_remove_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_reset
bool jackctl_parameter_reset(jackctl_parameter_t *parameter)
jackctl_server_open
bool jackctl_server_open(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_server_get_drivers_list
const JSList * jackctl_server_get_drivers_list(jackctl_server_t *server)
jackctl_server_add_slave
bool jackctl_server_add_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_setup_signals
jackctl_sigmask_t * jackctl_setup_signals(unsigned int flags)
jackctl_parameter_has_range_constraint
bool jackctl_parameter_has_range_constraint(jackctl_parameter_t *parameter)
jackctl_server_stop
bool jackctl_server_stop(jackctl_server_t *server)
jackctl_parameter_constraint_is_fake_value
bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter)
_JSList
Definition: jslist.h:39
jackctl_parameter_value
Type for parameter value.
Definition: control.h:65
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition: control.h:67
jackctl_parameter_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition: control.h:69
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition: control.h:68
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition: control.h:70
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition: control.h:66