static void process_deck(struct device *dv, jack_nframes_t nframes) { int n; jack_default_audio_sample_t *in[DEVICE_CHANNELS], *out[DEVICE_CHANNELS]; jack_nframes_t remain; struct jack *jack = (struct jack*)dv->local; assert(dv->timecoder != NULL); assert(dv->player != NULL); for (n = 0; n < DEVICE_CHANNELS; n++) { in[n] = jack_port_get_buffer(jack->input_port[n], nframes); assert(in[n] != NULL); out[n] = jack_port_get_buffer(jack->output_port[n], nframes); assert(out[n] != NULL); } /* For large values of nframes, communicate with the timecoder and * player in smaller blocks */ remain = nframes; while (remain > 0) { signed short buf[MAX_BLOCK * DEVICE_CHANNELS]; jack_nframes_t block; if (remain < MAX_BLOCK) block = remain; else block = MAX_BLOCK; /* Timecode input */ interleave(buf, in, block); device_submit(dv, buf, block); /* Audio output is handle in the inner loop, so that * we get the timecoder applied in small steps */ device_collect(dv, buf, block); uninterleave(out, buf, block); remain -= block; } }
static void process_deck(struct device_t *dv, jack_nframes_t nframes) { int n; signed short buf[MAX_BLOCK * DEVICE_CHANNELS]; jack_default_audio_sample_t *in[DEVICE_CHANNELS], *out[DEVICE_CHANNELS]; jack_nframes_t remain, block; struct jack_t *jack = (struct jack_t*)dv->local; for (n = 0; n < DEVICE_CHANNELS; n++) { in[n] = jack_port_get_buffer(jack->input_port[n], nframes); assert(in[n] != NULL); out[n] = jack_port_get_buffer(jack->output_port[n], nframes); assert(out[n] != NULL); } /* For large values of nframes, communicate with the timecoder and * player in smaller blocks */ remain = nframes; while (remain > 0) { if (remain < MAX_BLOCK) block = remain; else block = MAX_BLOCK; /* Timecode input */ interleave(buf, in, block); if (dv->timecoder) timecoder_submit(dv->timecoder, buf, block); /* Audio output -- handle in the same loop for finer granularity */ player_collect(dv->player, buf, block, rate); uninterleave(out, buf, block); remain -= block; } }