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"
28 /** Parameter types, intentionally similar to jack_driver_param_type_t */
31 JackParamInt
= 1, /**< @brief value type is a signed integer */
32 JackParamUInt
, /**< @brief value type is an unsigned integer */
33 JackParamChar
, /**< @brief value type is a char */
34 JackParamString
, /**< @brief value type is a string with max size of ::JACK_PARAM_STRING_MAX+1 chars */
35 JackParamBool
, /**< @brief value type is a boolean */
36 } jackctl_param_type_t
;
38 /** Driver types, intentionally similar to jack_driver_type_t */
41 JackMaster
= 1, /**< @brief master driver */
42 JackSlave
, /**< @brief slave driver */
43 } jackctl_driver_type_t
;
45 /** @brief Max value that jackctl_param_type_t type can have */
46 #define JACK_PARAM_MAX (JackParamBool + 1)
48 /** @brief Max length of string parameter value, excluding terminating nul char */
49 #define JACK_PARAM_STRING_MAX 127
51 /** @brief Type for parameter value */
52 /* intentionally similar to jack_driver_param_value_t */
53 union jackctl_parameter_value
55 uint32_t ui
; /**< @brief member used for ::JackParamUInt */
56 int32_t i
; /**< @brief member used for ::JackParamInt */
57 char c
; /**< @brief member used for ::JackParamChar */
58 char str
[JACK_PARAM_STRING_MAX
+ 1]; /**< @brief member used for ::JackParamString */
59 bool b
; /**< @brief member used for ::JackParamBool */
62 /** opaque type for server object */
63 typedef struct jackctl_server jackctl_server_t
;
65 /** opaque type for driver object */
66 typedef struct jackctl_driver jackctl_driver_t
;
68 /** opaque type for internal client object */
69 typedef struct jackctl_internal jackctl_internal_t
;
71 /** opaque type for parameter object */
72 typedef struct jackctl_parameter jackctl_parameter_t
;
74 /** opaque type for sigmask object */
75 typedef struct jackctl_sigmask jackctl_sigmask_t
;
81 } /* Adjust editor indent */
84 SERVER_EXPORT jackctl_sigmask_t
*
85 jackctl_setup_signals(
90 jackctl_sigmask_t
* signals
);
92 SERVER_EXPORT jackctl_server_t
*
93 jackctl_server_create(
94 bool (* on_device_acquire
)(const char * device_name
),
95 void (* on_device_release
)(const char * device_name
));
98 jackctl_server_destroy(
99 jackctl_server_t
* server
);
101 SERVER_EXPORT
const JSList
*
102 jackctl_server_get_drivers_list(
103 jackctl_server_t
* server
);
107 jackctl_server_t
* server
,
108 jackctl_driver_t
* driver
);
111 jackctl_server_start(
112 jackctl_server_t
* server
);
116 jackctl_server_t
* server
);
119 jackctl_server_close(
120 jackctl_server_t
* server
);
122 SERVER_EXPORT
const JSList
*
123 jackctl_server_get_parameters(
124 jackctl_server_t
* server
);
126 SERVER_EXPORT
const char *
127 jackctl_driver_get_name(
128 jackctl_driver_t
* driver
);
130 SERVER_EXPORT jackctl_driver_type_t
131 jackctl_driver_get_type(
132 jackctl_driver_t
* driver
);
134 SERVER_EXPORT
const JSList
*
135 jackctl_driver_get_parameters(
136 jackctl_driver_t
* driver
);
138 SERVER_EXPORT
const char *
139 jackctl_parameter_get_name(
140 jackctl_parameter_t
* parameter
);
142 SERVER_EXPORT
const char *
143 jackctl_parameter_get_short_description(
144 jackctl_parameter_t
* parameter
);
146 SERVER_EXPORT
const char *
147 jackctl_parameter_get_long_description(
148 jackctl_parameter_t
* parameter
);
150 SERVER_EXPORT jackctl_param_type_t
151 jackctl_parameter_get_type(
152 jackctl_parameter_t
* parameter
);
155 jackctl_parameter_get_id(
156 jackctl_parameter_t
* parameter
);
159 jackctl_parameter_is_set(
160 jackctl_parameter_t
* parameter
);
163 jackctl_parameter_reset(
164 jackctl_parameter_t
* parameter
);
166 SERVER_EXPORT
union jackctl_parameter_value
167 jackctl_parameter_get_value(
168 jackctl_parameter_t
* parameter
);
171 jackctl_parameter_set_value(
172 jackctl_parameter_t
* parameter
,
173 const union jackctl_parameter_value
* value_ptr
);
175 SERVER_EXPORT
union jackctl_parameter_value
176 jackctl_parameter_get_default_value(
177 jackctl_parameter_t
* parameter
);
179 SERVER_EXPORT
union jackctl_parameter_value
180 jackctl_parameter_get_default_value(
181 jackctl_parameter
*parameter_ptr
);
184 jackctl_parameter_has_range_constraint(
185 jackctl_parameter_t
* parameter_ptr
);
188 jackctl_parameter_has_enum_constraint(
189 jackctl_parameter_t
* parameter_ptr
);
191 SERVER_EXPORT
uint32_t
192 jackctl_parameter_get_enum_constraints_count(
193 jackctl_parameter_t
* parameter_ptr
);
195 SERVER_EXPORT
union jackctl_parameter_value
196 jackctl_parameter_get_enum_constraint_value(
197 jackctl_parameter_t
* parameter_ptr
,
200 SERVER_EXPORT
const char *
201 jackctl_parameter_get_enum_constraint_description(
202 jackctl_parameter_t
* parameter_ptr
,
206 jackctl_parameter_get_range_constraint(
207 jackctl_parameter_t
* parameter_ptr
,
208 union jackctl_parameter_value
* min_ptr
,
209 union jackctl_parameter_value
* max_ptr
);
212 jackctl_parameter_constraint_is_strict(
213 jackctl_parameter_t
* parameter_ptr
);
216 jackctl_parameter_constraint_is_fake_value(
217 jackctl_parameter_t
* parameter_ptr
);
219 SERVER_EXPORT
const JSList
*
220 jackctl_server_get_internals_list(
221 jackctl_server
*server_ptr
);
223 SERVER_EXPORT
const char *
224 jackctl_internal_get_name(
225 jackctl_internal
*internal_ptr
);
227 SERVER_EXPORT
const JSList
*
228 jackctl_internal_get_parameters(
229 jackctl_internal
*internal_ptr
);
231 SERVER_EXPORT
bool jackctl_server_load_internal(
232 jackctl_server
* server
,
233 jackctl_internal
* internal
);
235 SERVER_EXPORT
bool jackctl_server_unload_internal(
236 jackctl_server
* server
,
237 jackctl_internal
* internal
);
239 SERVER_EXPORT
bool jackctl_server_add_slave(jackctl_server_t
* server
,
240 jackctl_driver_t
* driver
);
242 SERVER_EXPORT
bool jackctl_server_remove_slave(jackctl_server_t
* server
,
243 jackctl_driver_t
* driver
);
246 jackctl_server_switch_master(jackctl_server_t
* server
,
247 jackctl_driver_t
* driver
);
250 jackctl_parse_driver_params(jackctl_driver
* driver_ptr
, int argc
, char* argv
[]);
253 { /* Adjust editor indent */