4 Copyright (C) 2008 Nedko Arnaudov
5 Copyright (C) 2008 Grame
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; version 2 of the License.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __JackControlAPI__
23 #define __JackControlAPI__
26 #include "JackCompilerDeps.h"
30 #include <sys/types.h>
32 typedef HANDLE sigset_t
;
36 /** Parameter types, intentionally similar to jack_driver_param_type_t */
39 JackParamInt
= 1, /**< @brief value type is a signed integer */
40 JackParamUInt
, /**< @brief value type is an unsigned integer */
41 JackParamChar
, /**< @brief value type is a char */
42 JackParamString
, /**< @brief value type is a string with max size of ::JACK_PARAM_STRING_MAX+1 chars */
43 JackParamBool
, /**< @brief value type is a boolean */
44 } jackctl_param_type_t
;
46 /** @brief Max value that jackctl_param_type_t type can have */
47 #define JACK_PARAM_MAX (JackParamBool + 1)
49 /** @brief Max length of string parameter value, excluding terminating nul char */
50 #define JACK_PARAM_STRING_MAX 63
52 /** @brief Type for parameter value */
53 /* intentionally similar to jack_driver_param_value_t */
54 union jackctl_parameter_value
56 uint32_t ui
; /**< @brief member used for ::JackParamUInt */
57 int32_t i
; /**< @brief member used for ::JackParamInt */
58 char c
; /**< @brief member used for ::JackParamChar */
59 char str
[JACK_PARAM_STRING_MAX
+ 1]; /**< @brief member used for ::JackParamString */
60 bool b
; /**< @brief member used for ::JackParamBool */
63 /** opaque type for server object */
64 typedef struct jackctl_server jackctl_server_t
;
66 /** opaque type for driver object */
67 typedef struct jackctl_driver jackctl_driver_t
;
69 /** opaque type for internal client object */
70 typedef struct jackctl_internal jackctl_internal_t
;
72 /** opaque type for parameter object */
73 typedef struct jackctl_parameter jackctl_parameter_t
;
79 } /* Adjust editor indent */
83 jackctl_setup_signals(
90 EXPORT jackctl_server_t
*
91 jackctl_server_create();
94 jackctl_server_destroy(
95 jackctl_server_t
* server
);
98 jackctl_server_get_drivers_list(
99 jackctl_server_t
* server
);
102 jackctl_server_start(
103 jackctl_server_t
* server
,
104 jackctl_driver_t
* driver
);
108 jackctl_server_t
* server
);
110 EXPORT
const JSList
*
111 jackctl_server_get_parameters(
112 jackctl_server_t
* server
);
115 jackctl_driver_get_name(
116 jackctl_driver_t
* driver
);
118 EXPORT
const JSList
*
119 jackctl_driver_get_parameters(
120 jackctl_driver_t
* driver
);
123 jackctl_parameter_get_name(
124 jackctl_parameter_t
* parameter
);
127 jackctl_parameter_get_short_description(
128 jackctl_parameter_t
* parameter
);
131 jackctl_parameter_get_long_description(
132 jackctl_parameter_t
* parameter
);
134 EXPORT jackctl_param_type_t
135 jackctl_parameter_get_type(
136 jackctl_parameter_t
* parameter
);
139 jackctl_parameter_get_id(
140 jackctl_parameter_t
* parameter
);
143 jackctl_parameter_is_set(
144 jackctl_parameter_t
* parameter
);
147 jackctl_parameter_reset(
148 jackctl_parameter_t
* parameter
);
150 EXPORT
union jackctl_parameter_value
151 jackctl_parameter_get_value(
152 jackctl_parameter_t
* parameter
);
155 jackctl_parameter_set_value(
156 jackctl_parameter_t
* parameter
,
157 const union jackctl_parameter_value
* value_ptr
);
159 EXPORT
union jackctl_parameter_value
160 jackctl_parameter_get_default_value(
161 jackctl_parameter_t
* parameter
);
163 EXPORT
union jackctl_parameter_value
164 jackctl_parameter_get_default_value(
165 jackctl_parameter
*parameter_ptr
);
168 jackctl_parameter_has_range_constraint(
169 jackctl_parameter_t
* parameter_ptr
);
172 jackctl_parameter_has_enum_constraint(
173 jackctl_parameter_t
* parameter_ptr
);
176 jackctl_parameter_get_enum_constraints_count(
177 jackctl_parameter_t
* parameter_ptr
);
179 EXPORT
union jackctl_parameter_value
180 jackctl_parameter_get_enum_constraint_value(
181 jackctl_parameter_t
* parameter_ptr
,
185 jackctl_parameter_get_enum_constraint_description(
186 jackctl_parameter_t
* parameter_ptr
,
190 jackctl_parameter_get_range_constraint(
191 jackctl_parameter_t
* parameter_ptr
,
192 union jackctl_parameter_value
* min_ptr
,
193 union jackctl_parameter_value
* max_ptr
);
196 jackctl_parameter_constraint_is_strict(
197 jackctl_parameter_t
* parameter_ptr
);
200 jackctl_parameter_constraint_is_fake_value(
201 jackctl_parameter_t
* parameter_ptr
);
203 EXPORT
const JSList
*
204 jackctl_server_get_internals_list(
205 jackctl_server
*server_ptr
);
208 jackctl_internal_get_name(
209 jackctl_internal
*internal_ptr
);
211 EXPORT
const JSList
*
212 jackctl_internal_get_parameters(
213 jackctl_internal
*internal_ptr
);
215 EXPORT
bool jackctl_server_load_internal(
216 jackctl_server
* server
,
217 jackctl_internal
* internal
);
219 EXPORT
bool jackctl_server_unload_internal(
220 jackctl_server
* server
,
221 jackctl_internal
* internal
);
224 { /* Adjust editor indent */