From 34112f46414406ea75d52cbd93b5637411762120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 5 Nov 2020 22:23:48 +0100 Subject: pass the new and old play state into updateIndicatorsAndModifyPlay() fixing lp1903002 --- src/engine/cuecontrol.cpp | 7 +++---- src/engine/cuecontrol.h | 2 +- src/engine/enginebuffer.cpp | 8 ++++---- src/engine/enginebuffer.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src/engine') diff --git a/src/engine/cuecontrol.cpp b/src/engine/cuecontrol.cpp index d230cbfb3f..c493ae667a 100644 --- a/src/engine/cuecontrol.cpp +++ b/src/engine/cuecontrol.cpp @@ -854,14 +854,13 @@ void CueControl::playStutter(double v) { } } -bool CueControl::updateIndicatorsAndModifyPlay(bool newPlay, bool playPossible) { +bool CueControl::updateIndicatorsAndModifyPlay(bool newPlay, bool oldPlay, bool playPossible) { //qDebug() << "updateIndicatorsAndModifyPlay" << newPlay << playPossible // << m_iCurrentlyPreviewingHotcues << m_bPreviewing; QMutexLocker lock(&m_mutex); double cueMode = m_pCueMode->get(); if ((cueMode == CUE_MODE_DENON || cueMode == CUE_MODE_NUMARK) && - newPlay && playPossible && - !m_pPlay->toBool() && + newPlay && !oldPlay && playPossible && !m_bypassCueSetByPlay) { // in Denon mode each play from pause moves the cue point // if not previewing @@ -873,7 +872,7 @@ bool CueControl::updateIndicatorsAndModifyPlay(bool newPlay, bool playPossible) // (play = 0.0) is used for latching play. bool previewing = false; if (m_bPreviewing || m_iCurrentlyPreviewingHotcues) { - if (!newPlay) { + if (!newPlay && oldPlay) { // play latch request: stop previewing and go into normal play mode. m_bPreviewing = false; m_iCurrentlyPreviewingHotcues = 0; diff --git a/src/engine/cuecontrol.h b/src/engine/cuecontrol.h index 8530accd77..fb2aa7376c 100644 --- a/src/engine/cuecontrol.h +++ b/src/engine/cuecontrol.h @@ -97,7 +97,7 @@ class CueControl : public EngineControl { ~CueControl() override; void hintReader(HintVector* pHintList) override; - bool updateIndicatorsAndModifyPlay(bool newPlay, bool playPossible); + bool updateIndicatorsAndModifyPlay(bool newPlay, bool oldPlay, bool playPossible); void updateIndicators(); void resetIndicators(); bool isPlayingByPlayButton(); diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp index 4e631276ac..57962459de 100644 --- a/src/engine/enginebuffer.cpp +++ b/src/engine/enginebuffer.cpp @@ -616,7 +616,7 @@ void EngineBuffer::doSeekPlayPos(double new_playpos, enum SeekRequest seekType) queueNewPlaypos(new_playpos, seekType); } -bool EngineBuffer::updateIndicatorsAndModifyPlay(bool newPlay) { +bool EngineBuffer::updateIndicatorsAndModifyPlay(bool newPlay, bool oldPlay) { // If no track is currently loaded, turn play off. If a track is loading // allow the set since it might apply to a track we are loading due to the // asynchrony. @@ -629,12 +629,12 @@ bool EngineBuffer::updateIndicatorsAndModifyPlay(bool newPlay) { playPossible = false; } - return m_pCueControl->updateIndicatorsAndModifyPlay(newPlay, playPossible); + return m_pCueControl->updateIndicatorsAndModifyPlay(newPlay, oldPlay, playPossible); } void EngineBuffer::verifyPlay() { bool play = m_playButton->toBool(); - bool verifiedPlay = updateIndicatorsAndModifyPlay(play); + bool verifiedPlay = updateIndicatorsAndModifyPlay(play, play); if (play != verifiedPlay) { m_playButton->setAndConfirm(verifiedPlay ? 1.0 : 0.0); } @@ -642,7 +642,7 @@ void EngineBuffer::verifyPlay() { void EngineBuffer::slotControlPlayRequest(double v) { bool oldPlay = m_playButton->toBool(); - bool verifiedPlay = updateIndicatorsAndModifyPlay(v > 0.0); + bool verifiedPlay = updateIndicatorsAndModifyPlay(v > 0.0, oldPlay); if (!oldPlay && verifiedPlay) { if (m_pQuantize->toBool() diff --git a/src/engine/enginebuffer.h b/src/engine/enginebuffer.h index 4a17ec11a8..56613be528 100644 --- a/src/engine/enginebuffer.h +++ b/src/engine/enginebuffer.h @@ -233,7 +233,7 @@ class EngineBuffer : public EngineObject { void processSyncRequests(); void processSeek(bool paused); - bool updateIndicatorsAndModifyPlay(bool newPlay); + bool updateIndicatorsAndModifyPlay(bool newPlay, bool oldPlay); void verifyPlay(); void notifyTrackLoaded(TrackPointer pNewTrack, TrackPointer pOldTrack); void processTrackLocked(CSAMPLE* pOutput, const int iBufferSize, int sample_rate); -- cgit v1.2.3