• Home
  • Raw
  • Download

Lines Matching refs:hw

38     HWVoiceOut hw;  member
58 static int wav_out_run (HWVoiceOut *hw, int live) in wav_out_run() argument
60 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_run()
67 muldiv64 (ticks, hw->info.bytes_per_second, get_ticks_per_sec ()); in wav_out_run()
70 samples = INT_MAX >> hw->info.shift; in wav_out_run()
73 samples = bytes >> hw->info.shift; in wav_out_run()
79 rpos = hw->rpos; in wav_out_run()
81 int left_till_end_samples = hw->samples - rpos; in wav_out_run()
84 src = hw->mix_buf + rpos; in wav_out_run()
85 dst = advance (wav->pcm_buf, rpos << hw->info.shift); in wav_out_run()
87 hw->clip (dst, src, convert_samples); in wav_out_run()
88 qemu_put_buffer (wav->f, dst, convert_samples << hw->info.shift); in wav_out_run()
90 rpos = (rpos + convert_samples) % hw->samples; in wav_out_run()
95 hw->rpos = rpos; in wav_out_run()
114 static int wav_out_init (HWVoiceOut *hw, struct audsettings *as) in wav_out_init() argument
116 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_init()
149 audio_pcm_init_info (&hw->info, &wav_as); in wav_out_init()
151 hw->samples = 1024; in wav_out_init()
152 wav->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in wav_out_init()
155 hw->samples << hw->info.shift); in wav_out_init()
159 le_store (hdr + 22, hw->info.nchannels, 2); in wav_out_init()
160 le_store (hdr + 24, hw->info.freq, 4); in wav_out_init()
161 le_store (hdr + 28, hw->info.freq << (bits16 + stereo), 4); in wav_out_init()
177 static void wav_out_fini (HWVoiceOut *hw) in wav_out_fini() argument
179 WAVVoiceOut *wav = (WAVVoiceOut *) hw; in wav_out_fini()
182 uint32_t datalen = wav->total_samples << hw->info.shift; in wav_out_fini()
205 static int wav_out_ctl (HWVoiceOut *hw, int cmd, ...) in wav_out_ctl() argument
207 (void) hw; in wav_out_ctl()
225 HWVoiceIn hw; member
247 wav_in_init (HWVoiceIn *hw, struct audsettings *as) in wav_in_init() argument
249 WAVVoiceIn* wav = (WAVVoiceIn *) hw; in wav_in_init()
314 audio_pcm_init_info (&hw->info, &wav_as); in wav_in_init()
316 hw->samples = 1024; in wav_in_init()
317 wav->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); in wav_in_init()
330 static void wav_in_fini (HWVoiceIn *hw) in wav_in_fini() argument
332 WAVVoiceIn *wav = (WAVVoiceIn *) hw; in wav_in_fini()
345 static int wav_in_run (HWVoiceIn *hw) in wav_in_run() argument
347 WAVVoiceIn* wav = (WAVVoiceIn *) hw; in wav_in_run()
354 int64_t bytes = muldiv64(ticks, hw->info.bytes_per_second, get_ticks_per_sec()); in wav_in_run()
357 samples = INT_MAX >> hw->info.shift; in wav_in_run()
360 samples = bytes >> hw->info.shift; in wav_in_run()
363 live = audio_pcm_hw_get_live_in (hw); in wav_in_run()
372 wpos = hw->wpos; in wav_in_run()
374 int left_till_end_samples = hw->samples - wpos; in wav_in_run()
377 dst = hw->conv_buf + wpos; in wav_in_run()
378 src = advance (wav->pcm_buf, wpos << hw->info.shift); in wav_in_run()
380 qemu_get_buffer (wav->f, src, convert_samples << hw->info.shift); in wav_in_run()
381 memcpy (dst, src, convert_samples << hw->info.shift); in wav_in_run()
383 wpos = (wpos + convert_samples) % hw->samples; in wav_in_run()
388 hw->wpos = wpos; in wav_in_run()
397 static int wav_in_ctl (HWVoiceIn *hw, int cmd, ...) in wav_in_ctl() argument
399 (void) hw; in wav_in_ctl()