JackControlAPI.h 5.97 KB
Newer Older
1
2
3
4
/*
  JACK control API

  Copyright (C) 2008 Nedko Arnaudov
sletz's avatar
Typo.    
sletz committed
5
  Copyright (C) 2008 Grame
sletz's avatar
sletz committed
6

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; version 2 of the License.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

sletz's avatar
Typo.    
sletz committed
22
23
#ifndef __JackControlAPI__
#define __JackControlAPI__
24

25
#include "jslist.h"
26
#include "JackCompilerDeps.h"
27
28
29
30
31
32
33

#ifdef WIN32
#ifdef __MINGW32__
#include <sys/types.h>
#else
typedef HANDLE sigset_t;
#endif
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#endif

/** Parameter types, intentionally similar to jack_driver_param_type_t */
typedef enum
{
    JackParamInt = 1,			/**< @brief value type is a signed integer */
    JackParamUInt,				/**< @brief value type is an unsigned integer */
    JackParamChar,				/**< @brief value type is a char */
    JackParamString,			/**< @brief value type is a string with max size of ::JACK_PARAM_STRING_MAX+1 chars */
    JackParamBool,				/**< @brief value type is a boolean */
} jackctl_param_type_t;

/** @brief Max value that jackctl_param_type_t type can have */
#define JACK_PARAM_MAX (JackParamBool + 1)

/** @brief Max length of string parameter value, excluding terminating nul char */
#define JACK_PARAM_STRING_MAX  63

/** @brief Type for parameter value */
/* intentionally similar to jack_driver_param_value_t */
union jackctl_parameter_value
{
    uint32_t ui;				/**< @brief member used for ::JackParamUInt */
    int32_t i;					/**< @brief member used for ::JackParamInt */
    char c;						/**< @brief member used for ::JackParamChar */
    char str[JACK_PARAM_STRING_MAX + 1]; /**< @brief member used for ::JackParamString */
    bool b;				/**< @brief member used for ::JackParamBool */
};

/** opaque type for server object */
typedef struct jackctl_server jackctl_server_t;

/** opaque type for driver object */
typedef struct jackctl_driver jackctl_driver_t;

69
70
71
/** opaque type for internal client object */
typedef struct jackctl_internal jackctl_internal_t;

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/** opaque type for parameter object */
typedef struct jackctl_parameter jackctl_parameter_t;

#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* Adjust editor indent */
#endif

EXPORT sigset_t
jackctl_setup_signals(
    unsigned int flags);

EXPORT void
jackctl_wait_signals(
    sigset_t signals);

EXPORT jackctl_server_t *
jackctl_server_create();
92

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
EXPORT void
jackctl_server_destroy(
	jackctl_server_t * server);

EXPORT const JSList *
jackctl_server_get_drivers_list(
	jackctl_server_t * server);

EXPORT bool
jackctl_server_start(
    jackctl_server_t * server,
    jackctl_driver_t * driver);

EXPORT bool
jackctl_server_stop(
	jackctl_server_t * server);

EXPORT const JSList *
jackctl_server_get_parameters(
	jackctl_server_t * server);

EXPORT const char *
jackctl_driver_get_name(
	jackctl_driver_t * driver);

EXPORT const JSList *
jackctl_driver_get_parameters(
	jackctl_driver_t * driver);

EXPORT const char *
jackctl_parameter_get_name(
	jackctl_parameter_t * parameter);

EXPORT const char *
jackctl_parameter_get_short_description(
	jackctl_parameter_t * parameter);

EXPORT const char *
jackctl_parameter_get_long_description(
	jackctl_parameter_t * parameter);

EXPORT jackctl_param_type_t
jackctl_parameter_get_type(
	jackctl_parameter_t * parameter);

EXPORT char
jackctl_parameter_get_id(
	jackctl_parameter_t * parameter);

EXPORT bool
jackctl_parameter_is_set(
	jackctl_parameter_t * parameter);

EXPORT bool
jackctl_parameter_reset(
	jackctl_parameter_t * parameter);

EXPORT union jackctl_parameter_value
jackctl_parameter_get_value(
	jackctl_parameter_t * parameter);

EXPORT bool
jackctl_parameter_set_value(
	jackctl_parameter_t * parameter,
	const union jackctl_parameter_value * value_ptr);

EXPORT union jackctl_parameter_value
jackctl_parameter_get_default_value(
	jackctl_parameter_t * parameter);
162
163
164
165
166
    
EXPORT union jackctl_parameter_value 
jackctl_parameter_get_default_value(
    jackctl_parameter *parameter_ptr);
    
nedko's avatar
nedko committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
EXPORT bool
jackctl_parameter_has_range_constraint(
	jackctl_parameter_t * parameter_ptr);

EXPORT bool
jackctl_parameter_has_enum_constraint(
	jackctl_parameter_t * parameter_ptr);

EXPORT uint32_t
jackctl_parameter_get_enum_constraints_count(
	jackctl_parameter_t * parameter_ptr);

EXPORT union jackctl_parameter_value
jackctl_parameter_get_enum_constraint_value(
	jackctl_parameter_t * parameter_ptr,
	uint32_t index);

EXPORT const char *
jackctl_parameter_get_enum_constraint_description(
	jackctl_parameter_t * parameter_ptr,
	uint32_t index);

EXPORT void
jackctl_parameter_get_range_constraint(
	jackctl_parameter_t * parameter_ptr,
	union jackctl_parameter_value * min_ptr,
	union jackctl_parameter_value * max_ptr);

nedko's avatar
nedko committed
195
196
197
198
199
200
201
202
EXPORT bool
jackctl_parameter_constraint_is_strict(
	jackctl_parameter_t * parameter_ptr);

EXPORT bool
jackctl_parameter_constraint_is_fake_value(
	jackctl_parameter_t * parameter_ptr);

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
EXPORT const JSList * 
jackctl_server_get_internals_list(
    jackctl_server *server_ptr);
    
EXPORT const char * 
jackctl_internal_get_name(
    jackctl_internal *internal_ptr);
    
EXPORT const JSList * 
jackctl_internal_get_parameters(
    jackctl_internal *internal_ptr);
    
EXPORT bool jackctl_server_load_internal(
    jackctl_server * server,
    jackctl_internal * internal);
    
EXPORT bool jackctl_server_unload_internal(
    jackctl_server * server,
    jackctl_internal * internal);
sletz's avatar
sletz committed
222
223
224
225
226
227
228
    
EXPORT bool jackctl_server_load_slave(jackctl_server_t * server,
                            jackctl_driver_t * driver);

EXPORT bool jackctl_server_unload_slave(jackctl_server_t * server,
                            jackctl_driver_t * driver);

229

230
231
232
233
234
235
236
#if 0
{ /* Adjust editor indent */
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif

237
#endif