Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passthrough: stop rendering waveforms, disable Cue/Play indicators #4793

Merged
merged 2 commits into from
Jun 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down