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

Rename Sync instances of "master" to "leader" #3921

Closed
wants to merge 11 commits into from
Closed

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented May 28, 2021

Also add an alias from the sync_master CO to sync_leader.

This PR depends on my stopped-explicit branch so it will appear to have those changes. This PR is a no-op change.

@JoergAtGithub
Copy link
Member

Does this break the API for controller mappings?

@ywwg ywwg marked this pull request as draft May 28, 2021 20:47
@ywwg ywwg force-pushed the syncleader branch 3 times, most recently from 3f679d2 to 9d6ea2a Compare May 28, 2021 22:46
@ywwg
Copy link
Member Author

ywwg commented May 28, 2021

it shouldn't, because I have an alias from sync_master to sync_leader. Old scripts should continue to work.

@ywwg
Copy link
Member Author

ywwg commented Jun 1, 2021

depends on #3706 which depends on #3899

@Holzhaus
Copy link
Member

Holzhaus commented Jun 1, 2021

FYI if you pushed a broken merge, you can still amend it later with git commit --amend. Please make sure that all commit build.

@ywwg
Copy link
Member Author

ywwg commented Jun 4, 2021

I'm glad we've moved to squash-commits by default! I prefer it

@daschuer
Copy link
Member

daschuer commented Jun 4, 2021

Did we? I don't prefere it, because "blame" will become less significant.

@ywwg
Copy link
Member Author

ywwg commented Jun 4, 2021

Oh, so it's more like "squash out commits that were objectively broken"

@Holzhaus
Copy link
Member

Holzhaus commented Jun 4, 2021

Yes, we don't squash by default. We just want to avoid commits that don't build because it makes bisecting impossible.

@ywwg
Copy link
Member Author

ywwg commented Jun 16, 2021

fixed the commit order so it's not completely messed up

@ywwg ywwg marked this pull request as ready for review July 9, 2021 19:26
@ywwg
Copy link
Member Author

ywwg commented Jul 9, 2021

fixed conflicts, ready for review

@Holzhaus
Copy link
Member

Holzhaus commented Jul 9, 2021

Some pre commit issues.

src/engine/sync/syncable.h Outdated Show resolved Hide resolved
@Holzhaus
Copy link
Member

Holzhaus commented Jul 9, 2021

Some pre commit issues.

You don't need to fix the eslint issues, but the end-of-file issues would be nice.

@ywwg
Copy link
Member Author

ywwg commented Jul 10, 2021

You don't need to fix the eslint issues, but the end-of-file issues would be nice.

yeah using the autoformatter results in a gigantic number of changes

@ywwg
Copy link
Member Author

ywwg commented Jul 10, 2021

fixed conflict

@ywwg
Copy link
Member Author

ywwg commented Jul 10, 2021

no diff when I run that command:
Fix End of Files.........................................................Passed

@coveralls
Copy link

coveralls commented Jul 10, 2021

Pull Request Test Coverage Report for Build 1051095745

  • 167 of 204 (81.86%) changed or added relevant lines in 8 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.008%) to 28.636%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/engine/controls/ratecontrol.cpp 0 1 0.0%
src/engine/controls/bpmcontrol.cpp 0 2 0.0%
src/engine/sync/internalclock.cpp 23 27 85.19%
src/engine/sync/synccontrol.cpp 45 58 77.59%
src/engine/sync/enginesync.cpp 82 99 82.83%
Files with Coverage Reduction New Missed Lines %
src/engine/sync/synccontrol.cpp 1 82.05%
src/engine/sync/internalclock.cpp 3 80.51%
Totals Coverage Status
Change from base Build 1050590600: 0.008%
Covered Lines: 20095
Relevant Lines: 70175

💛 - Coveralls

@ywwg
Copy link
Member Author

ywwg commented Jul 12, 2021

friendly ping

@Holzhaus
Copy link
Member

I was wondering if we should really change all legacy mappings, since these are not pre-commit clean and this will cause pre-commit issues when merging main into other branches locally. It's not necessary because the old name still works due to the alias.

But many people copy&paste code from old mappings and, so term would proliferate. Let's do this once now.

Important: if you're reading this because you experienced the issue I described above, please do this: if you're only contributing a controller mapping, please fetch latest main and rebase. If you're working on a branch unrelated to mappings, commit the merge commit with SKIP=eslint git commit.

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I grepped the code and found some more sync-related uses of the master term that you missed:

