Better isolation of server and clients system resources to allow starting the server...
[jack2.git] / common / JackControlAPI.h
blob7fc73243492716d2ff0b866432c574f3d2f7e4d2
1 /*
2 JACK control API
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__
25 #include "jslist.h"
26 #include "JackCompilerDeps.h"
28 #ifdef WIN32
29 #ifdef __MINGW32__
30 #include <sys/types.h>
31 #else
32 typedef HANDLE sigset_t;
33 #endif
34 #endif
36 /** Parameter types, intentionally similar to jack_driver_param_type_t */
37 typedef enum
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;
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 #if 0
79 } /* Adjust editor indent */
80 #endif
82 EXPORT sigset_t
83 jackctl_setup_signals(
84 unsigned int flags);
86 EXPORT void
87 jackctl_wait_signals(
88 sigset_t signals);
90 EXPORT jackctl_server_t *
91 jackctl_server_create();
93 EXPORT void
94 jackctl_server_destroy(
95 jackctl_server_t * server);
97 EXPORT const JSList *
98 jackctl_server_get_drivers_list(
99 jackctl_server_t * server);
101 EXPORT bool
102 jackctl_server_start(
103 jackctl_server_t * server,
104 jackctl_driver_t * driver);
106 EXPORT bool
107 jackctl_server_stop(
108 jackctl_server_t * server);
110 EXPORT const JSList *
111 jackctl_server_get_parameters(
112 jackctl_server_t * server);
114 EXPORT const char *
115 jackctl_driver_get_name(
116 jackctl_driver_t * driver);
118 EXPORT const JSList *
119 jackctl_driver_get_parameters(
120 jackctl_driver_t * driver);
122 EXPORT const char *
123 jackctl_parameter_get_name(
124 jackctl_parameter_t * parameter);
126 EXPORT const char *
127 jackctl_parameter_get_short_description(
128 jackctl_parameter_t * parameter);
130 EXPORT const char *
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);
138 EXPORT char
139 jackctl_parameter_get_id(
140 jackctl_parameter_t * parameter);
142 EXPORT bool
143 jackctl_parameter_is_set(
144 jackctl_parameter_t * parameter);
146 EXPORT bool
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);
154 EXPORT bool
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);
167 EXPORT bool
168 jackctl_parameter_has_range_constraint(
169 jackctl_parameter_t * parameter_ptr);
171 EXPORT bool
172 jackctl_parameter_has_enum_constraint(
173 jackctl_parameter_t * parameter_ptr);
175 EXPORT uint32_t
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,
182 uint32_t index);
184 EXPORT const char *
185 jackctl_parameter_get_enum_constraint_description(
186 jackctl_parameter_t * parameter_ptr,
187 uint32_t index);
189 EXPORT void
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);
195 EXPORT bool
196 jackctl_parameter_constraint_is_strict(
197 jackctl_parameter_t * parameter_ptr);
199 EXPORT bool
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);
207 EXPORT const char *
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);
223 #if 0
224 { /* Adjust editor indent */
225 #endif
226 #ifdef __cplusplus
227 } /* extern "C" */
228 #endif
230 #endif