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

JACK-AUDIO-CONNECTION-KIT

Loading...
Searching...
No Matches
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*/
28
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
78extern "C" {
79#endif
80#if 0
81} /* Adjust editor indent */
82#endif
83
88
98sigset_t
99jackctl_setup_signals(
100 unsigned int flags);
101
107void
108jackctl_wait_signals(
109 sigset_t signals);
110
121 jackctl_server_t *
122jackctl_server_create(
123 bool (* on_device_acquire)(const char * device_name),
124 void (* on_device_release)(const char * device_name));
125
131void
132jackctl_server_destroy(
133 jackctl_server_t * server);
134
143bool
144jackctl_server_start(
145 jackctl_server_t * server,
146 jackctl_driver_t * driver);
147
155bool
156jackctl_server_stop(
157 jackctl_server_t * server);
158
168const JSList *
169jackctl_server_get_drivers_list(
170 jackctl_server_t * server);
171
181const JSList *
182jackctl_server_get_parameters(
183 jackctl_server_t * server);
184
194const JSList *
195jackctl_server_get_internals_list(
196 jackctl_server_t * server);
197
206bool
207jackctl_server_load_internal(
208 jackctl_server_t * server,
209 jackctl_internal_t * internal);
210
219bool
220jackctl_server_unload_internal(
221 jackctl_server_t * server,
222 jackctl_internal_t * internal);
223
232bool
233jackctl_server_add_slave(jackctl_server_t * server,
234 jackctl_driver_t * driver);
235
244bool
245jackctl_server_remove_slave(jackctl_server_t * server,
246 jackctl_driver_t * driver);
247
256bool
257jackctl_server_switch_master(jackctl_server_t * server,
258 jackctl_driver_t * driver);
259
260
269const char *
270jackctl_driver_get_name(
271 jackctl_driver_t * driver);
272
282const JSList *
283jackctl_driver_get_parameters(
284 jackctl_driver_t * driver);
285
294const char *
295jackctl_internal_get_name(
296 jackctl_internal_t * internal);
297
307const JSList *
308jackctl_internal_get_parameters(
309 jackctl_internal_t * internal);
310
319const char *
320jackctl_parameter_get_name(
321 jackctl_parameter_t * parameter);
322
331const char *
332jackctl_parameter_get_short_description(
333 jackctl_parameter_t * parameter);
334
343const char *
344jackctl_parameter_get_long_description(
345 jackctl_parameter_t * parameter);
346
354 jackctl_param_type_t
355jackctl_parameter_get_type(
356 jackctl_parameter_t * parameter);
357
365char
366jackctl_parameter_get_id(
367 jackctl_parameter_t * parameter);
368
378bool
379jackctl_parameter_is_set(
380 jackctl_parameter_t * parameter);
381
389bool
390jackctl_parameter_reset(
391 jackctl_parameter_t * parameter);
392
400union jackctl_parameter_value
401jackctl_parameter_get_value(
402 jackctl_parameter_t * parameter);
403
412bool
413jackctl_parameter_set_value(
414 jackctl_parameter_t * parameter,
415 const union jackctl_parameter_value * value_ptr);
416
424union jackctl_parameter_value
425jackctl_parameter_get_default_value(
426 jackctl_parameter_t * parameter);
427
435bool
436jackctl_parameter_has_range_constraint(
437 jackctl_parameter_t * parameter);
438
446bool
447jackctl_parameter_has_enum_constraint(
448 jackctl_parameter_t * parameter);
449
457uint32_t
458jackctl_parameter_get_enum_constraints_count(
459 jackctl_parameter_t * parameter);
460
469union jackctl_parameter_value
470jackctl_parameter_get_enum_constraint_value(
471 jackctl_parameter_t * parameter,
472 uint32_t index);
473
482const char *
483jackctl_parameter_get_enum_constraint_description(
484 jackctl_parameter_t * parameter,
485 uint32_t index);
486
494void
495jackctl_parameter_get_range_constraint(
496 jackctl_parameter_t * parameter,
497 union jackctl_parameter_value * min_ptr,
498 union jackctl_parameter_value * max_ptr);
499
508bool
509jackctl_parameter_constraint_is_strict(
510 jackctl_parameter_t * parameter);
511
521bool
522jackctl_parameter_constraint_is_fake_value(
523 jackctl_parameter_t * parameter);
524
530void
531jack_error(
532 const char *format,
533 ...);
534
540void
541jack_info(
542 const char *format,
543 ...);
544
551void
552jack_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_t
struct jackctl_server jackctl_server_t
Definition control.h:66
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_t
struct jackctl_parameter jackctl_parameter_t
Definition control.h:75
jackctl_internal_t
struct jackctl_internal jackctl_internal_t
Definition control.h:72
jackctl_param_type_t
jackctl_param_type_t
Definition control.h:40
jackctl_driver_t
struct jackctl_driver jackctl_driver_t
Definition control.h:69
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_server_start
bool jackctl_server_start(jackctl_server_t *server, jackctl_driver_t *driver)
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)
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_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)
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition control.h:59
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_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition control.h:61
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_server_get_parameters
const JSList * jackctl_server_get_parameters(jackctl_server_t *server)
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition control.h:60
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_wait_signals
void jackctl_wait_signals(sigset_t signals)
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition control.h:62
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_driver_get_name
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
jackctl_setup_signals
sigset_t jackctl_setup_signals(unsigned int flags)
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,...)
JackParamInt
@ JackParamInt
value type is a signed integer
Definition control.h:41
JackParamUInt
@ JackParamUInt
value type is an unsigned integer
Definition control.h:42
JackParamBool
@ JackParamBool
value type is a boolean
Definition control.h:45
JackParamChar
@ JackParamChar
value type is a char
Definition control.h:43
JackParamString
@ JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition control.h:44
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_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_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)
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition control.h:58
jslist.h
JSList
struct _JSList JSList
Definition jslist.h:30
jackctl_parameter_value
Type for parameter value.
Definition control.h:57