** Warning: Cannot open xref database.
1 /*
2 Copyright (C) 2001 Paul Davis
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $Id: types.h,v 1.22 2003/12/01 19:45:14 pbd Exp $
19 */
20
21 #ifndef __jack_types_h__
22 #define __jack_types_h__
23
24 #include <inttypes.h>
25
26 typedef char shm_name_t[32];
27 typedef int32_t jack_shmsize_t;
28
29 /**
30 * Type used to represent sample frame counts.
31 */
32 typedef uint32_t jack_nframes_t;
33
34 /**
35 * Maximum value that can be stored in jack_nframes_t
36 */
37 #define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but
38 C++ has a problem with that. */
39
40 /**
41 * Type used to represent the value of free running
42 * monotonic clock with units of microseconds.
43 */
44
45 /* JOQ: this is trouble. APPLE POWERPC should use a compatible
46 * typedef, explicitly converting from double, if necessary.
47 * Otherwise applications cannot safely print a jack_time_t. */
48 #if defined(__APPLE__) && defined(__POWERPC__)
49 typedef double jack_time_t;
50 #else
51 typedef uint64_t jack_time_t;
52 #endif
53
54 /**
55 * jack_port_t is an opaque type. You may only access it using the
56 * API provided.
57 */
58 typedef struct _jack_port jack_port_t;
59
60 /**
61 * jack_client_t is an opaque type. You may only access it using the
62 * API provided.
63 */
64 typedef struct _jack_client jack_client_t;
65
66 /**
67 * Ports have unique ids. A port registration callback is the only
68 * place you ever need to know their value.
69 */
70 typedef uint32_t jack_port_id_t;
71
72 /**
73 * Prototype for the client supplied function that is called
74 * by the engine anytime there is work to be done.
75 *
76 * @pre nframes == jack_get_buffer_size()
77 * @pre nframes == pow(2,x)
78 *
79 * @param nframes number of frames to process
80 * @param arg pointer to a client supplied structure
81 *
82 * @return zero on success, non-zero on error
83 */
84 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
85
86 /**
87 * Prototype for the client supplied function that is called
88 * whenever the processing graph is reordered.
89 *
90 * @param arg pointer to a client supplied structure
91 *
92 * @return zero on success, non-zero on error
93 */
94 typedef int (*JackGraphOrderCallback)(void *arg);
95
96 /**
97 * Prototype for the client supplied function that is called
98 * whenever an xrun has occured.
99 *
100 * @param arg pointer to a client supplied structure
101 *
102 * @return zero on success, non-zero on error
103 */
104 typedef int (*JackXRunCallback)(void *arg);
105
106 /**
107 * Prototype for the @a bufsize_callback that is invoked whenever the
108 * JACK engine buffer size changes. Although this function is called
109 * in the JACK process thread, the normal process cycle is suspended
110 * during its operation, causing a gap in the audio flow. So, the @a
111 * bufsize_callback can allocate storage, touch memory not previously
112 * referenced, and perform other operations that are not realtime
113 * safe.
114 *
115 * @param nframes buffer size
116 * @param arg pointer supplied by jack_set_buffer_size_callback().
117 *
118 * @return zero on success, non-zero on error
119 */
120 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
121
122 /**
123 * Prototype for the client supplied function that is called
124 * when the engine sample rate changes.
125 *
126 * @param nframes new engine sample rate
127 * @param arg pointer to a client supplied structure
128 *
129 * @return zero on success, non-zero on error
130 */
131 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
132
133 /**
134 * Prototype for the client supplied function that is called
135 * whenever a port is registered or unregistered.
136 *
137 * @param arg pointer to a client supplied structure
138 */
139 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int, void *arg);
140
141 /**
142 * Prototype for the client supplied function that is called
143 * whenever jackd starts or stops freewheeling.
144 *
145 * @param starting non-zero if we start starting to freewheel, zero otherwise
146 * @param arg pointer to a client supplied structure
147 */
148 typedef void (*JackFreewheelCallback)(int starting, void *arg);
149
150 /**
151 * Used for the type argument of jack_port_register() for default
152 * audio ports.
153 */
154 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
155
156 /**
157 * For convenience, use this typedef if you want to be able to change
158 * between float and double. You may want to typedef sample_t to
159 * jack_default_audio_sample_t in your application.
160 */
161 typedef float jack_default_audio_sample_t;
162
163 /**
164 * A port has a set of flags that are formed by AND-ing together the
165 * desired values from the list below. The flags "JackPortIsInput" and
166 * "JackPortIsOutput" are mutually exclusive and it is an error to use
167 * them both.
168 */
169 enum JackPortFlags {
170
171 /**
172 * if JackPortIsInput is set, then the port can receive
173 * data.
174 */
175 JackPortIsInput = 0x1,
176
177 /**
178 * if JackPortIsOutput is set, then data can be read from
179 * the port.
180 */
181 JackPortIsOutput = 0x2,
182
183 /**
184 * if JackPortIsPhysical is set, then the port corresponds
185 * to some kind of physical I/O connector.
186 */
187 JackPortIsPhysical = 0x4,
188
189 /**
190 * if JackPortCanMonitor is set, then a call to
191 * jack_port_request_monitor() makes sense.
192 *
193 * Precisely what this means is dependent on the client. A typical
194 * result of it being called with TRUE as the second argument is
195 * that data that would be available from an output port (with
196 * JackPortIsPhysical set) is sent to a physical output connector
197 * as well, so that it can be heard/seen/whatever.
198 *
199 * Clients that do not control physical interfaces
200 * should never create ports with this bit set.
201 */
202 JackPortCanMonitor = 0x8,
203
204 /**
205 * JackPortIsTerminal means:
206 *
207 * for an input port: the data received by the port
208 * will not be passed on or made
209 * available at any other port
210 *
211 * for an output port: the data available at the port
212 * does not originate from any other port
213 *
214 * Audio synthesizers, i/o h/w interface clients, HDR
215 * systems are examples of things that would set this
216 * flag for their ports.
217 */
218 JackPortIsTerminal = 0x10
219 };
220
221 #endif /* __jack_types_h__ */
222
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.