../src/test/synccontroltest.cpp:4:// * Quantize mode nudges tracks in sync, whether internal or deck master.
../src/test/co_dumps/co_dump_inital.csv:100:[Channel1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:112:[Channel2],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:173:[Channel3],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:190:[Channel4],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:346:[PreviewDeck1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9714:[Sampler3],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9725:[Sampler4],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9740:[Sampler1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9762:[Sampler2],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9912:[InternalClock],sync_master,0
../src/skin/legacy/tooltips.cpp:553:            << tr("Tap to sync the tempo to other playing tracks or the master clock.")
../src/skin/legacy/tooltips.cpp:567:            << tr("When enabled, this device will serve as the master clock for all other decks.");
../src/engine/sync/syncable.h:144:    // Update the playback speed of the master, including scratch values.
../src/engine/controls/bpmcontrol.cpp:424:    // If we are not quantized, or there are no beats, or we're master,
../src/engine/controls/bpmcontrol.cpp:463:    // Either shortest distance is directly to the master or backwards.
../src/engine/controls/bpmcontrol.cpp:466:    // from master to my percentage. All of the control code below is based on
../src/engine/controls/bpmcontrol.cpp:483:        kLogger.trace() << "master beat distance:" << syncTargetBeatDistance;
../src/controllers/controlpickermenu.cpp:235:               tr("Increase internal master BPM by 1"), syncMenu);
../src/controllers/controlpickermenu.cpp:238:               tr("Decrease internal master BPM by 1"), syncMenu);
../src/controllers/controlpickermenu.cpp:241:               tr("Increase internal master BPM by 0.1"), syncMenu);
../src/controllers/controlpickermenu.cpp:243:               tr("Decrease internal master BPM by 0.1"), syncMenu);
../src/controllers/controlpickermenu.cpp:245:    addDeckAndSamplerControl("sync_leader", tr("Sync Leader"), tr("Toggle sync master"), syncMenu);

Copy link

@fossdd fossdd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see that in Mixxx. also due to its negative connotation. See https://lore.kernel.org/git/CAOAHyQwyXC1Z3v7BZAC+Bq6JBaM7FvBenA-1fcqeDV==apdWDg@mail.gmail.com/

@Holzhaus
Copy link
Member

Would like to see that in Mixxx. also due to its negative connotation. See https://lore.kernel.org/git/CAOAHyQwyXC1Z3v7BZAC+Bq6JBaM7FvBenA-1fcqeDV==apdWDg@mail.gmail.com/

Yes, we already committed to doing that here: https://mixxx.org/news/2020-06-29-black-lives-matter/

@fossdd
Copy link

fossdd commented Jul 14, 2021 via email

@Holzhaus
Copy link
Member

Thanks. I grepped the code and found some more sync-related uses of the master term that you missed:

../src/test/synccontroltest.cpp:4:// * Quantize mode nudges tracks in sync, whether internal or deck master.
../src/test/co_dumps/co_dump_inital.csv:100:[Channel1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:112:[Channel2],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:173:[Channel3],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:190:[Channel4],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:346:[PreviewDeck1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9714:[Sampler3],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9725:[Sampler4],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9740:[Sampler1],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9762:[Sampler2],sync_master,0
../src/test/co_dumps/co_dump_inital.csv:9912:[InternalClock],sync_master,0
../src/skin/legacy/tooltips.cpp:553:            << tr("Tap to sync the tempo to other playing tracks or the master clock.")
../src/skin/legacy/tooltips.cpp:567:            << tr("When enabled, this device will serve as the master clock for all other decks.");
../src/engine/sync/syncable.h:144:    // Update the playback speed of the master, including scratch values.
../src/engine/controls/bpmcontrol.cpp:424:    // If we are not quantized, or there are no beats, or we're master,
../src/engine/controls/bpmcontrol.cpp:463:    // Either shortest distance is directly to the master or backwards.
../src/engine/controls/bpmcontrol.cpp:466:    // from master to my percentage. All of the control code below is based on
../src/engine/controls/bpmcontrol.cpp:483:        kLogger.trace() << "master beat distance:" << syncTargetBeatDistance;
../src/controllers/controlpickermenu.cpp:235:               tr("Increase internal master BPM by 1"), syncMenu);
../src/controllers/controlpickermenu.cpp:238:               tr("Decrease internal master BPM by 1"), syncMenu);
../src/controllers/controlpickermenu.cpp:241:               tr("Increase internal master BPM by 0.1"), syncMenu);
../src/controllers/controlpickermenu.cpp:243:               tr("Decrease internal master BPM by 0.1"), syncMenu);
../src/controllers/controlpickermenu.cpp:245:    addDeckAndSamplerControl("sync_leader", tr("Sync Leader"), tr("Toggle sync master"), syncMenu);

