diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2021-02-25 02:16:27 +0100 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2021-02-25 02:16:27 +0100 |
commit | 569fa922e213feae87b73289e17ebe5ab9da1505 (patch) | |
tree | 6c21024ec7f4c76c5e19350f7d4f84fc19a752ce | |
parent | e8c81decb503dcd356e0cccf4a2a371224469672 (diff) |
Introduce kInitalSample as inital value not 0.0
-rw-r--r-- | src/engine/controls/enginecontrol.cpp | 2 | ||||
-rw-r--r-- | src/engine/enginebuffer.cpp | 5 | ||||
-rw-r--r-- | src/engine/enginebuffer.h | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/engine/controls/enginecontrol.cpp b/src/engine/controls/enginecontrol.cpp index f87fb7b0e0..9807646ee1 100644 --- a/src/engine/controls/enginecontrol.cpp +++ b/src/engine/controls/enginecontrol.cpp @@ -12,7 +12,7 @@ EngineControl::EngineControl(const QString& group, m_pConfig(pConfig), m_pEngineMaster(nullptr), m_pEngineBuffer(nullptr) { - setCurrentSample(0.0, 0.0, 0.0); + setCurrentSample(EngineBuffer::kInitalSample, 0.0, 0.0); } EngineControl::~EngineControl() { diff --git a/src/engine/enginebuffer.cpp b/src/engine/enginebuffer.cpp index bd870a0cf4..a62f795829 100644 --- a/src/engine/enginebuffer.cpp +++ b/src/engine/enginebuffer.cpp @@ -1,7 +1,6 @@ #include "engine/enginebuffer.h" #include <QtDebug> -#include <cfloat> #include "control/controlindicator.h" #include "control/controllinpotmeter.h" @@ -71,7 +70,7 @@ EngineBuffer::EngineBuffer(const QString& group, m_pKeyControl(nullptr), m_pReadAheadManager(nullptr), m_pReader(nullptr), - m_filepos_play(DBL_MIN), + m_filepos_play(kInitalSample), m_speed_old(0), m_tempo_ratio_old(1.), m_scratching_old(false), @@ -516,7 +515,7 @@ void EngineBuffer::slotTrackLoaded(TrackPointer pTrack, m_pause.lock(); m_visualPlayPos->setInvalid(); - m_filepos_play = DBL_MIN; // for execute seeks to 0.0 + m_filepos_play = kInitalSample; // for execute seeks to 0.0 m_pCurrentTrack = pTrack; m_pTrackSamples->set(iTrackNumSamples); m_pTrackSampleRate->set(iTrackSampleRate); diff --git a/src/engine/enginebuffer.h b/src/engine/enginebuffer.h index f5c6c64065..0f4f09d8b9 100644 --- a/src/engine/enginebuffer.h +++ b/src/engine/enginebuffer.h @@ -4,6 +4,7 @@ #include <QAtomicInt> #include <QMutex> +#include <cfloat> #include "control/controlvalue.h" #include "engine/cachingreader/cachingreader.h" @@ -81,6 +82,8 @@ class EngineBuffer : public EngineObject { KEYLOCK_ENGINE_COUNT, }; + static constexpr double kInitalSample = DBL_MIN; + EngineBuffer(const QString& group, UserSettingsPointer pConfig, EngineChannel* pChannel, EngineMaster* pMixingEngine); virtual ~EngineBuffer(); |