Lines Matching full:hw
44 HWVoiceOut hw; member
52 HWVoiceIn hw; member
221 HWVoiceOut *hw = &sdl->hw; in sdl_callback_out() local
225 /* dolog("callback_out: len=%d avail=%zu\n", len, hw->pending_emul); */ in sdl_callback_out()
227 while (hw->pending_emul && len) { in sdl_callback_out()
230 start = audio_ring_posb(hw->pos_emul, hw->pending_emul, in sdl_callback_out()
231 hw->size_emul); in sdl_callback_out()
232 assert(start < hw->size_emul); in sdl_callback_out()
234 write_len = MIN(MIN(hw->pending_emul, len), in sdl_callback_out()
235 hw->size_emul - start); in sdl_callback_out()
237 memcpy(buf, hw->buf_emul + start, write_len); in sdl_callback_out()
238 hw->pending_emul -= write_len; in sdl_callback_out()
246 audio_pcm_info_clear_buf(&hw->info, buf, in sdl_callback_out()
247 len / hw->info.bytes_per_frame); in sdl_callback_out()
269 HWVoiceIn *hw = &sdl->hw; in sdl_callback_in() local
275 /* dolog("callback_in: len=%d pending=%zu\n", len, hw->pending_emul); */ in sdl_callback_in()
277 while (hw->pending_emul < hw->size_emul && len) { in sdl_callback_in()
278 size_t read_len = MIN(len, MIN(hw->size_emul - hw->pos_emul, in sdl_callback_in()
279 hw->size_emul - hw->pending_emul)); in sdl_callback_in()
281 memcpy(hw->buf_emul + hw->pos_emul, buf, read_len); in sdl_callback_in()
283 hw->pending_emul += read_len; in sdl_callback_in()
284 hw->pos_emul = (hw->pos_emul + read_len) % hw->size_emul; in sdl_callback_in()
294 glue(SDLVoice, dir) *sdl = (glue(SDLVoice, dir) *)hw; \
306 glue(SDLVoice, dir) *sdl = (glue(SDLVoice, dir) *)hw; \
313 SDL_WRAPPER_FUNC(buffer_get_free, size_t, (HWVoiceOut *hw), (hw), Out)
314 SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
315 (hw, size), Out)
317 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size), Out)
319 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size), Out)
320 SDL_WRAPPER_FUNC(read, size_t, (HWVoiceIn *hw, void *buf, size_t size),
321 (hw, buf, size), In)
322 SDL_WRAPPER_FUNC(get_buffer_in, void *, (HWVoiceIn *hw, size_t *size),
323 (hw, size), In)
324 SDL_WRAPPER_VOID_FUNC(put_buffer_in, (HWVoiceIn *hw, void *buf, size_t size),
325 (hw, buf, size), In)
329 static void sdl_fini_out(HWVoiceOut *hw) in sdl_fini_out() argument
331 SDLVoiceOut *sdl = (SDLVoiceOut *)hw; in sdl_fini_out()
336 static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as, in sdl_init_out() argument
339 SDLVoiceOut *sdl = (SDLVoiceOut *)hw; in sdl_init_out()
374 audio_pcm_init_info (&hw->info, &obt_as); in sdl_init_out()
375 hw->samples = (spdo->has_buffer_count ? spdo->buffer_count : 4) * in sdl_init_out()
383 static void sdl_enable_out(HWVoiceOut *hw, bool enable) in sdl_enable_out() argument
385 SDLVoiceOut *sdl = (SDLVoiceOut *)hw; in sdl_enable_out()
390 static void sdl_fini_in(HWVoiceIn *hw) in sdl_fini_in() argument
392 SDLVoiceIn *sdl = (SDLVoiceIn *)hw; in sdl_fini_in()
397 static int sdl_init_in(HWVoiceIn *hw, audsettings *as, void *drv_opaque) in sdl_init_in() argument
399 SDLVoiceIn *sdl = (SDLVoiceIn *)hw; in sdl_init_in()
434 audio_pcm_init_info(&hw->info, &obt_as); in sdl_init_in()
435 hw->samples = (spdo->has_buffer_count ? spdo->buffer_count : 4) * in sdl_init_in()
437 hw->size_emul = hw->samples * hw->info.bytes_per_frame; in sdl_init_in()
438 hw->buf_emul = g_malloc(hw->size_emul); in sdl_init_in()
439 hw->pos_emul = hw->pending_emul = 0; in sdl_init_in()
446 static void sdl_enable_in(HWVoiceIn *hw, bool enable) in sdl_enable_in() argument
448 SDLVoiceIn *sdl = (SDLVoiceIn *)hw; in sdl_enable_in()