Home | History | Annotate | Download | only in audio

Lines Matching defs:hw

27 #define HWBUF hw->mix_buf
29 #define HW HWVoiceOut
34 #define HW HWVoiceIn
36 #define HWBUF hw->conv_buf
72 static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw)
81 static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
83 HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (struct st_sample));
86 hw->samples);
112 samples = sw->hw->samples;
114 samples = ((int64_t) sw->hw->samples << 32) / sw->ratio;
125 sw->rate = st_rate_start (sw->info.freq, sw->hw->info.freq);
127 sw->rate = st_rate_start (sw->hw->info.freq, sw->info.freq);
139 HW *hw,
147 sw->hw = hw;
150 sw->ratio = ((int64_t) sw->hw->info.freq << 32) / sw->info.freq;
154 sw->ratio = ((int64_t) sw->info.freq << 32) / sw->hw->info.freq;
185 static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
187 QLIST_INSERT_HEAD (&hw->sw_head, sw, entries);
195 static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
198 HW *hw = *hwp;
200 if (!hw->sw_head.lh_first) {
202 audio_detach_capture (hw);
204 QLIST_REMOVE (hw, entries);
206 glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
208 glue (hw->pcm_ops->fini_, TYPE) (hw);
210 g_free (hw);
215 static HW *glue (audio_pcm_hw_find_any_, TYPE) (HW *hw)
218 return hw ? hw->entries.le_next : glue (s->hw_head_, TYPE).lh_first;
221 static HW *glue (audio_pcm_hw_find_any_enabled_, TYPE) (HW *hw)
223 while ((hw = glue (audio_pcm_hw_find_any_, TYPE) (hw))) {
224 if (hw->enabled) {
225 return hw;
231 static HW *glue (audio_pcm_hw_find_specific_, TYPE) (
232 HW *hw,
236 while ((hw = glue (audio_pcm_hw_find_any_, TYPE) (hw))) {
237 if (audio_pcm_info_eq (&hw->info, as)) {
238 return hw;
244 static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as)
246 HW *hw;
265 hw = audio_calloc (AUDIO_FUNC, 1, glue (drv->voice_size_, TYPE));
266 if (!hw) {
272 hw->pcm_ops = drv->pcm_ops;
273 QLIST_INIT (&hw->sw_head);
275 QLIST_INIT (&hw->cap_head);
278 err = glue (hw->pcm_ops->init_, TYPE) (hw, as);
283 if (audio_bug (AUDIO_FUNC, hw->samples <= 0)) {
284 dolog ("hw->samples=%d\n", hw->samples);
289 hw->clip = mixeng_clip
291 hw->conv = mixeng_conv
293 [hw->info.nchannels == 2]
294 [hw->info.sign]
295 [hw->info.swap_endianness]
296 [audio_bits_to_index (hw->info.bits)];
298 if (glue (audio_pcm_hw_alloc_resources_, TYPE) (hw)) {
302 QLIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
305 audio_attach_capture (hw);
307 return hw;
311 glue (hw->pcm_ops->fini_, TYPE) (hw);
314 g_free (hw);
318 static HW *glue (audio_pcm_hw_add_, TYPE) (struct audsettings *as)
320 HW *hw;
323 hw = glue (audio_pcm_hw_add_new_, TYPE) (as);
324 if (hw) {
325 return hw;
329 hw = glue (audio_pcm_hw_find_specific_, TYPE) (NULL, as);
330 if (hw) {
331 return hw;
334 hw = glue (audio_pcm_hw_add_new_, TYPE) (as);
335 if (hw) {
336 return hw;
348 HW *hw;
365 hw = glue (audio_pcm_hw_add_, TYPE) (&hw_as);
366 if (!hw) {
370 glue (audio_pcm_hw_add_sw_, TYPE) (hw, sw);
372 if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, sw_name, as)) {
380 glue (audio_pcm_hw_gc_, TYPE) (&hw);
391 glue (audio_pcm_hw_gc_, TYPE) (&sw->hw);
474 HW *hw = sw->hw;
476 if (!hw) {
483 if (glue (audio_pcm_sw_init_, TYPE) (sw, hw, name, as)) {
519 audio_pcm_print_info ("hw", &sw->hw->info);
541 ts->old_ts = sw->hw->ts_helper;
552 cur_ts = sw->hw->ts_helper;
567 return muldiv64 (delta, sw->hw->info.freq, 1000000);
571 #undef HW