Skip to content

Commit

Permalink
Rename Sync instances of "master" to "leader"
Browse files Browse the repository at this point in the history
Also add an alias from the sync_master CO to sync_leader
  • Loading branch information
ywwg committed Jun 16, 2021
1 parent 2d2b485 commit 9e85796
Show file tree
Hide file tree
Showing 28 changed files with 695 additions and 688 deletions.
2 changes: 1 addition & 1 deletion res/controllers/Hercules DJ Control MP3 e2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ HerculesMP3e2.jogWheel = function(midino, control, value, status, group) {

// drive master tempo led connected to sync_mode
HerculesMP3e2.syncmode = function(value, group, control) {
// Following code was used for sync_master control.
// Following code was used for sync_leader control.
// Deactivated for now due to https://bugs.launchpad.net/mixxx/+bug/1456801
// currently (2015-05-20) explicit master mode is not supported.
// Switched to sync_enabled (binary) control
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Hercules DJControl Starlight.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
// Sync
<control>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x94</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -266,7 +266,7 @@
// Sync
<control>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x95</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -1082,7 +1082,7 @@

<output>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck A(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down Expand Up @@ -1130,7 +1130,7 @@

<output>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck B(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Hercules_DJControl_Inpulse_200.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
<!--Sync-->
<control>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x94</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -349,7 +349,7 @@
<!--Sync-->
<control>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x95</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -1181,7 +1181,7 @@
</output>
<output>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck A(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down Expand Up @@ -1225,7 +1225,7 @@
</output>
<output>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck B(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Hercules_DJControl_Inpulse_300.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
<!--Sync-->
<control>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x94</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -443,7 +443,7 @@
<!--Sync-->
<control>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x95</status>
<midino>0x05</midino>
Expand Down Expand Up @@ -1693,7 +1693,7 @@
</output>
<output>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck A(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down Expand Up @@ -1759,7 +1759,7 @@
</output>
<output>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck B(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Hercules_DJControl_Jogvision.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</control>
<control>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x90</status>
<midino>0x35</midino>
Expand Down Expand Up @@ -594,7 +594,7 @@
</control>
<control>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SHIFT + Sync: Sync Master</description>
<status>0x91</status>
<midino>0x35</midino>
Expand Down Expand Up @@ -1473,7 +1473,7 @@
</output>
<output>
<group>[Channel1]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck A(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down Expand Up @@ -1550,7 +1550,7 @@
</output>
<output>
<group>[Channel2]</group>
<key>sync_master</key>
<key>sync_leader</key>
<description>SYNC LED Deck A(SHIFT mode)</description>
<minimum>0.5</minimum>
<maximum>1</maximum>
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Novation-Launchpad MK2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2202,9 +2202,9 @@ var NovationLaunchpadMK2 = (function () {
name: 'sync_enabled',
type: 'binary'
},
sync_master: {
sync_leader: {
group: "[".concat(type).concat(i, "]"),
name: 'sync_master',
name: 'sync_leader',
type: 'binary'
},
sync_mode: {
Expand Down Expand Up @@ -6765,9 +6765,9 @@ var NovationLaunchpadMK2 = (function () {
}
}, function () {
if (bindings.syncMode.getValue() === 2) {
deck.sync_master.setValue(0);
deck.sync_leader.setValue(0);
} else {
deck.sync_master.setValue(1);
deck.sync_leader.setValue(1);
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions res/skins/LateNight/decks/rate_controls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
<SetVariable name="Size">48f,22f</SetVariable>
<SetVariable name="BtnSize">sync</SetVariable>
<SetVariable name="ConfigKey"><Variable name="Group"/>,sync_enabled</SetVariable>
<SetVariable name="ConfigKeyRight"><Variable name="Group"/>,sync_master</SetVariable>
<SetVariable name="ConfigKeyRight"><Variable name="Group"/>,sync_leader</SetVariable>
</Template>
<PushButton>
<TooltipId>sync_master</TooltipId>
<TooltipId>sync_leader</TooltipId>
<ObjectName>SyncLeader</ObjectName>
<Size>48f,22f</Size>
<NumberStates>3</NumberStates>
Expand All @@ -103,7 +103,7 @@
<Pressed scalemode="STRETCH">skin:/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_sync_active.svg</Pressed>
</State>
<Connection>
<ConfigKey><Variable name="Group"/>,sync_master</ConfigKey>
<ConfigKey><Variable name="Group"/>,sync_leader</ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
</PushButton>
Expand Down
9 changes: 6 additions & 3 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,11 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("One-time beat sync (phase only)"),
syncMenu);
syncMenu->addSeparator();
addControl("[InternalClock]", "sync_master", tr("Internal Sync Master"),
tr("Toggle Internal Sync Master"), syncMenu);
addControl("[InternalClock]",
"sync_leader",
tr("Internal Sync Leader"),
tr("Toggle Internal Sync Leader"),
syncMenu);
addControl("[InternalClock]", "bpm", tr("Internal Master BPM"),
tr("Internal Master BPM"), syncMenu);
addControl("[InternalClock]", "bpm_up", tr("Internal Master BPM +1"),
Expand All @@ -239,7 +242,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
addControl("[InternalClock]", "bpm_down_small", tr("Internal Master BPM -0.1"),
tr("Decrease internal master BPM by 0.1"), syncMenu);
syncMenu->addSeparator();
addDeckAndSamplerControl("sync_master", tr("Sync Master"), tr("Toggle sync master"), syncMenu);
addDeckAndSamplerControl("sync_leader", tr("Sync Leader"), tr("Toggle sync master"), syncMenu);
addDeckAndSamplerControl("sync_mode", tr("Sync Mode"),
tr("Sync mode 3-state toggle (OFF, FOLLOWER, MASTER)"), syncMenu);

Expand Down
4 changes: 2 additions & 2 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void BpmControl::slotControlBeatSync(double value) {
}

bool BpmControl::syncTempo() {
if (getSyncMode() == SYNC_MASTER_EXPLICIT) {
if (getSyncMode() == SYNC_LEADER_EXPLICIT) {
return false;
}
EngineBuffer* pOtherEngineBuffer = pickSyncTarget();
Expand Down Expand Up @@ -1056,7 +1056,7 @@ void BpmControl::slotBeatsTranslateMatchAlignment(double v) {
const mixxx::BeatsPointer pBeats = pTrack->getBeats();
if (pBeats && (pBeats->getCapabilities() & mixxx::Beats::BEATSCAP_TRANSLATE)) {
// Must reset the user offset *before* calling getPhaseOffset(),
// otherwise it will always return 0 if master sync is active.
// otherwise it will always return 0 if sync lock is active.
m_dUserOffset.setValue(0.0);

double offset = getPhaseOffset(getSampleOfTrack().current);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/controls/bpmcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BpmControl : public EngineControl {

double getBpm() const;
double getLocalBpm() const { return m_pLocalBpm ? m_pLocalBpm->get() : 0.0; }
// When in master sync mode, ratecontrol calls calcSyncedRate to figure out
// When in sync lock mode, ratecontrol calls calcSyncedRate to figure out
// how fast the track should play back. The returned rate is usually just
// the correct pitch to match bpms. The usertweak argument represents
// how much the user is nudging the pitch to get two tracks into sync, and
Expand Down Expand Up @@ -173,5 +173,5 @@ class BpmControl : public EngineControl {
mixxx::BeatsPointer m_pBeats;

FRIEND_TEST(EngineSyncTest, UserTweakPreservedInSeek);
FRIEND_TEST(EngineSyncTest, FollowerUserTweakPreservedInMasterChange);
FRIEND_TEST(EngineSyncTest, FollowerUserTweakPreservedInLeaderChange);
};
6 changes: 3 additions & 3 deletions src/engine/controls/ratecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RateControl::RateControl(const QString& group,
this, &RateControl::slotRateRangeChanged,
Qt::DirectConnection);

// Allow rate slider to go out of bounds so that master sync rate
// Allow rate slider to go out of bounds so that sync lock rate
// adjustments are not capped.
m_pRateSlider = new ControlPotmeter(
ConfigKey(group, "rate"), -1.0, 1.0, true);
Expand Down Expand Up @@ -461,11 +461,11 @@ double RateControl::calculateSpeed(double baserate, double speed, bool paused,
rate = m_pScratchController->getRate();
*pReportScratching = true;
} else {
// If master sync is on, respond to it -- but vinyl and scratch mode always override.
// If sync lock is on, respond to it -- but vinyl and scratch mode always override.
if (toSynchronized(getSyncMode()) && !paused &&
!bVinylControlEnabled && !useScratch2Value) {
if (m_pBpmControl == nullptr) {
qDebug() << "ERROR: calculateRate m_pBpmControl is null during master sync";
qDebug() << "ERROR: calculateRate m_pBpmControl is null during sync lock";
return 1.0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/engine/controls/ratecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public slots:

ControlObject* m_pSampleRate;

// For Master Sync
// For Sync Lock
BpmControl* m_pBpmControl;

ControlProxy* m_pSyncMode;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ void EngineBuffer::process(CSAMPLE* pOutput, const int iBufferSize) {
}
#endif

if (isMaster(m_pSyncControl->getSyncMode())) {
if (isLeader(m_pSyncControl->getSyncMode())) {
// Report our speed to SyncControl immediately instead of waiting
// for postProcess so we can broadcast this update to followers.
m_pSyncControl->reportPlayerSpeed(m_speed_old, m_scratching_old);
Expand Down Expand Up @@ -1300,7 +1300,7 @@ void EngineBuffer::postProcess(const int iBufferSize) {
m_pSyncControl->setLocalBpm(localBpm);
m_pSyncControl->updateAudible();
SyncMode mode = m_pSyncControl->getSyncMode();
if (isMaster(mode)) {
if (isLeader(mode)) {
m_pEngineSync->notifyBeatDistanceChanged(m_pSyncControl, beatDistance);
} else if (isFollower(mode)) {
// Report our speed to SyncControl. If we are master, we already did this.
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class EngineBuffer : public EngineObject {
FRIEND_TEST(EngineSyncTest, HalfDoubleThenPlay);
FRIEND_TEST(EngineSyncTest, UserTweakBeatDistance);
FRIEND_TEST(EngineSyncTest, UserTweakPreservedInSeek);
FRIEND_TEST(EngineSyncTest, FollowerUserTweakPreservedInMasterChange);
FRIEND_TEST(EngineSyncTest, FollowerUserTweakPreservedInLeaderChange);
FRIEND_TEST(EngineSyncTest, BeatMapQuantizePlay);
FRIEND_TEST(EngineBufferTest, ScalerNoTransport);
EngineSync* m_pEngineSync;
Expand Down
6 changes: 3 additions & 3 deletions src/engine/enginemaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const CSAMPLE* EngineMaster::getSidechainBuffer() const {
}

void EngineMaster::processChannels(int iBufferSize) {
// Update internal master sync rate.
// Update internal sync lock rate.
m_pMasterSync->onCallbackStart(m_iSampleRate, m_iBufferSize);

m_activeBusChannels[EngineChannel::LEFT].clear();
Expand All @@ -281,7 +281,7 @@ void EngineMaster::processChannels(int iBufferSize) {
m_activeChannels.clear();

//ScopedTimer timer("EngineMaster::processChannels");
EngineChannel* pMasterChannel = m_pMasterSync->getMaster();
EngineChannel* pMasterChannel = m_pMasterSync->getLeader();
// Reserve the first place for the master channel which
// should be processed first
m_activeChannels.append(NULL);
Expand Down Expand Up @@ -367,7 +367,7 @@ void EngineMaster::processChannels(int iBufferSize) {
}
}

// Do internal master sync post-processing before the other
// Do internal sync lock post-processing before the other
// channels.
// Note, because we call this on the internal clock first,
// it will have an up-to-date beatDistance, whereas the other
Expand Down
4 changes: 2 additions & 2 deletions src/engine/enginemaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class EngineMaster : public QObject, public AudioSource {
}
}

// Provide access to the master sync so enginebuffers can know what their rate controller is.
// Provide access to the sync lock so enginebuffers can know what their rate controller is.
EngineSync* getEngineSync() const{
return m_pMasterSync;
}
Expand Down Expand Up @@ -254,7 +254,7 @@ class EngineMaster : public QObject, public AudioSource {
ControlObject* m_pBoothEnabled;

private:
// Processes active channels. The master sync channel (if any) is processed
// Processes active channels. The sync lock channel (if any) is processed
// first and all others are processed after. Populates m_activeChannels,
// m_activeBusChannels, m_activeHeadphoneChannels, and
// m_activeTalkoverChannels with each channel that is active for the
Expand Down
4 changes: 2 additions & 2 deletions src/engine/sync/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class Clock {
virtual ~Clock() = default;

virtual double getBeatDistance() const = 0;
virtual void updateMasterBeatDistance(double beatDistance) = 0;
virtual void updateLeaderBeatDistance(double beatDistance) = 0;

virtual double getBpm() const = 0;
virtual void updateMasterBpm(double bpm) = 0;
virtual void updateLeaderBpm(double bpm) = 0;
};
Loading

0 comments on commit 9e85796

Please sign in to comment.