From b8938fd7b7defd195d385e15488307e8c1fcce57 Mon Sep 17 00:00:00 2001 From: Shmuel H Date: Wed, 8 Nov 2017 21:56:59 +0200 Subject: [PATCH] SampleTrack: Make sure an empty TCO with isRecord would still be "played" (recorded). --- src/tracks/SampleTrack.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index de7d2cf68..f113a3fb3 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -104,8 +104,15 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, //if the Tco smaller than the sample length we play only until Tco end //else we play the sample to the end but nothing more f_cnt_t samplePlayLength = tcoFrameLength > sampleBufferLength ? sampleBufferLength : tcoFrameLength; - //we only play within the sampleBuffer limits - if( sampleStart < sampleBufferLength ) + + // In case we are recoding, "play" the whole TCO. + if(sTco->isRecord()) { + samplePlayLength = tcoFrameLength; + } + + //we only play within the sampleBuffer limits + //Ignore that in case of recoding. + if( sampleStart < sampleBufferLength || sTco->isRecord ()) { sTco->setSampleStartFrame( sampleStart ); sTco->setSamplePlayLength( samplePlayLength );