Lines Matching refs:hw
33 HWVoiceOut hw; member
40 HWVoiceIn hw; member
94 HWVoiceOut *hw = &fmd->hw; in fmod_clear_sample() local
102 hw->samples << hw->info.shift, in fmod_clear_sample()
114 if ((len1 & hw->info.align) || (len2 & hw->info.align)) { in fmod_clear_sample()
116 len1, len2, hw->info.align + 1); in fmod_clear_sample()
120 if ((len1 + len2) - (hw->samples << hw->info.shift)) { in fmod_clear_sample()
122 len1 + len2, hw->samples << hw->info.shift); in fmod_clear_sample()
126 audio_pcm_info_clear_buf (&hw->info, p1, hw->samples); in fmod_clear_sample()
135 static void fmod_write_sample (HWVoiceOut *hw, uint8_t *dst, int dst_len) in fmod_write_sample() argument
139 int pos = hw->rpos + dst_len; in fmod_write_sample()
140 struct st_sample *src1 = hw->mix_buf + hw->rpos; in fmod_write_sample()
143 if (pos > hw->samples) { in fmod_write_sample()
144 src_len1 = hw->samples - hw->rpos; in fmod_write_sample()
145 src2 = hw->mix_buf; in fmod_write_sample()
151 hw->clip (dst, src1, src_len1); in fmod_write_sample()
155 dst = advance (dst, src_len1 << hw->info.shift); in fmod_write_sample()
156 hw->clip (dst, src2, src_len2); in fmod_write_sample()
159 hw->rpos = pos % hw->samples; in fmod_write_sample()
227 static int fmod_run_out (HWVoiceOut *hw, int live) in fmod_run_out() argument
229 FMODVoiceOut *fmd = (FMODVoiceOut *) hw; in fmod_run_out()
235 if (!hw->pending_disable) { in fmod_run_out()
254 if ((old_pos > ppos) && ((old_pos + len) > (ppos + hw->samples))) { in fmod_run_out()
255 len = hw->samples - old_pos + ppos; in fmod_run_out()
272 if (fmod_lock_sample (fmd->fmod_sample, &fmd->hw.info, in fmod_run_out()
279 len1 = blen1 >> hw->info.shift; in fmod_run_out()
280 len2 = blen2 >> hw->info.shift; in fmod_run_out()
285 fmod_write_sample (hw, p1, len1); in fmod_run_out()
289 fmod_write_sample (hw, p2, len2); in fmod_run_out()
294 fmd->old_pos = (fmd->old_pos + decr) % hw->samples; in fmod_run_out()
330 static void fmod_fini_out (HWVoiceOut *hw) in fmod_fini_out() argument
332 FMODVoiceOut *fmd = (FMODVoiceOut *) hw; in fmod_fini_out()
344 static int fmod_init_out (HWVoiceOut *hw, struct audsettings *as) in fmod_init_out() argument
347 FMODVoiceOut *fmd = (FMODVoiceOut *) hw; in fmod_init_out()
376 audio_pcm_init_info (&hw->info, &obt_as); in fmod_init_out()
378 hw->samples = conf.nb_samples; in fmod_init_out()
382 static int fmod_ctl_out (HWVoiceOut *hw, int cmd, ...) in fmod_ctl_out() argument
385 FMODVoiceOut *fmd = (FMODVoiceOut *) hw; in fmod_ctl_out()
406 static int fmod_init_in (HWVoiceIn *hw, struct audsettings *as) in fmod_init_in() argument
409 FMODVoiceIn *fmd = (FMODVoiceIn *) hw; in fmod_init_in()
434 audio_pcm_init_info (&hw->info, &obt_as); in fmod_init_in()
436 hw->samples = conf.nb_samples; in fmod_init_in()
440 static void fmod_fini_in (HWVoiceIn *hw) in fmod_fini_in() argument
442 FMODVoiceIn *fmd = (FMODVoiceIn *) hw; in fmod_fini_in()
451 static int fmod_run_in (HWVoiceIn *hw) in fmod_run_in() argument
453 FMODVoiceIn *fmd = (FMODVoiceIn *) hw; in fmod_run_in()
454 int hwshift = hw->info.shift; in fmod_run_in()
461 live = audio_pcm_hw_get_live_in (hw); in fmod_run_in()
462 dead = hw->samples - live; in fmod_run_in()
473 len = audio_ring_dist (new_pos, hw->wpos, hw->samples); in fmod_run_in()
479 if (fmod_lock_sample (fmd->fmod_sample, &fmd->hw.info, in fmod_run_in()
480 hw->wpos, len, in fmod_run_in()
491 hw->conv (hw->conv_buf + hw->wpos, p1, len1, &nominal_volume); in fmod_run_in()
494 hw->conv (hw->conv_buf, p2, len2, &nominal_volume); in fmod_run_in()
498 hw->wpos = (hw->wpos + decr) % hw->samples; in fmod_run_in()
598 static int fmod_ctl_in (HWVoiceIn *hw, int cmd, ...) in fmod_ctl_in() argument
601 FMODVoiceIn *fmd = (FMODVoiceIn *) hw; in fmod_ctl_in()