JACK-AUDIO-CONNECTION-KIT
types.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2001 Paul Davis
3  Copyright (C) 2004 Jack O'Quin
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 
21 #ifndef __jack_types_h__
22 #define __jack_types_h__
23 
24 #include <inttypes.h>
25 #include <pthread.h>
26 
27 typedef uint64_t jack_uuid_t;
28 
29 typedef int32_t jack_shmsize_t;
30 
31 #ifndef
32 #ifdef __GNUC__
33 /* needs to be a macro which
34  expands into a compiler directive. The directive must
35  tell the compiler to arrange the preceding structure
36  declaration so that it is packed on byte-boundaries rather
37  than use the natural alignment of the processor and/or
38  compiler.
39 */
40 #ifdef __arm__
41 # define
42 #else
43 # define __attribute__((__packed__))
44 #endif /* ARM */
45 #else
46 /* Add other things here for non-gcc platforms */
47 #endif
48 #endif
49 
50 
54 typedef uint32_t jack_nframes_t;
55 
59 #define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but
60  C++ has a problem with that. */
61 
66 typedef uint64_t jack_time_t;
67 
72 #define JACK_LOAD_INIT_LIMIT 1024
73 
80 
85 typedef struct _jack_port jack_port_t;
86 
91 typedef struct _jack_client jack_client_t;
92 
97 typedef uint32_t jack_port_id_t;
98 
104 typedef pthread_t jack_native_thread_t;
105 
109 enum JackOptions {
110 
114  JackNullOption = 0x00,
115 
122  JackNoStartServer = 0x01,
123 
128  JackUseExactName = 0x02,
129 
133  JackServerName = 0x04,
134 
139  JackLoadName = 0x08,
140 
145  JackLoadInit = 0x10,
146 
150  JackSessionID = 0x20
151 };
152 
154 #define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
155 
157 #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
158 
163 typedef enum JackOptions jack_options_t;
164 
168 enum JackStatus {
169 
173  JackFailure = 0x01,
174 
178  JackInvalidOption = 0x02,
179 
189  JackNameNotUnique = 0x04,
190 
197  JackServerStarted = 0x08,
198 
202  JackServerFailed = 0x10,
203 
207  JackServerError = 0x20,
208 
212  JackNoSuchClient = 0x40,
213 
217  JackLoadFailure = 0x80,
218 
222  JackInitFailure = 0x100,
223 
227  JackShmFailure = 0x200,
228 
232  JackVersionError = 0x400,
233 
234  /*
235  * BackendError
236  */
237  JackBackendError = 0x800,
238 
239  /*
240  * Client is being shutdown against its will
241  */
242  JackClientZombie = 0x1000
243 };
244 
249 typedef enum JackStatus jack_status_t;
250 
255 
262 
269 
270 };
271 
276 
284 typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
285 
289 struct _jack_latency_range
290 {
299 };
302 
315 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
316 
329 typedef void (*JackThreadInitCallback)(void *arg);
330 
339 typedef int (*JackGraphOrderCallback)(void *arg);
340 
351 typedef int (*JackXRunCallback)(void *arg);
352 
367 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
368 
378 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
379 
389 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg);
390 
400 typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg);
401 
411 typedef void (*JackClientRegistrationCallback)(const char* name, int register, void *arg);
412 
423 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
424 
432 typedef void (*JackFreewheelCallback)(int starting, void *arg);
434 typedef void *(*JackThreadCallback)(void* arg);
435 
447 typedef void (*JackShutdownCallback)(void *arg);
448 
462 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
463 
468 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
469 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
470 
476 typedef float jack_default_audio_sample_t;
477 
484 enum JackPortFlags {
485 
490  JackPortIsInput = 0x1,
491 
496  JackPortIsOutput = 0x2,
497 
502  JackPortIsPhysical = 0x4,
503 
517  JackPortCanMonitor = 0x8,
518 
533  JackPortIsTerminal = 0x10
534 };
535 
536 
537 #endif /* __jack_types_h__ */
struct _jack_client jack_client_t
Definition: types.h:90
Definition: types.h:188
void(* JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg)
Definition: types.h:283
Definition: types.h:241
Definition: types.h:489
int(* JackGraphOrderCallback)(void *arg)
Definition: types.h:338
JackStatus
Definition: types.h:167
int32_t jack_shmsize_t
Definition: types.h:29
Definition: types.h:121
enum JackOptions jack_options_t
Definition: types.h:162
Definition: types.h:113
void(* JackShutdownCallback)(void *arg)
Definition: types.h:446
JackPortFlags
Definition: types.h:483
Definition: types.h:177
Definition: types.h:226
int(* JackProcessCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:314
Definition: types.h:144
void(* JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void *arg)
Definition: types.h:422
int(* JackSampleRateCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:377
Definition: types.h:132
jack_nframes_t min
Definition: types.h:293
void(* JackFreewheelCallback)(int starting, void *arg)
Definition: types.h:431
JackOptions
Definition: types.h:108
Definition: types.h:216
Definition: types.h:127
enum JackStatus jack_status_t
Definition: types.h:248
Definition: types.h:288
Definition: types.h:149
jack_nframes_t max
Definition: types.h:297
Definition: types.h:201
Definition: types.h:501
Definition: types.h:516
uint64_t jack_time_t
Definition: types.h:65
Definition: types.h:532
float jack_default_audio_sample_t
Definition: types.h:475
jack_uuid_t jack_intclient_t
Definition: types.h:78
Definition: types.h:206
void(* JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg)
Definition: types.h:388
uint32_t jack_nframes_t
Definition: types.h:53
void(* JackClientRegistrationCallback)(const char *name, int register, void *arg)
Definition: types.h:410
Definition: types.h:138
uint32_t jack_port_id_t
Definition: types.h:96
void(* JackPortRenameCallback)(jack_port_id_t port, const char *old_name, const char *new_name, void *arg)
Definition: types.h:399
pthread_t jack_native_thread_t
Definition: types.h:103
Definition: types.h:172
Definition: types.h:231
Definition: types.h:196
Definition: types.h:221
void(* JackInfoShutdownCallback)(jack_status_t code, const char *reason, void *arg)
Definition: types.h:461
void(* JackThreadInitCallback)(void *arg)
Definition: types.h:328
enum JackLatencyCallbackMode jack_latency_callback_mode_t
Definition: types.h:274
JackLatencyCallbackMode
Definition: types.h:253
uint64_t jack_uuid_t
Definition: types.h:27
Definition: types.h:267
Definition: types.h:236
Definition: types.h:211
struct _jack_port jack_port_t
Definition: types.h:84
Definition: types.h:495
Definition: types.h:260
int(* JackBufferSizeCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:366
int(* JackXRunCallback)(void *arg)
Definition: types.h:350