13
0

new mechanism to refill pre-loop buffer when loop changes (used for xfading loop ends)

This commit is contained in:
Paul Davis 2020-05-12 10:06:36 -06:00
parent 6a542fe5fe
commit 7138e76d2d
2 changed files with 8 additions and 0 deletions

View File

@ -247,6 +247,9 @@ private:
bool overwrite_existing_audio ();
bool overwrite_existing_midi ();
samplepos_t last_refill_loop_start;
void setup_preloop_buffer ();
};
} // namespace ARDOUR

View File

@ -64,6 +64,7 @@ DiskReader::DiskReader (Session& s, string const& str, DiskIOProcessor::Flag f)
, _declick_amp (s.nominal_sample_rate ())
, _declick_offs (0)
, _declick_enabled (false)
, last_refill_loop_start (0)
{
file_sample[DataType::AUDIO] = 0;
file_sample[DataType::MIDI] = 0;
@ -1044,6 +1045,10 @@ DiskReader::audio_read (Sample* sum_buffer,
loop_declick_out.run (sum_buffer, start, start + this_read);
break;
case XFadeLoop:
if (last_refill_loop_start != loc->start()) {
setup_preloop_buffer ();
last_refill_loop_start = loc->start();
}
maybe_xfade_loop (sum_buffer, start, start + this_read, rci);
break;
}