PageRenderTime 31ms CodeModel.GetById 25ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/project/jni/sdl_mixer/timidity/output.h

https://github.com/aichunyu/FFPlayer
C Header | 75 lines | 31 code | 12 blank | 32 comment | 1 complexity | 9c9e3bb1e21c22f8dde677c7f996b0cc MD5 | raw file
 1/* 
 2
 3    TiMidity -- Experimental MIDI to WAVE converter
 4    Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
 5
 6    This program is free software; you can redistribute it and/or modify
 7    it under the terms of the GNU General Public License as published by
 8    the Free Software Foundation; either version 2 of the License, or
 9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20    output.h
21
22*/
23
24/* Data format encoding bits */
25
26#define PE_MONO 	0x01  /* versus stereo */
27#define PE_SIGNED	0x02  /* versus unsigned */
28#define PE_16BIT 	0x04  /* versus 8-bit */
29#define PE_ULAW 	0x08  /* versus linear */
30#define PE_BYTESWAP	0x10  /* versus the other way */
31
32typedef struct {
33  int32 rate, encoding;
34  char *id_name;
35} PlayMode;
36
37extern PlayMode *play_mode_list[], *play_mode;
38extern int init_buffers(int kbytes);
39
40/* Conversion functions -- These overwrite the int32 data in *lp with
41   data in another format */
42
43/* The size of the output buffers */
44extern int AUDIO_BUFFER_SIZE;
45
46/* Actual copy function */
47extern void (*s32tobuf)(void *dp, int32 *lp, int32 c);
48
49/* 8-bit signed and unsigned*/
50extern void s32tos8(void *dp, int32 *lp, int32 c);
51extern void s32tou8(void *dp, int32 *lp, int32 c);
52
53/* 16-bit */
54extern void s32tos16(void *dp, int32 *lp, int32 c);
55extern void s32tou16(void *dp, int32 *lp, int32 c);
56
57/* byte-exchanged 16-bit */
58extern void s32tos16x(void *dp, int32 *lp, int32 c);
59extern void s32tou16x(void *dp, int32 *lp, int32 c);
60
61/* uLaw (8 bits) */
62extern void s32toulaw(void *dp, int32 *lp, int32 c);
63
64/* little-endian and big-endian specific */
65#if SDL_BYTEORDER == SDL_LIL_ENDIAN
66#define s32tou16l s32tou16
67#define s32tou16b s32tou16x
68#define s32tos16l s32tos16
69#define s32tos16b s32tos16x
70#else
71#define s32tou16l s32tou16x
72#define s32tou16b s32tou16
73#define s32tos16l s32tos16x
74#define s32tos16b s32tos16
75#endif