From 6d0f6bf50fe959baae8680b70308eef21c7e8383 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 24 May 2023 04:05:14 -0500 Subject: [PATCH] move loop when trimming in sample editor --- src/engine/sample.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index b178c6e87..57bf7e09b 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -656,6 +656,16 @@ bool DivSample::trim(unsigned int begin, unsigned int end) { int count=end-begin; if (count==0) return true; if (begin==0 && end==samples) return true; + if (((int)beginloopEnd && (int)end>loopEnd)) { + loopStart=-1; + loopEnd=-1; + loop=false; + } else { + loopStart-=begin; + loopEnd-=begin; + if (loopStart<0) loopStart=0; + if (loopEnd>count) loopEnd=count; + } if (depth==DIV_SAMPLE_DEPTH_8BIT) { if (data8!=NULL) { signed char* oldData8=data8;