- if (ms & MonitoringInput) {
- /* put disk stream in scratch buffer, blend at end */
- disk_signal = scratch_bufs.get_audio(n).data ();
- } else {
- /* no input stream needed, just overwrite buffers */
- disk_signal = output.data ();
- }
-
- chaninfo->buf->get_read_vector (&(*chan)->rw_vector);
-
- if (playback_distance <= (framecnt_t) chaninfo->rw_vector.len[0]) {
-
- if (fabsf (speed) != 1.0f) {
- (void) interpolation.interpolate (
- n, nframes,
- chaninfo->rw_vector.buf[0],
- disk_signal);
- } else if (speed != 0.0) {
- memcpy (disk_signal, chaninfo->rw_vector.buf[0], sizeof (Sample) * playback_distance);
- }
-
- } else {
-
- const framecnt_t total = chaninfo->rw_vector.len[0] + chaninfo->rw_vector.len[1];
-
- if (playback_distance <= total) {
-
- /* We have enough samples, but not in one lump.
- */
-
- if (fabsf (speed) != 1.0f) {
- interpolation.interpolate (n, chaninfo->rw_vector.len[0],
- chaninfo->rw_vector.buf[0],
- disk_signal);
- disk_signal += chaninfo->rw_vector.len[0];
- interpolation.interpolate (n, playback_distance - chaninfo->rw_vector.len[0],
- chaninfo->rw_vector.buf[1],
- disk_signal);
- } else if (speed != 0.0) {
- memcpy (disk_signal,
- chaninfo->rw_vector.buf[0],
- chaninfo->rw_vector.len[0] * sizeof (Sample));
- memcpy (disk_signal + chaninfo->rw_vector.len[0],
- chaninfo->rw_vector.buf[1],
- (playback_distance - chaninfo->rw_vector.len[0]) * sizeof (Sample));
- }