@ywwg can you fix those? then we can merge imho.

@ywwg
Copy link
Member Author

ywwg commented Jul 19, 2021

ok picking this back up, thanks for finding the other remaining instances!

ywwg added 2 commits July 19, 2021 14:12
Remove sync_mode from control picker menu, it's an internal CO that
should not need to be mapped.
@ywwg
Copy link
Member Author

ywwg commented Jul 19, 2021

Updated based on that list. I removed the addDeckAndSamplerControl for sync_mode, it really should not be mapped (users should map sync_enabled and/or sync_leader.

Copy link
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ywwg Thanks. Unfortunately, I think you messed up a merge or something. I see a bunch of unrelated changes in the diff. Please fix that.

Also, these is one remaining occurence of the term related to sync - inenginebuffer.cpp, line 1328. Maybe you can correct that while you're at it.

@ywwg
Copy link
Member Author

ywwg commented Jul 20, 2021

I skimmed through the diff and couldn't find any unintended changes, could you give me an example?

CMakeLists.txt Outdated Show resolved Hide resolved
@ywwg
Copy link
Member Author

ywwg commented Jul 21, 2021

merged from main, I think that fixed the problem diffs

Holzhaus added a commit that referenced this pull request Jul 22, 2021
Squashed commit of the following:

commit 6a50c70
Merge: 805beb7 ac7daeb
Author: Owen Williams <owilliams@mixxx.org>
Date:   Tue Jul 20 22:55:05 2021 -0400

    Merge branch 'main' into syncleader

commit 805beb7
Author: Owen Williams <owilliams@mixxx.org>
Date:   Tue Jul 20 10:08:16 2021 -0400

    Sync Lock: missed a conversion to "leader"

commit 23942ee
Author: Owen Williams <owilliams@mixxx.org>
Date:   Mon Jul 19 14:20:30 2021 -0400

    Sync Lock: Update remaining instances of "master"

    Remove sync_mode from control picker menu, it's an internal CO that
    should not need to be mapped.

commit 6fbf69a
Merge: eb76915 36781b1
Author: Owen Williams <owilliams@mixxx.org>
Date:   Mon Jul 19 14:12:06 2021 -0400

    Merge branch 'syncleader'

commit 36781b1
Merge: e79703d 3ef395b
Author: Owen Williams <owilliams@mixxx.org>
Date:   Sat Jul 10 10:07:09 2021 -0400

    Merge branch 'main' into syncleader

commit e79703d
Author: Owen Williams <owilliams@mixxx.org>
Date:   Sat Jul 10 09:57:49 2021 -0400

    Sync Lock: convert enums to enum classes

commit 8559d2f
Author: Owen Williams <owilliams@mixxx.org>
Date:   Fri Jul 9 15:32:18 2021 -0400

    Sync Lock: rename a few more instances of sync_master to sync_leader

commit 9f374f4
Merge: 9e85796 422912b
Author: Owen Williams <owilliams@mixxx.org>
Date:   Fri Jul 9 15:25:26 2021 -0400

    Merge branch 'main' into syncleader

commit 9e85796
Author: Owen Williams <owilliams@mixxx.org>
Date:   Fri May 28 16:34:16 2021 -0400

    Rename Sync instances of "master" to "leader"

    Also add an alias from the sync_master CO to sync_leader

commit 2d2b485
Author: Owen Williams <owilliams@mixxx.org>
Date:   Tue Jun 15 22:21:04 2021 -0400

    Sync Lock: Don't recalc half/double multiplier on every callback

commit fa980d9
Author: Owen Williams <owilliams@mixxx.org>
Date:   Mon Mar 15 15:51:51 2021 -0400

    Sync Lock: rename functions to make them clearer
@Holzhaus
Copy link
Member

Merged in 0fb764a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants