JACK-AUDIO-CONNECTION-KIT
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 {
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 */
57 {
58  uint32_t ui;
59  int32_t i;
60  char c;
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
100  unsigned int flags);
101 
107 void
109  sigset_t signals);
110 
123  bool (* on_device_acquire)(const char * device_name),
124  void (* on_device_release)(const char * device_name));
125 
131 void
133  jackctl_server_t * server);
134 
143 bool
145  jackctl_server_t * server,
146  jackctl_driver_t * driver);
147 
155 bool
157  jackctl_server_t * server);
158 
168 const JSList *
170  jackctl_server_t * server);
171 
181 const JSList *
183  jackctl_server_t * server);
184 
194 const JSList *
196  jackctl_server_t * server);
197 
206 bool
208  jackctl_server_t * server,
209  jackctl_internal_t * internal);
210 
219 bool
221  jackctl_server_t * server,
222  jackctl_internal_t * internal);
223 
232 bool
234  jackctl_driver_t * driver);
235 
244 bool
246  jackctl_driver_t * driver);
247 
256 bool
258  jackctl_driver_t * driver);
259 
260 
269 const char *
271  jackctl_driver_t * driver);
272 
282 const JSList *
284  jackctl_driver_t * driver);
285 
294 const char *
296  jackctl_internal_t * internal);
297 
307 const JSList *
309  jackctl_internal_t * internal);
310 
319 const char *
321  jackctl_parameter_t * parameter);
322 
331 const char *
333  jackctl_parameter_t * parameter);
334 
343 const char *
345  jackctl_parameter_t * parameter);
346 
356  jackctl_parameter_t * parameter);
357 
365 char
367  jackctl_parameter_t * parameter);
368 
378 bool
380  jackctl_parameter_t * parameter);
381 
389 bool
391  jackctl_parameter_t * parameter);
392 
402  jackctl_parameter_t * parameter);
403 
412 bool
414  jackctl_parameter_t * parameter,
415  const union jackctl_parameter_value * value_ptr);
416 
426  jackctl_parameter_t * parameter);
427 
435 bool
437  jackctl_parameter_t * parameter);
438 
446 bool
448  jackctl_parameter_t * parameter);
449 
457 uint32_t
459  jackctl_parameter_t * parameter);
460 
471  jackctl_parameter_t * parameter,
472  uint32_t index);
473 
482 const char *
484  jackctl_parameter_t * parameter,
485  uint32_t index);
486 
494 void
496  jackctl_parameter_t * parameter,
497  union jackctl_parameter_value * min_ptr,
498  union jackctl_parameter_value * max_ptr);
499 
508 bool
510  jackctl_parameter_t * parameter);
511 
521 bool
523  jackctl_parameter_t * parameter);
524 
530 void
532  const char *format,
533  ...);
534 
540 void
542  const char *format,
543  ...);
544 
551 void
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__ */
struct jackctl_server jackctl_server_t
Definition: control.h:66
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition: control.h:52
struct jackctl_parameter jackctl_parameter_t
Definition: control.h:75
struct jackctl_internal jackctl_internal_t
Definition: control.h:72
jackctl_param_type_t
Definition: control.h:40
struct jackctl_driver jackctl_driver_t
Definition: control.h:69
bool jackctl_server_start(jackctl_server_t *server, jackctl_driver_t *driver)
const JSList * jackctl_driver_get_parameters(jackctl_driver_t *driver)
union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter_t *parameter, uint32_t index)
void jackctl_parameter_get_range_constraint(jackctl_parameter_t *parameter, union jackctl_parameter_value *min_ptr, union jackctl_parameter_value *max_ptr)
uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter_t *parameter)
void jack_info(const char *format,...)
bool jackctl_server_load_internal(jackctl_server_t *server, jackctl_internal_t *internal)
int32_t i
member used for JackParamInt
Definition: control.h:59
void jack_log(const char *format,...)
jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter_t *parameter)
const char * jackctl_parameter_get_name(jackctl_parameter_t *parameter)
bool jackctl_server_switch_master(jackctl_server_t *server, jackctl_driver_t *driver)
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition: control.h:61
const JSList * jackctl_server_get_drivers_list(jackctl_server_t *server)
bool jackctl_parameter_is_set(jackctl_parameter_t *parameter)
const char * jackctl_internal_get_name(jackctl_internal_t *internal)
char c
member used for JackParamChar
Definition: control.h:60
bool jackctl_parameter_has_enum_constraint(jackctl_parameter_t *parameter)
char jackctl_parameter_get_id(jackctl_parameter_t *parameter)
jackctl_server_t * jackctl_server_create(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name))
void jackctl_wait_signals(sigset_t signals)
bool b
member used for JackParamBool
Definition: control.h:62
const char * jackctl_parameter_get_long_description(jackctl_parameter_t *parameter)
union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter_t *parameter)
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter_t *parameter)
const char * jackctl_parameter_get_short_description(jackctl_parameter_t *parameter)
sigset_t jackctl_setup_signals(unsigned int flags)
void jackctl_server_destroy(jackctl_server_t *server)
bool jackctl_parameter_set_value(jackctl_parameter_t *parameter, const union jackctl_parameter_value *value_ptr)
bool jackctl_server_unload_internal(jackctl_server_t *server, jackctl_internal_t *internal)
bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter)
void jack_error(const char *format,...)
@ JackParamInt
value type is a signed integer
Definition: control.h:41
@ JackParamUInt
value type is an unsigned integer
Definition: control.h:42
@ JackParamBool
value type is a boolean
Definition: control.h:45
@ JackParamChar
value type is a char
Definition: control.h:43
@ JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition: control.h:44
bool jackctl_server_remove_slave(jackctl_server_t *server, jackctl_driver_t *driver)
bool jackctl_parameter_reset(jackctl_parameter_t *parameter)
const JSList * jackctl_server_get_internals_list(jackctl_server_t *server)
bool jackctl_server_add_slave(jackctl_server_t *server, jackctl_driver_t *driver)
const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter_t *parameter, uint32_t index)
const JSList * jackctl_internal_get_parameters(jackctl_internal_t *internal)
bool jackctl_parameter_has_range_constraint(jackctl_parameter_t *parameter)
const JSList * jackctl_server_get_parameters(jackctl_server_t *server)
bool jackctl_server_stop(jackctl_server_t *server)
bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter)
uint32_t ui
member used for JackParamUInt
Definition: control.h:58
Definition: jslist.h:35
Type for parameter value.
Definition: control.h:57