From 037a2cec5b427a4898693286b4aa844ceb1d5048 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sun, 26 Jan 2020 23:10:53 +0100 Subject: [PATCH] Set the loopend to the sample end by default --- src/sfizz/Synth.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 7743e103..4a2ad7de 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -249,6 +249,8 @@ bool sfz::Synth::loadSfzFile(const fs::path& file) } region->sampleEnd = std::min(region->sampleEnd, fileInformation->end); + if (region->loopRange.getEnd() == Default::loopRange.getEnd()) + region->loopRange.setEnd(region->sampleEnd); if (fileInformation->loopBegin != Default::loopRange.getStart() && fileInformation->loopEnd != Default::loopRange.getEnd()) {