Skip to content

Commit

Permalink
Sync Lock: remove some underscores from names. noop
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Mar 12, 2021
1 parent 09b07cf commit 4e0006f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 deletions.
8 changes: 4 additions & 4 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,15 +1081,15 @@ double BpmControl::updateLocalBpm() {
}

double BpmControl::updateBeatDistance() {
double beat_distance = getBeatDistance(getSampleOfTrack().current);
m_pThisBeatDistance->set(beat_distance);
double beatDistance = getBeatDistance(getSampleOfTrack().current);
m_pThisBeatDistance->set(beatDistance);
if (!isSynchronized()) {
m_dUserOffset.setValue(0.0);
}
if (kLogger.traceEnabled()) {
kLogger.trace() << getGroup() << "BpmControl::updateBeatDistance" << beat_distance;
kLogger.trace() << getGroup() << "BpmControl::updateBeatDistance" << beatDistance;
}
return beat_distance;
return beatDistance;
}

void BpmControl::setTargetBeatDistance(double beatDistance) {
Expand Down
8 changes: 4 additions & 4 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,12 +1289,12 @@ void EngineBuffer::postProcess(const int iBufferSize) {
if (kLogger.traceEnabled()) {
kLogger.trace() << getGroup() << "EngineBuffer::postProcess";
}
double local_bpm = m_pBpmControl->updateLocalBpm();
double beat_distance = m_pBpmControl->updateBeatDistance();
m_pSyncControl->setLocalBpm(local_bpm);
double localBpm = m_pBpmControl->updateLocalBpm();
double beatDistance = m_pBpmControl->updateBeatDistance();
m_pSyncControl->setLocalBpm(localBpm);
SyncMode mode = m_pSyncControl->getSyncMode();
if (isMaster(mode)) {
m_pEngineSync->notifyBeatDistanceChanged(m_pSyncControl, beat_distance);
m_pEngineSync->notifyBeatDistanceChanged(m_pSyncControl, beatDistance);
} else if (isFollower(mode)) {
// Report our speed to SyncControl. If we are master, we already did this.
m_pSyncControl->reportPlayerSpeed(m_speed_old, m_scratching_old);
Expand Down
14 changes: 7 additions & 7 deletions src/engine/sync/basesyncablelistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,31 +111,31 @@ void BaseSyncableListener::setMasterInstantaneousBpm(Syncable* pSource, double b
}
}

void BaseSyncableListener::setMasterBeatDistance(Syncable* pSource, double beat_distance) {
void BaseSyncableListener::setMasterBeatDistance(Syncable* pSource, double beatDistance) {
if (pSource != m_pInternalClock) {
m_pInternalClock->setMasterBeatDistance(beat_distance);
m_pInternalClock->setMasterBeatDistance(beatDistance);
}
foreach (Syncable* pSyncable, m_syncables) {
if (pSyncable == pSource ||
!pSyncable->isSynchronized()) {
continue;
}
pSyncable->setMasterBeatDistance(beat_distance);
pSyncable->setMasterBeatDistance(beatDistance);
}
}

void BaseSyncableListener::setMasterParams(
Syncable* pSource, double beat_distance, double base_bpm, double bpm) {
//qDebug() << "BaseSyncableListener::setMasterParams, source is" << pSource->getGroup() << beat_distance << base_bpm << bpm;
Syncable* pSource, double beatDistance, double baseBpm, double bpm) {
//qDebug() << "BaseSyncableListener::setMasterParams, source is" << pSource->getGroup() << beatDistance << baseBpm << bpm;
if (pSource != m_pInternalClock) {
m_pInternalClock->setMasterParams(beat_distance, base_bpm, bpm);
m_pInternalClock->setMasterParams(beatDistance, baseBpm, bpm);
}
foreach (Syncable* pSyncable, m_syncables) {
if (pSyncable == pSource ||
!pSyncable->isSynchronized()) {
continue;
}
pSyncable->setMasterParams(beat_distance, base_bpm, bpm);
pSyncable->setMasterParams(beatDistance, baseBpm, bpm);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/engine/sync/basesyncablelistener.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class BaseSyncableListener : public SyncableListener {

// Set the master beat distance on every sync-enabled Syncable except
// pSource.
void setMasterBeatDistance(Syncable* pSource, double beat_distance);
void setMasterBeatDistance(Syncable* pSource, double beatDistance);

void setLeaderParams(Syncable* pSource, double beatDistance, mixxx::Bpm baseBpm, mixxx::Bpm bpm);
void setMasterParams(Syncable* pSource, double beatDistance, double baseBpm, double bpm);

// Check if there is only one playing syncable deck, and notify it if so.
void checkUniquePlayingSyncable();
Expand Down
9 changes: 5 additions & 4 deletions src/engine/sync/enginesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,16 @@ void EngineSync::notifyInstantaneousBpmChanged(Syncable* pSyncable, double bpm)
setMasterInstantaneousBpm(pSyncable, bpm);
}

void EngineSync::notifyBeatDistanceChanged(Syncable* pSyncable, double beat_distance) {
void EngineSync::notifyBeatDistanceChanged(Syncable* pSyncable, double beatDistance) {
if (kLogger.traceEnabled()) {
kLogger.trace() << "EngineSync::notifyBeatDistanceChanged" << pSyncable->getGroup() << beat_distance;
kLogger.trace() << "EngineSync::notifyBeatDistanceChanged"
<< pSyncable->getGroup() << beatDistance;
}
if (!isMaster(pSyncable->getSyncMode())) {
return;
}

setMasterBeatDistance(pSyncable, beat_distance);
setMasterBeatDistance(pSyncable, beatDistance);
}

void EngineSync::activateFollower(Syncable* pSyncable) {
Expand Down Expand Up @@ -385,7 +386,7 @@ void EngineSync::activateMaster(Syncable* pSyncable, bool explicitMaster) {
activateFollower(m_pInternalClock);
}

// It is up to callers of this function to initialize bpm and beat_distance
// It is up to callers of this function to initialize bpm and beatDistance
// if necessary.
}

Expand Down
2 changes: 1 addition & 1 deletion src/engine/sync/enginesync.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EngineSync : public BaseSyncableListener {
void activateMaster(Syncable* pSyncable, bool explicitMaster);

// Activate a specific channel as Follower. Sets the syncable's bpm and
// beat_distance to match the master.
// beatDistance to match the master.
void activateFollower(Syncable* pSyncable);

// Unsets all sync state on a Syncable.
Expand Down
12 changes: 6 additions & 6 deletions src/engine/sync/internalclock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ void InternalClock::slotBaseBpmChanged(double baseBpm) {
m_pEngineSync->notifyBaseBpmChanged(this, m_dBaseBpm);
}

void InternalClock::slotBeatDistanceChanged(double beat_distance) {
if (beat_distance < 0.0 || beat_distance > 1.0) {
void InternalClock::slotBeatDistanceChanged(double beatDistance) {
if (beatDistance < 0.0 || beatDistance > 1.0) {
return;
}
setMasterBeatDistance(beat_distance);
setMasterBeatDistance(beatDistance);
}

void InternalClock::updateBeatLength(int sampleRate, double bpm) {
Expand Down Expand Up @@ -223,7 +223,7 @@ void InternalClock::onCallbackEnd(int sampleRate, int bufferSize) {
m_dClockPosition -= m_dBeatLength;
}

double beat_distance = getBeatDistance();
m_pClockBeatDistance->set(beat_distance);
m_pEngineSync->notifyBeatDistanceChanged(this, beat_distance);
double beatDistance = getBeatDistance();
m_pClockBeatDistance->set(beatDistance);
m_pEngineSync->notifyBeatDistanceChanged(this, beatDistance);
}
2 changes: 1 addition & 1 deletion src/engine/sync/internalclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class InternalClock : public QObject, public Clock, public Syncable {

private slots:
void slotBaseBpmChanged(double baseBpm);
void slotBeatDistanceChanged(double beat_distance);
void slotBeatDistanceChanged(double beatDistance);
void slotSyncMasterEnabledChangeRequest(double state);

private:
Expand Down

0 comments on commit 4e0006f

Please sign in to comment.