From c98b7c70e4e4d55f5e9482a4a0e500fd1c2c6017 Mon Sep 17 00:00:00 2001 From: xenakios Date: Thu, 22 Feb 2018 02:04:30 +0200 Subject: [PATCH] Report unstretched play range length when playing original source --- Source/PS_Source/StretchSource.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/PS_Source/StretchSource.cpp b/Source/PS_Source/StretchSource.cpp index 9600612..e421717 100644 --- a/Source/PS_Source/StretchSource.cpp +++ b/Source/PS_Source/StretchSource.cpp @@ -613,7 +613,9 @@ double StretchAudioSource::getOutputDurationSecondsForRange(Range range, { if (m_inputfile == nullptr || m_inputfile->info.nsamples == 0) return 0.0; - int64_t play_end_pos = (fftsize * 2)+range.getLength()*m_playrate*m_inputfile->info.nsamples; + if (m_preview_dry==true) + return (double)range.getLength()*m_inputfile->info.nsamples/m_inputfile->info.samplerate; + int64_t play_end_pos = (fftsize * 2)+range.getLength()*m_playrate*m_inputfile->info.nsamples; return (double)play_end_pos / m_inputfile->info.samplerate; }