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

Sync Lock: Fix InternalClock,bpm so it can be used to control overall rate #4135

Merged
merged 1 commit into from
Jul 24, 2021
Merged
Show file tree
Hide file tree
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
Sync Lock: Fix InternalClock,bpm so it can be used to control overall…
  • Loading branch information
ywwg committed Jul 23, 2021
commit 0af0d0ef8d5eb07feeed1b6a8b03b364d3a7c2cf
11 changes: 7 additions & 4 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) {
m_dBaseBpm = baseBpm;
void InternalClock::slotBpmChanged(double bpm) {
m_dBaseBpm = bpm;
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