1 /*
2     TiMidity -- Experimental MIDI to WAVE converter
3     Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
4 
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the Perl Artistic License, available in COPYING.
7  */
8 
9 /* Data format encoding bits */
10 
11 #define PE_MONO 	0x01  /* versus stereo */
12 #define PE_SIGNED	0x02  /* versus unsigned */
13 #define PE_16BIT 	0x04  /* versus 8-bit */
14 #define PE_ULAW 	0x08  /* versus linear */
15 #define PE_BYTESWAP	0x10  /* versus the other way */
16 
17 typedef struct {
18   int32 rate, encoding;
19   char *id_name;
20 } PlayMode;
21 
22 extern PlayMode *play_mode_list[], *play_mode;
23 extern int init_buffers(int kbytes);
24 
25 /* Conversion functions -- These overwrite the int32 data in *lp with
26    data in another format */
27 
28 /* The size of the output buffers */
29 extern int AUDIO_BUFFER_SIZE;
30 
31 /* Actual copy function */
32 extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
33 
34 /* 8-bit signed and unsigned*/
35 extern void s32tos8(void *dp, int32 *lp, int32 c);
36 extern void s32tou8(void *dp, int32 *lp, int32 c);
37 
38 /* 16-bit */
39 extern void s32tos16(void *dp, int32 *lp, int32 c);
40 extern void s32tou16(void *dp, int32 *lp, int32 c);
41 
42 /* byte-exchanged 16-bit */
43 extern void s32tos16x(void *dp, int32 *lp, int32 c);
44 extern void s32tou16x(void *dp, int32 *lp, int32 c);
45 
46 /* uLaw (8 bits) */
47 extern void s32toulaw(void *dp, int32 *lp, int32 c);
48 
49 /* little-endian and big-endian specific */
50 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
51 #define s32tou16l s32tou16
52 #define s32tou16b s32tou16x
53 #define s32tos16l s32tos16
54 #define s32tos16b s32tos16x
55 #else
56 #define s32tou16l s32tou16x
57 #define s32tou16b s32tou16
58 #define s32tos16l s32tos16x
59 #define s32tos16b s32tos16
60 #endif
61