36 |
static int audiochannels; |
static int audiochannels; |
37 |
static BOOL reopened; |
static BOOL reopened; |
38 |
static short samplewidth; |
static short samplewidth; |
39 |
|
static char *libao_device = NULL; |
40 |
|
|
41 |
BOOL |
BOOL |
42 |
wave_out_open(void) |
libao_open(void) |
43 |
{ |
{ |
44 |
ao_sample_format format; |
ao_sample_format format; |
45 |
|
static int warned = 0; |
46 |
|
|
47 |
|
if (!warned && libao_device) |
48 |
|
{ |
49 |
|
warning("device-options not supported for libao-driver\n"); |
50 |
|
warned = 1; |
51 |
|
} |
52 |
|
|
53 |
ao_initialize(); |
ao_initialize(); |
54 |
default_driver = ao_default_driver_id(); |
default_driver = ao_default_driver_id(); |
75 |
} |
} |
76 |
|
|
77 |
void |
void |
78 |
wave_out_close(void) |
libao_close(void) |
79 |
{ |
{ |
80 |
/* Ack all remaining packets */ |
/* Ack all remaining packets */ |
81 |
while (!rdpsnd_queue_empty()) |
while (!rdpsnd_queue_empty()) |
92 |
} |
} |
93 |
|
|
94 |
BOOL |
BOOL |
95 |
wave_out_format_supported(WAVEFORMATEX * pwfx) |
libao_format_supported(WAVEFORMATEX * pwfx) |
96 |
{ |
{ |
97 |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
if (pwfx->wFormatTag != WAVE_FORMAT_PCM) |
98 |
return False; |
return False; |
109 |
} |
} |
110 |
|
|
111 |
BOOL |
BOOL |
112 |
wave_out_set_format(WAVEFORMATEX * pwfx) |
libao_set_format(WAVEFORMATEX * pwfx) |
113 |
{ |
{ |
114 |
ao_sample_format format; |
ao_sample_format format; |
115 |
|
|
137 |
} |
} |
138 |
|
|
139 |
void |
void |
140 |
wave_out_volume(uint16 left, uint16 right) |
libao_volume(uint16 left, uint16 right) |
141 |
{ |
{ |
142 |
warning("volume changes not supported with libao-output\n"); |
warning("volume changes not supported with libao-output\n"); |
143 |
} |
} |
144 |
|
|
145 |
void |
void |
146 |
wave_out_play(void) |
libao_play(void) |
147 |
{ |
{ |
148 |
struct audio_packet *packet; |
struct audio_packet *packet; |
149 |
STREAM out; |
STREAM out; |
233 |
g_dsp_busy = 1; |
g_dsp_busy = 1; |
234 |
return; |
return; |
235 |
} |
} |
236 |
|
|
237 |
|
static struct audio_driver libao_driver = { |
238 |
|
wave_out_write:rdpsnd_queue_write, |
239 |
|
wave_out_open:libao_open, |
240 |
|
wave_out_close:libao_close, |
241 |
|
wave_out_format_supported:libao_format_supported, |
242 |
|
wave_out_set_format:libao_set_format, |
243 |
|
wave_out_volume:libao_volume, |
244 |
|
wave_out_play:libao_play, |
245 |
|
name:"libao", |
246 |
|
description:"libao output driver", |
247 |
|
next:NULL, |
248 |
|
}; |
249 |
|
|
250 |
|
struct audio_driver * |
251 |
|
libao_register(char *options) |
252 |
|
{ |
253 |
|
if (options) |
254 |
|
{ |
255 |
|
libao_device = xstrdup(options); |
256 |
|
} |
257 |
|
|
258 |
|
return &libao_driver; |
259 |
|
} |