3
TiMidity -- Experimental MIDI to WAVE converter
4
Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
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.
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.
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.
24
/* Data format encoding bits */
28
#define PE_MONO 0x01 /* versus stereo */
29
#define PE_SIGNED 0x02 /* versus unsigned */
30
#define PE_16BIT 0x04 /* versus 8-bit */
31
#define PE_ULAW 0x08 /* versus linear */
32
#define PE_BYTESWAP 0x10 /* versus the other way */
35
uint32 rate, encoding;
36
int fd; /* file descriptor for the audio device */
37
int32 extra_param[5]; /* e.g. buffer fragments, output channel, ... */
40
const char *name; /* default device or file name */
42
int (*open_output)(void); /* 0=success, 1=warning, -1=fatal error */
43
void (*close_output)(void);
44
void (*output_data)(int32 *buf, uint32 count);
45
int (*driver_output_data)(unsigned char *buf, uint32 count);
46
void (*flush_output)(void);
47
void (*purge_output)(void);
48
int (*output_count)(uint32 ct);
51
extern PlayMode *play_mode_list[], *play_mode;
52
extern char *cfg_names[];
53
extern int got_a_configuration;
55
extern int output_buffer_full;
56
extern int output_device_open;
57
/* extern int current_sample_count(uint32 ct); */
58
/* extern int driver_output_data(char *buf, uint32 count); */
59
extern int b_out_count(void);
60
extern void b_out(char id, int fd, int *buf, int ocount);
61
/* Conversion functions -- These overwrite the int32 data in *lp with
62
data in another format */
64
extern int output_clips;
66
/* 8-bit signed and unsigned*/
67
extern void s32tos8(int32 *lp, uint32 c);
68
extern void s32tou8(int32 *lp, uint32 c);
71
extern void s32tos16(int32 *lp, uint32 c);
72
extern void s32tou16(int32 *lp, uint32 c);
74
/* byte-exchanged 16-bit */
75
extern void s32tos16x(int32 *lp, uint32 c);
76
extern void s32tou16x(int32 *lp, uint32 c);
79
extern void s32toulaw(int32 *lp, uint32 c);
81
/* little-endian and big-endian specific */
83
#define s32tou16l s32tou16
84
#define s32tou16b s32tou16x
85
#define s32tos16l s32tos16
86
#define s32tos16b s32tos16x
88
#define s32tou16l s32tou16x
89
#define s32tou16b s32tou16
90
#define s32tos16l s32tos16x
91
#define s32tos16b s32tos16
94
#endif /*KMIDI_OUTPUT*/