Skip to content

Commit

Permalink
Sync Lock: Fix InternalClock,bpm so it can be used to control overall…
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Jul 23, 2021
1 parent c797a81 commit 155af16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/engine/sync/internalclock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ InternalClock::InternalClock(const QString& group, SyncableListener* pEngineSync
connect(m_pClockBpm.data(),
&ControlObject::valueChanged,
this,
&InternalClock::slotBaseBpmChanged,
&InternalClock::slotBpmChanged,
Qt::DirectConnection);

// The relative position between two beats in the range 0.0 ... 1.0
Expand Down Expand Up @@ -157,13 +157,16 @@ void InternalClock::reinitLeaderParams(double beatDistance, double baseBpm, doub
updateLeaderBeatDistance(beatDistance);
}

void InternalClock::slotBaseBpmChanged(double baseBpm) {
void InternalClock::slotBpmChanged(double baseBpm) {
m_dBaseBpm = baseBpm;
updateBeatLength(m_iOldSampleRate, m_dBaseBpm);
if (!isSynchronized()) {
return;
}
m_pEngineSync->notifyBaseBpmChanged(this, m_dBaseBpm);
// The internal clock doesn't have a rate slider, so treat
// "base" bpm changes as rate changes -- this means the change will be
// reflected in all synced decks.
m_pEngineSync->notifyRateChanged(this, m_dBaseBpm);
}

void InternalClock::slotBeatDistanceChanged(double beatDistance) {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sync/internalclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class InternalClock : public QObject, public Clock, public Syncable {
void onCallbackEnd(int sampleRate, int bufferSize);

private slots:
void slotBaseBpmChanged(double baseBpm);
void slotBpmChanged(double bpm);
void slotBeatDistanceChanged(double beatDistance);
void slotSyncLeaderEnabledChangeRequest(double state);

Expand Down

0 comments on commit 155af16

Please sign in to comment.