Revision | 174ef94a2e68290f101498d88c76f88371cb2cef (tree) |
---|---|
Time | 2017-08-26 06:38:38 |
Author | Starg <starg@user...> |
Commiter | Starg |
Add suuport for portaudio WASAPI
@@ -97,6 +97,7 @@ extern PlayMode portaudio_play_mode; | ||
97 | 97 | extern PlayMode portaudio_asio_play_mode; |
98 | 98 | extern PlayMode portaudio_win_ds_play_mode; |
99 | 99 | extern PlayMode portaudio_win_wmme_play_mode; |
100 | +extern PlayMode portaudio_win_wasapi_play_mode; | |
100 | 101 | #endif |
101 | 102 | #endif /* AU_PORTAUDIO */ |
102 | 103 |
@@ -169,6 +170,7 @@ PlayMode *play_mode_list[] = { | ||
169 | 170 | &portaudio_asio_play_mode, |
170 | 171 | &portaudio_win_ds_play_mode, |
171 | 172 | &portaudio_win_wmme_play_mode, |
173 | + &portaudio_win_wasapi_play_mode, | |
172 | 174 | #endif |
173 | 175 | #endif /* AU_PORTAUDIO */ |
174 | 176 |
@@ -116,6 +116,7 @@ padata_t pa_data; | ||
116 | 116 | static int open_output_asio(void); |
117 | 117 | static int open_output_win_ds(void); |
118 | 118 | static int open_output_win_wmme(void); |
119 | +static int open_output_win_wasapi(void); | |
119 | 120 | PlayMode portaudio_asio_play_mode = { |
120 | 121 | (SAMPLE_RATE), |
121 | 122 | PE_16BIT|PE_SIGNED, |
@@ -155,6 +156,19 @@ PlayMode portaudio_win_wmme_play_mode = { | ||
155 | 156 | output_data, |
156 | 157 | acntl |
157 | 158 | }; |
159 | +PlayMode portaudio_win_wasapi_play_mode = { | |
160 | + (SAMPLE_RATE), | |
161 | + PE_16BIT | PE_SIGNED, | |
162 | + PF_PCM_STREAM | PF_BUFF_FRAGM_OPT | PF_CAN_TRACE, | |
163 | + -1, | |
164 | + {32}, /* PF_BUFF_FRAGM_OPT is need for TWSYNTH */ | |
165 | + "PortAudio(WASAPI)", 'W', | |
166 | + NULL, | |
167 | + open_output_win_wasapi, | |
168 | + close_output, | |
169 | + output_data, | |
170 | + acntl | |
171 | +}; | |
158 | 172 | PlayMode * volatile portaudio_play_mode = &portaudio_win_wmme_play_mode; |
159 | 173 | #define dpm (*portaudio_play_mode) |
160 | 174 |
@@ -291,6 +305,11 @@ static int open_output_win_wmme(void) | ||
291 | 305 | portaudio_play_mode = &portaudio_win_wmme_play_mode; |
292 | 306 | return open_output(); |
293 | 307 | } |
308 | +static int open_output_win_wasapi(void) | |
309 | +{ | |
310 | + portaudio_play_mode = &portaudio_win_wasapi_play_mode; | |
311 | + return open_output(); | |
312 | +} | |
294 | 313 | #endif |
295 | 314 | |
296 | 315 | static int open_output(void) |
@@ -313,7 +332,9 @@ static int open_output(void) | ||
313 | 332 | HostApiTypeId = paDirectSound; |
314 | 333 | } else if(&dpm == &portaudio_win_wmme_play_mode){ |
315 | 334 | HostApiTypeId = paMME; |
316 | - } else { | |
335 | + } else if(&dpm == &portaudio_win_wasapi_play_mode){ | |
336 | + HostApiTypeId = paWASAPI; | |
337 | + } else { | |
317 | 338 | return -1; |
318 | 339 | } |
319 | 340 | if(load_portaudio_dll(0)) |