Restructure how we look for Read files slightly.
[fvwm.git] / libs / Fplay.h
blob1815164d540e7d240bf35fe94aeb55ea6cd118e1
1 #ifndef FPLAY_H
2 #define FPLAY_H
4 #ifdef HAVE_RPLAY
5 #define USE_FPLAY 1
6 #else
7 #define USE_FPLAY 0
8 #endif
10 #if USE_FPLAY
11 # include <rplay.h>
12 # undef M_ERROR /* Solaris fix */
13 typedef RPLAY FPLAY;
14 typedef RPLAY_ATTRS FPLAY_ATTRS;
16 # define FPLAY_DEFAULT_VALUE RPLAY_DEFAULT_VOLUME
17 # define FPLAY_DEFAULT_PRIORITY RPLAY_DEFAULT_PRIORITY
18 # define FPLAY_NULL RPLAY_NULL
19 # define FPLAY_PLAY RPLAY_PLAY
20 # define FPLAY_STOP RPLAY_STOP
21 # define FPLAY_PAUSE RPLAY_PAUSE
22 # define FPLAY_CONTINUE RPLAY_CONTINUE
23 # define FPLAY_SOUND RPLAY_SOUND
24 # define FPLAY_VOLUME RPLAY_VOLUME
25 # define FPLAY_NSOUNDS RPLAY_NSOUNDS
26 # define FPLAY_COMMAND RPLAY_COMMAND
27 # define FPLAY_APPEND RPLAY_APPEND
28 # define FPLAY_INSERT RPLAY_INSERT
29 # define FPLAY_DELETE RPLAY_DELETE
30 # define FPLAY_CHANGE RPLAY_CHANGE
31 # define FPLAY_COUNT RPLAY_COUNT
32 # define FPLAY_LIST_COUNT RPLAY_LIST_COUNT
33 # define FPLAY_PRIORITY RPLAY_PRIORITY
34 # define FPLAY_RANDOM_SOUND RPLAY_RANDOM_SOUND
35 # define FPLAY_PING RPLAY_PING
36 # define FPLAY_RPTP_SERVER RPLAY_RPTP_SERVER
37 # define FPLAY_RPTP_SERVER_PORT RPLAY_RPTP_SERVER_PORT
38 # define FPLAY_RPTP_SEARCH RPLAY_RPTP_SEARCH
39 # define FPLAY_RPTP_FROM_SENDER RPLAY_RPTP_FROM_SENDER
40 # define FPLAY_SAMPLE_RATE RPLAY_SAMPLE_RATE
41 # define FPLAY_RESET RPLAY_RESET
42 # define FPLAY_DONE RPLAY_DONE
43 # define FPLAY_CLIENT_DATA RPLAY_CLIENT_DATA
44 # define FPLAY_LIST_NAME RPLAY_LIST_NAME
45 # define FPLAY_PUT RPLAY_PUT
46 # define FPLAY_ID RPLAY_ID
47 # define FPLAY_SEQUENCE RPLAY_SEQUENCE
48 # define FPLAY_DATA RPLAY_DATA
49 # define FPLAY_DATA_SIZE RPLAY_DATA_SIZE
50 # define FPLAY_FORMAT_NONE RPLAY_FORMAT_NONE
51 # define FPLAY_FORMAT_LINEAR_8 RPLAY_FORMAT_LINEAR_8
52 # define FPLAY_FORMAT_ULINEAR_8 RPLAY_FORMAT_ULINEAR_8
53 # define FPLAY_FORMAT_LINEAR_16 RPLAY_FORMAT_LINEAR_16
54 # define FPLAY_FORMAT_ULINEAR_16 RPLAY_FORMAT_ULINEAR_16
55 # define FPLAY_FORMAT_ULAW RPLAY_FORMAT_ULAW
56 # define FPLAY_FORMAT_G721 RPLAY_FORMAT_G721
57 # define FPLAY_FORMAT_G723_3 RPLAY_FORMAT_G723_3
58 # define FPLAY_FORMAT_G723_5 RPLAY_FORMAT_G723_5
59 # define FPLAY_FORMAT_GSM RPLAY_FORMAT_GSM
60 # define FPLAY_BIG_ENDIAN RPLAY_BIG_ENDIAN
61 # define FPLAY_LITTLE_ENDIAN RPLAY_LITTLE_ENDIAN
62 # define FPLAY_AUDIO_PORT_NONE RPLAY_AUDIO_PORT_NONE
63 # define FPLAY_AUDIO_PORT_SPEAKER RPLAY_AUDIO_PORT_SPEAKER
64 # define FPLAY_AUDIO_PORT_HEADPHONE RPLAY_AUDIO_PORT_HEADPHONE
65 # define FPLAY_AUDIO_PORT_LINEOUT RPLAY_AUDIO_PORT_LINEOUT
66 # define FPLAY_MIN_VOLUME RPLAY_MIN_VOLUME
67 # define FPLAY_MAX_VOLUME RPLAY_MAX_VOLUME
68 # define FPLAY_MIN_PRIORITY RPLAY_MIN_PRIORITY
69 # define FPLAY_MAX_PRIORITY RPLAY_MAX_PRIORITY
70 # define FPLAY_DEFAULT_VOLUME RPLAY_DEFAULT_VOLUME
71 # define FPLAY_DEFAULT_PRIORITY RPLAY_DEFAULT_PRIORITY
72 # define FPLAY_DEFAULT_COUNT RPLAY_DEFAULT_COUNT
73 # define FPLAY_DEFAULT_LIST_COUNT RPLAY_DEFAULT_LIST_COUNT
74 # define FPLAY_DEFAULT_RANDOM_SOUND RPLAY_DEFAULT_RANDOM_SOUND
75 # define FPLAY_DEFAULT_SAMPLE_RATE RPLAY_DEFAULT_SAMPLE_RATE
76 # define FPLAY_DEFAULT_OFFSET RPLAY_DEFAULT_OFFSET
77 # define FPLAY_DEFAULT_BYTE_ORDER RPLAY_DEFAULT_BYTE_ORDER
78 # define FPLAY_DEFAULT_CHANNELS RPLAY_DEFAULT_CHANNELS
79 # define FPLAY_DEFAULT_BITS RPLAY_DEFAULT_BITS
80 # define FPLAY_ERROR_NONE RPLAY_ERROR_NONE
81 # define FPLAY_ERROR_MEMORY RPLAY_ERROR_MEMORY
82 # define FPLAY_ERROR_HOST RPLAY_ERROR_HOST
83 # define FPLAY_ERROR_CONNECT RPLAY_ERROR_CONNECT
84 # define FPLAY_ERROR_SOCKET RPLAY_ERROR_SOCKET
85 # define FPLAY_ERROR_WRITE RPLAY_ERROR_WRITE
86 # define FPLAY_ERROR_CLOSE RPLAY_ERROR_CLOSE
87 # define FPLAY_ERROR_PACKET_SIZE RPLAY_ERROR_PACKET_SIZE
88 # define FPLAY_ERROR_BROADCAST RPLAY_ERROR_BROADCAST
89 # define FPLAY_ERROR_ATTRIBUTE RPLAY_ERROR_ATTRIBUTE
90 # define FPLAY_ERROR_COMMAND RPLAY_ERROR_COMMAND
91 # define FPLAY_ERROR_INDEX RPLAY_ERROR_INDEX
92 # define FPLAY_ERROR_MODIFIER RPLAY_ERROR_MODIFIER
93 # define FRPTP_ERROR_NONE RPTP_ERROR_NONE
94 # define FRPTP_ERROR_MEMORY RPTP_ERROR_MEMORY
95 # define FRPTP_ERROR_HOST RPTP_ERROR_HOST
96 # define FRPTP_ERROR_CONNECT RPTP_ERROR_CONNECT
97 # define FRPTP_ERROR_SOCKET RPTP_ERROR_SOCKET
98 # define FRPTP_ERROR_OPEN RPTP_ERROR_OPEN
99 # define FRPTP_ERROR_READ RPTP_ERROR_READ
100 # define FRPTP_ERROR_WRITE RPTP_ERROR_WRITE
101 # define FRPTP_ERROR_PING RPTP_ERROR_PING
102 # define FRPTP_ERROR_TIMEOUT RPTP_ERROR_TIMEOUT
103 # define FRPTP_ERROR_PROTOCOL RPTP_ERROR_PROTOCOL
104 # define FRPTP_ERROR RPTP_ERROR
105 # define FRPTP_OK RPTP_OK
106 # define FRPTP_TIMEOUT RPTP_TIMEOUT
107 # define FRPTP_NOTIFY RPTP_NOTIFY
108 # define FOLD_RPLAY_PLAY OLD_RPLAY_PLAY
109 # define FOLD_RPLAY_STOP OLD_RPLAY_STOP
110 # define FOLD_RPLAY_PAUSE OLD_RPLAY_PAUSE
111 # define FOLD_RPLAY_CONTINUE OLD_RPLAY_CONTINUE
112 # define FRPTP_ASYNC_READ RPTP_ASYNC_READ
113 # define FRPTP_ASYNC_WRITE RPTP_ASYNC_WRITE
114 # define FRPTP_ASYNC_RAW RPTP_ASYNC_RAW
115 # define FRPTP_ASYNC_ENABLE RPTP_ASYNC_ENABLE
116 # define FRPTP_ASYNC_DISABLE RPTP_ASYNC_DISABLE
117 # define FRPTP_EVENT_OK RPTP_EVENT_OK
118 # define FRPTP_EVENT_ERROR RPTP_EVENT_ERROR
119 # define FRPTP_EVENT_TIMEOUT RPTP_EVENT_TIMEOUT
120 # define FRPTP_EVENT_OTHER RPTP_EVENT_OTHER
121 # define FRPTP_EVENT_CONTINUE RPTP_EVENT_CONTINUE
122 # define FRPTP_EVENT_DONE RPTP_EVENT_DONE
123 # define FRPTP_EVENT_PAUSE RPTP_EVENT_PAUSE
124 # define FRPTP_EVENT_PLAY RPTP_EVENT_PLAY
125 # define FRPTP_EVENT_SKIP RPTP_EVENT_SKIP
126 # define FRPTP_EVENT_STATE RPTP_EVENT_STATE
127 # define FRPTP_EVENT_STOP RPTP_EVENT_STOP
128 # define FRPTP_EVENT_VOLUME RPTP_EVENT_VOLUME
129 # define FRPTP_EVENT_CLOSE RPTP_EVENT_CLOSE
130 # define FRPTP_EVENT_FLOW RPTP_EVENT_FLOW
131 # define FRPTP_EVENT_MODIFY RPTP_EVENT_MODIFY
132 # define FRPTP_EVENT_LEVEL RPTP_EVENT_LEVEL
133 # define FRPTP_EVENT_POSITION RPTP_EVENT_POSITION
134 # define FRPTP_EVENT_ALL RPTP_EVENT_ALL
135 # define FRPTP_MAX_ARGS RPTP_MAX_ARGS
136 # define FRPTP_MAX_LINE RPTP_MAX_LINE
137 # define FPLAY_PORT RPLAY_PORT
138 # define FRPTP_PORT RPTP_PORT
139 # define FOLD_RPLAY_PORT OLD_RPLAY_PORT
140 # define FOLD_RPTP_PORT OLD_RPTP_PORT
141 # define FPLAY_PACKET_ID RPLAY_PACKET_ID
143 # define Fplay_errno rplay_errno
144 # define Frptp_errno rptp_errno
146 # define Fplay(a,b) rplay(a,b)
147 # define Fplay_create(a) rplay_create(a)
148 # define Fplay_perror(a) rplay_perror(a)
149 /* variadict macros appeared in C99, so we can't use them */
150 # define Fplay_set rplay_set
151 # define Fplay_get rplay_get
152 # define Frptp_putline rptp_putline
153 # define Frptp_async_putline rptp_async_putline
154 # define Fplay_destroy(a) rplay_destroy(a)
155 # define Fplay_default_host() rplay_default_host()
156 # define Fplay_display(a) rplay_display(a)
157 # define Fplay_host(a,b) rplay_host(a,b)
158 # define Fplay_host_volume(a,b,c) rplay_host_volume(a,b,c)
159 # define Fplay_local(a) rplay_local(a)
160 # define Fplay_open(a) rplay_open(a)
161 # define Fplay_open_default() rplay_open_default()
162 # define Fplay_open_display() rplay_open_display()
163 # define Fplay_open_port(a,b) rplay_open_port(a,b)
164 # define Fplay_open_sockaddr_in(a) rplay_open_sockaddr(a)
165 # define Fplay_ping(a) rplay_ping(a)
166 # define Fplay_ping_sockaddr_in(a) rplay_ping_sockaddr_in(a)
167 # define Fplay_ping_sockfd(a) rplay_ping_sockfd(a)
168 # define Fplay_close(a) rplay_close(a)
169 # define Fplay_sound(a,b) rplay_sound(a,b)
170 # define Fplay_default(a) rplay_default(a)
171 # define Fplay_convert(a) rplay_convert(a)
172 # define Fplay_pack(a) rplay_pack(a)
173 # define Fplay_unpack(a) rplay_unpack(a)
174 # define Frptp_open(a,b,c,d) rptp_open(a,b,c,d)
175 # define Frptp_read(a,b,c) rptp_read(a,b,c)
176 # define Frptp_write(a,b,c) rptp_write(a,b,c)
177 # define Frptp_close(a) rptp_close(a)
178 # define Frptp_perror(a) rptp_perror(a)
179 # define Frptp_getline(a,b,c) rptp_getline(a,b,c)
180 # define Frptp_command(a,b,c,d) rptp_command(a,b,c,d)
181 # define Frptp_parse(a,b) rptp_parse(a,b)
182 # define Frptp_async_write(a,b,c,d) rptp_async_write(a,b,c,d)
183 # define Frptp_async_register(a,b,c) rptp_async_register(a,b,c)
184 # define Frptp_async_notify(a,b,c) rptp_async_notify(a,b,c)
185 # define Frptp_async_process(a,b) rptp_async_process(a,b)
186 # define Frptp_main_loop() rptp_main_loop()
187 # define Frptp_stop_main_loop(a) rptp_stop_main_loop(a)
188 #else
189 typedef void FPLAY;
190 typedef void FPLAY_ATTRS;
191 # define FPLAY_DEFAULT_VALUE 0
192 # define FPLAY_DEFAULT_PRIORITY 0
193 # define FPLAY_NULL 0
194 # define FPLAY_PLAY 0
195 # define FPLAY_STOP 0
196 # define FPLAY_PAUSE 0
197 # define FPLAY_CONTINUE 0
198 # define FPLAY_SOUND 0
199 # define FPLAY_VOLUME 0
200 # define FPLAY_NSOUNDS 0
201 # define FPLAY_COMMAND 0
202 # define FPLAY_APPEND 0
203 # define FPLAY_INSERT 0
204 # define FPLAY_DELETE 0
205 # define FPLAY_CHANGE 0
206 # define FPLAY_COUNT 0
207 # define FPLAY_LIST_COUNT 0
208 # define FPLAY_PRIORITY 0
209 # define FPLAY_RANDOM_SOUND 0
210 # define FPLAY_PING 0
211 # define FPLAY_RPTP_SERVER 0
212 # define FPLAY_RPTP_SERVER_PORT 0
213 # define FPLAY_RPTP_SEARCH 0
214 # define FPLAY_RPTP_FROM_SENDER 0
215 # define FPLAY_SAMPLE_RATE 0
216 # define FPLAY_RESET 0
217 # define FPLAY_DONE 0
218 # define FPLAY_CLIENT_DATA 0
219 # define FPLAY_LIST_NAME 0
220 # define FPLAY_PUT 0
221 # define FPLAY_ID 0
222 # define FPLAY_SEQUENCE 0
223 # define FPLAY_DATA 0
224 # define FPLAY_DATA_SIZE 0
225 # define FPLAY_FORMAT_NONE 0
226 # define FPLAY_FORMAT_LINEAR_8 0
227 # define FPLAY_FORMAT_ULINEAR_8 0
228 # define FPLAY_FORMAT_LINEAR_16 0
229 # define FPLAY_FORMAT_ULINEAR_16 0
230 # define FPLAY_FORMAT_ULAW 0
231 # define FPLAY_FORMAT_G721 0
232 # define FPLAY_FORMAT_G723_3 0
233 # define FPLAY_FORMAT_G723_5 0
234 # define FPLAY_FORMAT_GSM 0
235 # define FPLAY_BIG_ENDIAN 0
236 # define FPLAY_LITTLE_ENDIAN 0
237 # define FPLAY_AUDIO_PORT_NONE 0
238 # define FPLAY_AUDIO_PORT_SPEAKER 0
239 # define FPLAY_AUDIO_PORT_HEADPHONE 0
240 # define FPLAY_AUDIO_PORT_LINEOUT 0
241 # define FPLAY_MIN_VOLUME 0
242 # define FPLAY_MAX_VOLUME 0
243 # define FPLAY_MIN_PRIORITY 0
244 # define FPLAY_MAX_PRIORITY 0
245 # define FPLAY_DEFAULT_VOLUME 0
246 # define FPLAY_DEFAULT_PRIORITY 0
247 # define FPLAY_DEFAULT_COUNT 0
248 # define FPLAY_DEFAULT_LIST_COUNT 0
249 # define FPLAY_DEFAULT_RANDOM_SOUND 0
250 # define FPLAY_DEFAULT_SAMPLE_RATE 0
251 # define FPLAY_DEFAULT_OFFSET 0
252 # define FPLAY_DEFAULT_BYTE_ORDER 0
253 # define FPLAY_DEFAULT_CHANNELS 0
254 # define FPLAY_DEFAULT_BITS 0
255 # define FPLAY_ERROR_NONE 0
256 # define FPLAY_ERROR_MEMORY 0
257 # define FPLAY_ERROR_HOST 0
258 # define FPLAY_ERROR_CONNECT 0
259 # define FPLAY_ERROR_SOCKET 0
260 # define FPLAY_ERROR_WRITE 0
261 # define FPLAY_ERROR_CLOSE 0
262 # define FPLAY_ERROR_PACKET_SIZE 0
263 # define FPLAY_ERROR_BROADCAST 0
264 # define FPLAY_ERROR_ATTRIBUTE 0
265 # define FPLAY_ERROR_COMMAND 0
266 # define FPLAY_ERROR_INDEX 0
267 # define FPLAY_ERROR_MODIFIER 0
268 # define FRPTP_ERROR_NONE 0
269 # define FRPTP_ERROR_MEMORY 0
270 # define FRPTP_ERROR_HOST 0
271 # define FRPTP_ERROR_CONNECT 0
272 # define FRPTP_ERROR_SOCKET 0
273 # define FRPTP_ERROR_OPEN 0
274 # define FRPTP_ERROR_READ 0
275 # define FRPTP_ERROR_WRITE 0
276 # define FRPTP_ERROR_PING 0
277 # define FRPTP_ERROR_TIMEOUT 0
278 # define FRPTP_ERROR_PROTOCOL 0
279 # define FRPTP_ERROR 0
280 # define FRPTP_OK 0
281 # define FRPTP_TIMEOUT 0
282 # define FRPTP_NOTIFY 0
283 # define FOLD_RPLAY_PLAY 0
284 # define FOLD_RPLAY_STOP 0
285 # define FOLD_RPLAY_PAUSE 0
286 # define FOLD_RPLAY_CONTINUE 0
287 # define FRPTP_ASYNC_READ 0
288 # define FRPTP_ASYNC_WRITE 0
289 # define FRPTP_ASYNC_RAW 0
290 # define FRPTP_ASYNC_ENABLE 0
291 # define FRPTP_ASYNC_DISABLE 0
292 # define FRPTP_EVENT_OK 0
293 # define FRPTP_EVENT_ERROR 0
294 # define FRPTP_EVENT_TIMEOUT 0
295 # define FRPTP_EVENT_OTHER 0
296 # define FRPTP_EVENT_CONTINUE 0
297 # define FRPTP_EVENT_DONE 0
298 # define FRPTP_EVENT_PAUSE 0
299 # define FRPTP_EVENT_PLAY 0
300 # define FRPTP_EVENT_SKIP 0
301 # define FRPTP_EVENT_STATE 0
302 # define FRPTP_EVENT_STOP 0
303 # define FRPTP_EVENT_VOLUME 0
304 # define FRPTP_EVENT_CLOSE 0
305 # define FRPTP_EVENT_FLOW 0
306 # define FRPTP_EVENT_MODIFY 0
307 # define FRPTP_EVENT_LEVEL 0
308 # define FRPTP_EVENT_POSITION 0
309 # define FRPTP_EVENT_ALL 0
310 # define FRPTP_MAX_ARGS 0
311 # define FRPTP_MAX_LINE 0
312 # define FPLAY_PORT 0
313 # define FRPTP_PORT 0
314 # define FOLD_RPLAY_PORT 0
315 # define FOLD_RPTP_PORT 0
316 # define FPLAY_PACKET_ID 0
318 # define Fplay_errno 0
319 # define Frptp_errno 0
322 # define Fplay(a,b) 0
323 # define Fplay_create(a) 0
324 # define Fplay_perror(a)
325 /* variadict macros appeared in C99, so we can't use them. */
326 static void Fplay_set(FPLAY *a, ...) {}
327 static int Fplay_get(FPLAY *a, ...) {return 0;}
328 static int Frptp_putline(int a, ...) {return 0;}
329 # define Frptp_async_putline Frptp_putline
331 # define Fplay_set(...)
332 # define Fplay_get(...) 0
333 # define Frptp_putline(...) 0
334 # define Frptp_async_putline(...) 0
336 # define Fplay_destroy(a)
337 # define Fplay_default_host() ""
338 # define Fplay_display(a) 0
339 # define Fplay_host(a,b) 0
340 # define Fplay_host_volume(a,b,c) 0
341 # define Fplay_local(a) 0
342 # define Fplay_open(a) -1
343 # define Fplay_open_default() -1
344 # define Fplay_open_display() -1
345 # define Fplay_open_port(a,b) -1
346 # define Fplay_open_sockaddr_in(a) -1
347 # define Fplay_close(a) 0
348 # define Fplay_ping(a) 0
349 # define Fplay_ping_sockaddr_in(a) 0
350 # define Fplay_ping_sockfd(a) 0
351 # define Fplay_sound(a,b) 0
352 # define Fplay_default(a) 0
353 # define Fplay_convert(a) NULL
354 # define Fplay_pack(a) 0
355 # define Fplay_unpack(a) 0
356 # define Frptp_open(a,b,c,d) -1
357 # define Frptp_read(a,b,c) 0
358 # define Frptp_write(a,b,c) 0
359 # define Frptp_close(a) 0
360 # define Frptp_perror(a)
361 # define Frptp_getline(a,b,c) 0
362 # define Frptp_command(a,b,c,d) 0
363 # define Frptp_parse(a,b) NULL
364 # define Frptp_async_write(a,b,c,d) 0
365 # define Frptp_async_register(a,b,c)
366 # define Frptp_async_notify(a,b,c)
367 # define Frptp_async_process(a,b)
368 # define Frptp_main_loop() 0
369 # define Frptp_stop_main_loop(a)
370 #endif
372 #endif