35 |
static int g_snd_rate; |
static int g_snd_rate; |
36 |
static BOOL g_swapaudio; |
static BOOL g_swapaudio; |
37 |
static int width = AL_SAMPLE_16; |
static int width = AL_SAMPLE_16; |
38 |
|
static char *sgi_output_device = NULL; |
39 |
|
|
40 |
double min_volume, max_volume, volume_range; |
double min_volume, max_volume, volume_range; |
41 |
int resource, maxFillable; |
int resource, maxFillable; |
42 |
int combinedFrameSize; |
int combinedFrameSize; |
43 |
|
|
44 |
BOOL |
BOOL |
45 |
wave_out_open(void) |
sgi_open(void) |
46 |
{ |
{ |
47 |
ALparamInfo pinfo; |
ALparamInfo pinfo; |
48 |
|
static int warned = 0; |
49 |
|
|
50 |
#if (defined(IRIX_DEBUG)) |
#if (defined(IRIX_DEBUG)) |
51 |
fprintf(stderr, "sgi_open: begin\n"); |
fprintf(stderr, "sgi_open: begin\n"); |
52 |
#endif |
#endif |
53 |
|
|
54 |
|
if (!warned && sgi_output_device) |
55 |
|
{ |
56 |
|
warning("device-options not supported for libao-driver\n"); |
57 |
|
warned = 1; |
58 |
|
} |
59 |
|
|
60 |
if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0) |
if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0) |
61 |
{ |
{ |
62 |
fprintf(stderr, "sgi_open: alGetParamInfo failed: %s\n", |
fprintf(stderr, "sgi_open: alGetParamInfo failed: %s\n", |
93 |
} |
} |
94 |
|
|
95 |
void |
void |
96 |
wave_out_close(void) |
sgi_close(void) |
97 |
{ |
{ |
98 |
/* Ack all remaining packets */ |
/* Ack all remaining packets */ |
99 |
#if (defined(IRIX_DEBUG)) |
#if (defined(IRIX_DEBUG)) |
118 |
} |
} |
119 |
|
|
120 |
BOOL |
BOOL |
121 |
wave_out_format_supported(WAVEFORMATEX * pwfx) |
sgi_format_supported(WAVEFORMATEX * pwfx) |
122 |
{ |
{ |
123 |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
124 |
return False; |
return False; |
131 |
} |
} |
132 |
|
|
133 |
BOOL |
BOOL |
134 |
wave_out_set_format(WAVEFORMATEX * pwfx) |
sgi_set_format(WAVEFORMATEX * pwfx) |
135 |
{ |
{ |
136 |
int channels; |
int channels; |
137 |
int frameSize, channelCount; |
int frameSize, channelCount; |
215 |
} |
} |
216 |
|
|
217 |
void |
void |
218 |
wave_out_volume(uint16 left, uint16 right) |
sgi_volume(uint16 left, uint16 right) |
219 |
{ |
{ |
220 |
double gainleft, gainright; |
double gainleft, gainright; |
221 |
ALpv pv[1]; |
ALpv pv[1]; |
248 |
} |
} |
249 |
|
|
250 |
void |
void |
251 |
wave_out_play(void) |
sgi_play(void) |
252 |
{ |
{ |
253 |
struct audio_packet *packet; |
struct audio_packet *packet; |
254 |
ssize_t len; |
ssize_t len; |
307 |
} |
} |
308 |
} |
} |
309 |
} |
} |
310 |
|
|
311 |
|
static struct audio_driver sgi_driver = { |
312 |
|
wave_out_write:rdpsnd_queue_write, |
313 |
|
wave_out_open:sgi_open, |
314 |
|
wave_out_close:sgi_close, |
315 |
|
wave_out_format_supported:sgi_format_supported, |
316 |
|
wave_out_set_format:sgi_set_format, |
317 |
|
wave_out_volume:sgi_volume, |
318 |
|
wave_out_play:sgi_play, |
319 |
|
name:"sgi", |
320 |
|
description:"SGI output driver", |
321 |
|
next:NULL, |
322 |
|
}; |
323 |
|
|
324 |
|
struct audio_driver * |
325 |
|
sgi_register(char *options) |
326 |
|
{ |
327 |
|
if (options) |
328 |
|
{ |
329 |
|
sgi_output_device = xstrdup(options); |
330 |
|
} |
331 |
|
return &sgi_driver; |
332 |
|
} |