diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp index 998e6f51dec..83885094249 100644 --- a/src/engine/enginebuffer.cpp +++ b/src/engine/enginebuffer.cpp @@ -581,6 +581,12 @@ void EngineBuffer::slotPassthroughChanged(double enabled) { if (enabled != 0) { // If passthrough was enabled, stop playing the current track. slotControlStop(1.0); + // Disable CUE and Play indicators + m_pCueControl->resetIndicators(); + } else { + // Update CUE and Play indicators. Note: m_pCueControl->updateIndicators() + // is not sufficient. + updateIndicatorsAndModifyPlay(false, false); } } @@ -1242,6 +1248,15 @@ void EngineBuffer::postProcess(const int iBufferSize) { } void EngineBuffer::updateIndicators(double speed, int iBufferSize) { + // Explicitly invalidate the visual playposition so waveformwidgetrenderer + // clears the visual when passthrough was activated while a track was loaded. + // TODO(ronso0) Check if postProcess() needs to be called at all when passthrough + // is active -- if no, remove this hack. + if (m_pPassthroughEnabled->toBool()) { + m_visualPlayPos->setInvalid(); + return; + } + if (m_filepos_play == kInitialSamplePosition || m_trackSampleRateOld == 0 || m_tempo_ratio_old == 0) { @@ -1261,7 +1276,7 @@ void EngineBuffer::updateIndicators(double speed, int iBufferSize) { const double tempoTrackSeconds = m_trackSamplesOld / kSamplesPerFrame / m_trackSampleRateOld / m_tempo_ratio_old; - if(speed > 0 && fFractionalPlaypos == 1.0) { + if (speed > 0 && fFractionalPlaypos == 1.0) { // At Track end speed = 0; }