[go: up one dir, main page]

File: audriv.h

package info (click to toggle)
timidity 2.13.2-9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,224 kB
  • ctags: 16,830
  • sloc: ansic: 158,286; sh: 3,621; makefile: 1,143; tcl: 1,048; lisp: 499; perl: 285; ruby: 126
file content (184 lines) | stat: -rw-r--r-- 5,795 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/*
    TiMidity++ -- MIDI to WAVE converter and player
    Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
    Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef ___AUDRIV_H_
#define ___AUDRIV_H_

#ifndef Bool
#define Bool int
#endif

#ifndef False
#define False 0
#endif

#ifndef True
#define True 1
#endif

extern char audriv_errmsg[BUFSIZ];
/* 顼ȯϡ顼åꤵޤ
 * ưƤϡѹޤ
 */

/* ǥ򼨤 */
enum audriv_ports
{
    AUDRIV_OUTPUT_SPEAKER,
    AUDRIV_OUTPUT_HEADPHONE,
    AUDRIV_OUTPUT_LINE_OUT
};


extern Bool audriv_setup_audio(void);
/* ǥνԤޤ
 *  True 򡤼Ԥ False ֤ޤ
 */

extern void audriv_free_audio(void);
/* audio θԤޤ
 */

extern Bool audriv_play_open(void);
/* audio Ѥ˳ĤǤ audriv_write() ˤղǽ
 * ֤ˤޤ˳ƤϤʤˤԤޤ
 *  True 򡤼Ԥ False ֤ޤ
 */

extern void audriv_play_close(void);
/* Ѥ˥ץ󤵤줿 audio ĤޤǤĤƤ
 * ϤʤˤԤޤ
 */

extern long audriv_play_stop(void);
/* դ¨¤ߤľΥץ֤ޤ
 * audriv_play_stop() θƤӽФˤäơaudio Ĥޤ
 * audio ĤƤ audriv_play_stop() ƤӽФ 0 
 * ֤ޤ
 * 顼ξ -1 ֤ޤ
 */

extern Bool audriv_is_play_open(void);
/* audio դǥץ󤵤Ƥ True,
 * ĤƤ False ֤ޤ
 */

extern Bool audriv_set_play_volume(int volume);
/* ղ̤ 0  255 ϰꤷޤ0 ̵255 Ϻ粻̡
 * 0 ̤ 0255 Ķͤ 255 
 *  True 򡤼Ԥ False ֤ޤ
 */

extern int audriv_get_play_volume(void);
/* ղ̤ 0  255 ޤ0 ̵255 Ϻ粻̡
 * Ԥ -1 ֤Ǥʤ 0  255 β̤֤ޤ
 */

extern Bool audriv_set_play_output(int port);
/* audio ν port ꤷޤport ˤϰʲΤɤ줫ꤷޤ
 *
 *     AUDRIV_OUTPUT_SPEAKER	ԡ˽ϡ
 *     AUDRIV_OUTPUT_HEADPHONE	إåɥۥ˽ϡ
 *     AUDRIV_OUTPUT_LINE_OUT	饤󥢥Ȥ˽ϡ
 *
 *  True 򡤼Ԥ False ֤ޤ
 */

extern int audriv_get_play_output(void);
/* audio ν port ޤ
 * Ԥ -1 ֤ȰʲΤ줫֤ͤޤ
 *
 *     AUDRIV_OUTPUT_SPEAKER	ԡ˽ϡ
 *     AUDRIV_OUTPUT_HEADPHONE	إåɥۥ˽ϡ
 *     AUDRIV_OUTPUT_LINE_OUT	饤󥢥Ȥ˽ϡ
 *
 */

extern int audriv_write(char *buff, int n);
/* audio  buff  n Хʬήߤޤ
 * audriv_set_noblock_write() ֥å⡼ɤꤵ줿
 * ϡδؿθƤӽФ¨¤˽֤ޤ
 * ֤ͤϼºݤήޤ줿ХȿǤꡤ֥å⡼ɤ
 * Ƥϡ n 꾯ʤ礬ޤ
 * Ԥ -1 ֤ȡºݤήޤ줿Хȿ֤ޤ
 */

extern Bool audriv_set_noblock_write(Bool noblock);
/* noblock  True ꤹȡaudriv_write() ƤӽФǥ֥åޤ
 * False ꤹȡǥեȤξ֤ᤷޤ
 *  True 򡤼Ԥ False ֤ޤ
 */

extern int audriv_play_active(void);
/* ʤ 1Ǥʤʤ 0, 顼ʤ -1 ֤ޤ
 */

extern long audriv_play_samples(void);
/* ߱Υץ֤֤ޤ
 */

extern long audriv_get_filled(void);
/* ǥХåեΥХȿ֤ޤ
 * 顼ξ -1 ֤ޤ
 */

extern const long *audriv_available_encodings(int *n_ret);
/* ޥ󤬥ݡȤƤ뤹٤Ƥ沽ꥹȤ֤ޤn_ret ˤ
 * μο֤ޤ沽򤢤魯ͤ
 * aenc.h ƤͤǤ
 * ֤ͤ free ƤϤʤޤ
 */

extern const long *audriv_available_sample_rates(int *n_ret);
/* ޥ󤬥ݡȤƤ뤹٤ƤΥץ졼ȤΥꥹȤ֤ޤ
 * ֤ͤΥץ졼Ȥ㤤ˤʤǤޤ
 * n_ret ˤϤμο֤ޤ
 * ֤ͤ free ƤϤʤޤ
 */

extern const long *audriv_available_channels(int *n_ret);
/* ޥ󤬥ݡȤƤ뤹٤ƤΥͥΥꥹȤ֤ޤ
 * n_ret ˤϤμο֤ޤ
 * ֤ͤ free ƤϤʤޤ
 */

extern Bool audriv_set_play_encoding(long encoding);
/* audio ջ沽ꤷޤ
 *  True 򡤼Ԥ False ֤ޤ
 */

extern Bool audriv_set_play_sample_rate(long sample_rate);
/* audio ջΥץ졼Ȥꤷޤ
 *  True 򡤼Ԥ False ֤ޤ
 */

extern Bool audriv_set_play_channels(long channels);
/* ѤΥͥꤷޤ
 * Ԥ False ֤ True ֤ޤ
 */

extern void (* audriv_error_handler)(const char *errmsg);
/* NULL ǤʤС顼ȯƤӽФޤ
 */

extern void audriv_wait_play(void);
/* CPU ѥϲ񤷤ʤ褦ˤ뤿ˡŪߤޤ*/

#endif /* ___AUDRIV_H_ */