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 
102 enum JackOptions {
103 
107  JackNullOption = 0x00,
108 
115  JackNoStartServer = 0x01,
116 
121  JackUseExactName = 0x02,
122 
126  JackServerName = 0x04,
127 
132  JackLoadName = 0x08,
133 
138  JackLoadInit = 0x10,
139 
143  JackSessionID = 0x20
144 };
145 
147 #define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
148 
150 #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
151 
156 typedef enum JackOptions jack_options_t;
157 
161 enum JackStatus {
162 
166  JackFailure = 0x01,
167 
171  JackInvalidOption = 0x02,
172 
182  JackNameNotUnique = 0x04,
183 
190  JackServerStarted = 0x08,
191 
195  JackServerFailed = 0x10,
196 
200  JackServerError = 0x20,
201 
205  JackNoSuchClient = 0x40,
206 
210  JackLoadFailure = 0x80,
211 
215  JackInitFailure = 0x100,
216 
220  JackShmFailure = 0x200,
221 
225  JackVersionError = 0x400,
226 
227  /*
228  * BackendError
229  */
230  JackBackendError = 0x800,
231 
232  /*
233  * Client is being shutdown against its will
234  */
235  JackClientZombie = 0x1000
236 };
237 
242 typedef enum JackStatus jack_status_t;
243 
248 
255 
262 
263 };
264 
269 
277 typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
278 
282 struct _jack_latency_range
283 {
292 };
293 
295 
308 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
309 
322 typedef void (*JackThreadInitCallback)(void *arg);
323 
332 typedef int (*JackGraphOrderCallback)(void *arg);
333 
344 typedef int (*JackXRunCallback)(void *arg);
345 
360 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
361 
371 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
372 
382 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
383 
393 typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg);
394 
404 typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
405 
416 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
417 
425 typedef void (*JackFreewheelCallback)(int starting, void *arg);
426 
427 typedef void *(*JackThreadCallback)(void* arg);
428 
440 typedef void (*JackShutdownCallback)(void *arg);
441 
455 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
456 
461 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
462 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
463 
469 typedef float jack_default_audio_sample_t;
470 
477 enum JackPortFlags {
478 
483  JackPortIsInput = 0x1,
484 
489  JackPortIsOutput = 0x2,
490 
495  JackPortIsPhysical = 0x4,
496 
510  JackPortCanMonitor = 0x8,
511 
526  JackPortIsTerminal = 0x10
527 };
528 
529 
530 #endif /* __jack_types_h__ */
Definition: types.h:281
jack_nframes_t max
Definition: types.h:289
jack_nframes_t min
Definition: types.h:285
int(* JackSampleRateCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:369
enum JackOptions jack_options_t
Definition: types.h:154
void(* JackShutdownCallback)(void *arg)
Definition: types.h:438
void(* JackFreewheelCallback)(int starting, void *arg)
Definition: types.h:423
uint64_t jack_uuid_t
Definition: types.h:27
void(* JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void *arg)
Definition: types.h:414
void(* JackThreadInitCallback)(void *arg)
Definition: types.h:320
JackOptions
Definition: types.h:100
@ JackLoadInit
Definition: types.h:136
@ JackServerName
Definition: types.h:124
@ JackUseExactName
Definition: types.h:119
@ JackNoStartServer
Definition: types.h:113
@ JackLoadName
Definition: types.h:130
@ JackNullOption
Definition: types.h:105
@ JackSessionID
Definition: types.h:141
enum JackStatus jack_status_t
Definition: types.h:240
uint32_t jack_port_id_t
Definition: types.h:95
JackLatencyCallbackMode
Definition: types.h:245
@ JackPlaybackLatency
Definition: types.h:259
@ JackCaptureLatency
Definition: types.h:252
jack_uuid_t jack_intclient_t
Definition: types.h:77
struct _jack_port jack_port_t
Definition: types.h:83
void(* JackClientRegistrationCallback)(const char *name, int, void *arg)
Definition: types.h:402
struct _jack_client jack_client_t
Definition: types.h:89
uint32_t jack_nframes_t
Definition: types.h:53
int(* JackBufferSizeCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:358
JackStatus
Definition: types.h:159
@ JackServerError
Definition: types.h:198
@ JackNameNotUnique
Definition: types.h:180
@ JackFailure
Definition: types.h:164
@ JackLoadFailure
Definition: types.h:208
@ JackBackendError
Definition: types.h:228
@ JackServerStarted
Definition: types.h:188
@ JackVersionError
Definition: types.h:223
@ JackInitFailure
Definition: types.h:213
@ JackServerFailed
Definition: types.h:193
@ JackInvalidOption
Definition: types.h:169
@ JackNoSuchClient
Definition: types.h:203
@ JackShmFailure
Definition: types.h:218
@ JackClientZombie
Definition: types.h:233
int32_t jack_shmsize_t
Definition: types.h:29
void(* JackPortRenameCallback)(jack_port_id_t port, const char *old_name, const char *new_name, void *arg)
Definition: types.h:391
void(* JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg)
Definition: types.h:380
int(* JackProcessCallback)(jack_nframes_t nframes, void *arg)
Definition: types.h:306
void(* JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg)
Definition: types.h:275
int(* JackXRunCallback)(void *arg)
Definition: types.h:342
int(* JackGraphOrderCallback)(void *arg)
Definition: types.h:330
JackPortFlags
Definition: types.h:475
@ JackPortCanMonitor
Definition: types.h:508
@ JackPortIsPhysical
Definition: types.h:493
@ JackPortIsInput
Definition: types.h:481
@ JackPortIsOutput
Definition: types.h:487
@ JackPortIsTerminal
Definition: types.h:524
void(* JackInfoShutdownCallback)(jack_status_t code, const char *reason, void *arg)
Definition: types.h:453
enum JackLatencyCallbackMode jack_latency_callback_mode_t
Definition: types.h:266
float jack_default_audio_sample_t
Definition: types.h:467
uint64_t jack_time_t
Definition: types.h:64