summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2021-04-02 20:54:38 +0200
committerDaniel Schürmann <daschuer@mixxx.org>2021-04-02 20:54:38 +0200
commitd36c24b9a896203c9d0ca77184764b24cf7b2bd2 (patch)
tree148ac7a63c04ebc11e3e8af4f65b889dc6185c83
parentc8b7224c2c7cd93413dbde412d234e26c5a50b96 (diff)
Adopt bpm as base bpm when enable sync with no track loaded
-rw-r--r--src/engine/sync/internalclock.cpp3
-rw-r--r--src/test/enginesynctest.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/sync/internalclock.cpp b/src/engine/sync/internalclock.cpp
index f36d2136a3..a0b15a9a8c 100644
--- a/src/engine/sync/internalclock.cpp
+++ b/src/engine/sync/internalclock.cpp
@@ -78,6 +78,9 @@ void InternalClock::slotSyncMasterEnabledChangeRequest(double state) {
m_mode = SYNC_MASTER_EXPLICIT;
return;
}
+ if (mode == SYNC_NONE) {
+ m_dBaseBpm = m_dOldBpm;
+ }
m_pEngineSync->requestSyncMode(this, SYNC_MASTER_EXPLICIT);
} else {
// Turning off master goes back to follower mode.
diff --git a/src/test/enginesynctest.cpp b/src/test/enginesynctest.cpp
index 78615e418d..a1ace0478c 100644
--- a/src/test/enginesynctest.cpp
+++ b/src/test/enginesynctest.cpp
@@ -337,10 +337,11 @@ TEST_F(EngineSyncTest, InternalMasterSetFollowerSliderMoves) {
// If internal is master, and we turn on a follower, the slider should move.
auto pButtonMasterSyncInternal = std::make_unique<ControlProxy>(
m_sInternalClockGroup, "sync_master");
- pButtonMasterSyncInternal->slotSet(1);
auto pMasterSyncSlider =
std::make_unique<ControlProxy>(m_sInternalClockGroup, "bpm");
+
pMasterSyncSlider->set(100.0);
+ pButtonMasterSyncInternal->slotSet(1);
// Set the file bpm of channel 1 to 80 bpm.
mixxx::BeatsPointer pBeats1 = BeatFactory::makeBeatGrid(m_pTrack1->getSampleRate(), 80, 0.0);