Skip to content

Commit

Permalink
Sync Lock: Update remaining instances of "master"
Browse files Browse the repository at this point in the history
Remove sync_mode from control picker menu, it's an internal CO that
should not need to be mapped.
  • Loading branch information
ywwg committed Jul 19, 2021
1 parent 6fbf69a commit 23942ee
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 34 deletions.
47 changes: 32 additions & 15 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,39 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
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"),
tr("Increase internal master BPM by 1"), syncMenu);

addControl("[InternalClock]", "bpm_down", tr("Internal Master BPM -1"),
tr("Decrease internal master BPM by 1"), syncMenu);

addControl("[InternalClock]", "bpm_up_small", tr("Internal Master BPM +0.1"),
tr("Increase internal master BPM by 0.1"), syncMenu);
addControl("[InternalClock]", "bpm_down_small", tr("Internal Master BPM -0.1"),
tr("Decrease internal master BPM by 0.1"), syncMenu);
addControl("[InternalClock]",
"bpm",
tr("Internal Leader BPM"),
tr("Internal Leader BPM"),
syncMenu);
addControl("[InternalClock]",
"bpm_up",
tr("Internal Leader BPM +1"),
tr("Increase internal Leader BPM by 1"),
syncMenu);

addControl("[InternalClock]",
"bpm_down",
tr("Internal Leader BPM -1"),
tr("Decrease internal Leader BPM by 1"),
syncMenu);

addControl("[InternalClock]",
"bpm_up_small",
tr("Internal Leader BPM +0.1"),
tr("Increase internal Leader BPM by 0.1"),
syncMenu);
addControl("[InternalClock]",
"bpm_down_small",
tr("Internal Leader BPM -0.1"),
tr("Decrease internal Leader BPM by 0.1"),
syncMenu);
syncMenu->addSeparator();
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);
addDeckAndSamplerControl("sync_leader",
tr("Sync Leader"),
tr("Sync mode 3-state toggle / indicator (Off, Soft Leader, "
"Explicit Leader)"),
syncMenu);

// Speed
QMenu* speedMenu = addSubmenu(tr("Speed"));
Expand Down
8 changes: 4 additions & 4 deletions src/engine/controls/bpmcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ double BpmControl::calcSyncedRate(double userTweak) {
rate = m_dSyncInstantaneousBpm / m_pLocalBpm->get();
}

// If we are not quantized, or there are no beats, or we're master,
// If we are not quantized, or there are no beats, or we're leader,
// or we're in reverse, just return the rate as-is.
if (!m_pQuantize->toBool() || !m_pBeats || m_pReverseButton->toBool()) {
m_resetSyncAdjustment = true;
Expand Down Expand Up @@ -458,10 +458,10 @@ double BpmControl::calcSyncAdjustment(bool userTweakingSync) {
m_dLastSyncAdjustment = 1.0;
}

// Either shortest distance is directly to the master or backwards.
// Either shortest distance is directly to the leader or backwards.

// TODO(rryan): This is kind of backwards because we are measuring distance
// from master to my percentage. All of the control code below is based on
// from leader to my percentage. All of the control code below is based on
// this point of reference so I left it this way but I think we should think
// about things in terms of "my percentage-offset setpoint" that the control
// loop should aim to maintain.
Expand All @@ -478,7 +478,7 @@ double BpmControl::calcSyncAdjustment(bool userTweakingSync) {

if (kLogger.traceEnabled()) {
kLogger.trace() << m_group << "****************";
kLogger.trace() << "master beat distance:" << syncTargetBeatDistance;
kLogger.trace() << "target beat distance:" << syncTargetBeatDistance;
kLogger.trace() << "my beat distance:" << thisBeatDistance;
kLogger.trace() << "user offset distance:" << curUserOffset;
kLogger.trace() << "error :" << error;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sync/syncable.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Syncable {
// of half-double multiplier.
virtual void reinitLeaderParams(double beatDistance, double baseBpm, double bpm) = 0;

// Update the playback speed of the master, including scratch values.
// Update the playback speed of the leader, including scratch values.
// Must never result in a call to
// SyncableListener::notifyInstantaneousBpmChanged or signal loops could
// occur.
Expand Down
6 changes: 3 additions & 3 deletions src/skin/legacy/tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ void Tooltips::addStandardTooltips() {
// Awesome-Sync (TM)
add("sync_enabled")
<< tr("Enable Sync Lock")
<< tr("Tap to sync the tempo to other playing tracks or the master clock.")
<< tr("Tap to sync the tempo to other playing tracks or the sync leader.")
<< tr("Hold for at least a second to enable sync lock for this deck.")
<< tr("Decks with sync locked will all play at the same tempo, and decks that also have "
"quantize enabled will always have their beats lined up.");
Expand All @@ -563,8 +563,8 @@ void Tooltips::addStandardTooltips() {
<< QString("%1: %2").arg(rightClick, tr("Resets the key to the original track key."));

add("sync_leader")
<< tr("Enable Sync Clock Master")
<< tr("When enabled, this device will serve as the master clock for all other decks.");
<< tr("Enable Sync Leader")
<< tr("When enabled, this device will serve as the sync leader for all other decks.");

add("rate")
<< tr("Speed Control")
Expand Down
20 changes: 10 additions & 10 deletions src/test/co_dumps/co_dump_inital.csv
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
[EqualizerRack1_[Channel3]_Effect1],parameter1_type,2
[Sampler1],hotcue_17_gotoandplay,0
[PreviewDeck1],beatloop_32_activate,0
[Channel1],sync_master,0
[Channel1],sync_leader,0
[EffectRack1_EffectUnit4_Effect3],parameter1_link_type,0
[QuickEffectRack1_[Channel3]_Effect1],parameter6_toggle,0
[EffectRack1_EffectUnit3_Effect4],parameter3_minus_toggle,0
Expand All @@ -109,7 +109,7 @@
[QuickEffectRack1_[Channel1]_Effect1],parameter13_down,0
[Sampler2],hotcue_17_gotoandplay,0
[EffectRack1_EffectUnit3_Effect3],parameter14_set_minus_one,0
[Channel2],sync_master,0
[Channel2],sync_leader,0
[EffectRack1_EffectUnit4_Effect4],parameter1_link_type,0
[EffectRack1_EffectUnit3_Effect1],parameter5_minus_toggle,0
[EqualizerRack1_[Master]_Effect1],button_parameter10_loaded,0
Expand Down Expand Up @@ -170,7 +170,7 @@
[Sampler3],VuMeterL_up,0
[QuickEffectRack1_[Channel4]_Effect1],parameter3_set_zero,0
[Sampler3],hotcue_27_gotoandplay,0
[Channel3],sync_master,0
[Channel3],sync_leader,0
[QuickEffectRack1_[Channel3]_Effect1],parameter3_toggle,0
[EffectRack1_EffectUnit3_Effect2],parameter6_minus_toggle,0
[EqualizerRack1_[Channel3]_Effect1],parameter14_down,0
Expand All @@ -187,7 +187,7 @@
[Master],headGain_set_one,0
[Sampler4],hotcue_27_gotoandplay,0
[EffectRack1_EffectUnit4_Effect2],num_parameters,0
[Channel4],sync_master,0
[Channel4],sync_leader,0
[EffectRack1_EffectUnit3_Effect3],parameter9_minus_toggle,0
[EffectRack1_EffectUnit2_Effect2],parameter3_type,0
[Sampler4],hotcue_16_gotoandstop,0
Expand Down Expand Up @@ -343,7 +343,7 @@
[EffectRack1_EffectUnit3_Effect3],parameter6_minus_toggle,0
[EqualizerRack1_[Channel2]],mix_down,0
[EffectRack1_EffectUnit2_Effect2],button_parameter9_type,0
[PreviewDeck1],sync_master,0
[PreviewDeck1],sync_leader,0
[EffectRack1_EffectUnit4_Effect4],button_parameter11_type,0
[EqualizerRack1_[Channel4]_Effect1],button_parameter4_type,0
[PreviewDeck1],bpm_minus_toggle,0
Expand Down Expand Up @@ -9711,7 +9711,7 @@
[Microphone2],PeakIndicator_toggle,0
[EffectRack1_EffectUnit1_Effect2],parameter14_link_inverse,0
[EffectRack1_EffectUnit3_Effect3],button_parameter8_type,0
[Sampler3],sync_master,0
[Sampler3],sync_leader,0
[EqualizerRack1_[Master]_Effect1],button_parameter1,0
[QuickEffectRack1_[Channel1]_Effect1],parameter12_set_default,0
[Sampler1],rate_temp_down,0
Expand All @@ -9722,7 +9722,7 @@
[EffectRack1_EffectUnit3_Effect4],button_parameter8_type,0
[QuickEffectRack1_[Channel2]_Effect1],button_parameter9_type,0
[EqualizerRack1_[Channel3]],super1_set_minus_one,0
[Sampler4],sync_master,0
[Sampler4],sync_leader,0
[EffectRack1_EffectUnit4_Effect1],button_parameter5_type,0
[EqualizerRack1_[Channel4]_Effect1],button_parameter15,0
[PreviewDeck1],hotcue_23_gotoandplay,0
Expand All @@ -9737,7 +9737,7 @@
[Microphone4],PeakIndicator_toggle,0
[EffectRack1_EffectUnit3_Effect4],parameter14_link_inverse,0
[Sampler4],talkover,0
[Sampler1],sync_master,0
[Sampler1],sync_leader,0
[Channel4],beatloop_4_enabled,0
[EffectRack1_EffectUnit4_Effect2],button_parameter5_type,0
[QuickEffectRack1_[Channel1]_Effect1],parameter9,0
Expand All @@ -9759,7 +9759,7 @@
[PreviewDeck1],hotcue_20_activate_preview,0
[QuickEffectRack1_[Channel1]_Effect1],parameter2,0.707107
[EffectRack1_EffectUnit4_Effect4],parameter1_link_inverse,0
[Sampler2],sync_master,0
[Sampler2],sync_leader,0
[Channel3],beatloop_4_enabled,0
[EffectRack1_EffectUnit2_Effect3],parameter8_set_minus_one,0
[QuickEffectRack1_[Channel3]_Effect1],parameter1_down_small,0
Expand Down Expand Up @@ -9909,7 +9909,7 @@
[Channel3],hotcue_31_goto,0
[Playlist],LoadSelectedIntoFirstStopped,0
[Channel2],hotcue_1_activate_preview,0
[InternalClock],sync_master,0
[InternalClock],sync_leader,0
[EffectRack1_EffectUnit4_Effect1],parameter11_down_small,0
[Sampler3],rateSearch_set_minus_one,0
[EqualizerRack1_[Channel1]_Effect1],parameter11_up,0
Expand Down
2 changes: 1 addition & 1 deletion src/test/synccontroltest.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Tests for Sync Lock.
// There are no tests for actual deck playback, since I don't know how to mock that out yet.
// The following manual tests should probably be performed:
// * Quantize mode nudges tracks in sync, whether internal or deck master.
// * Quantize mode nudges tracks in sync, whether internal or deck leader.
// * Flinging tracks with the waveform should work.
// * vinyl??

Expand Down

0 comments on commit 23942ee

Please sign in to comment.