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

CO Renaming (Pt. 1) #11980

Merged
merged 7 commits into from
Sep 16, 2023
Merged

CO Renaming (Pt. 1) #11980

merged 7 commits into from
Sep 16, 2023

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Sep 13, 2023

This PR is part of the ongoing effort to remove offensive language from the Mixxx codebase (#11931).

Here is the first bunch of renamings discussed in #11960 (comment). I removed the num_mics_configured CO since it's used nowhere outside the EngineMixer class (not even mappings or skins) and can be replaced with a simple member variable.

Old Name New Name Alias?
[Master],guiTick50ms [App],gui_tick_50ms_period_s ✔️ (although undocumented)
[Master],guiTickTime [App],gui_tick_full_period_s ✔️ (although undocumented)
[Master],indicator_250millis [App],indicator_250ms ✔️
[Master],indicator_500millis [App],indicator_500ms ✔️
[Master],keylock_engine [App],keylock_engine
[Master],num_auxiliaries [App],num_auxiliaries ✔️ (although undocumented)
[Master],num_decks [App],num_decks ✔️
[Master],num_microphones [App],num_microphones ✔️ (although undocumented)
[Master],num_mics_configured Removed n/A
[Master],num_preview_decks [App],num_preview_decks ✔️
[Master],num_samplers [App],num_samplers ✔️
[Master],samplerate [App],samplerate ✔️

@Swiftb0y
Copy link
Member

While were at it, I'd also like to propose to retire the millis suffix. We had that as a suffix for constants and member variables for some time, but this will get obsolete with <chrono> types and literals fast. So I'd propose to stick with the ms actually since that mirrors std::chrono_literals. Wdyt?

Comment on lines -127 to +133
: numDecks(ConfigKey("[Master]", "num_decks"), true),
numSamplers(ConfigKey("[Master]", "num_samplers"), true),
numPreviewDecks(ConfigKey("[Master]", "num_preview_decks"),
true) {
: numDecks(ConfigKey(kAppGroup, QStringLiteral("num_decks")), true),
numSamplers(ConfigKey(kAppGroup, QStringLiteral("num_samplers")), true),
numPreviewDecks(ConfigKey(kAppGroup, QStringLiteral("num_preview_decks")),
true) {
Copy link
Member

Choose a reason for hiding this comment

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

Please only add a test for the new CO name and leave the existing one as it is

Copy link
Member Author

Choose a reason for hiding this comment

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

The plan was to remove the word from the codebase as much as possible which includes tests. Also, these tests are supposed to check if the AutoDJ processor works correctly, not if old CO names still work. I agree that it makes sense to test this, too, but that should be a different test IMHO.

I was planning to add a new test that checks if the aliases exist. This would ideally go into coreservicestest.cpp since most other tests do not create all COs. Unfortunately this test is broken at the moment. I'm currently looking into it.

Copy link
Member

Choose a reason for hiding this comment

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

this would / could result in warnings raised by tests though if we decided to implement the warnings on deprecated CO access.

Copy link
Member

Choose a reason for hiding this comment

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

We need to ensure the backward compatibility of our legacy API. I'm open for any test implementation, that ensures this.

@Holzhaus
Copy link
Member Author

Holzhaus commented Sep 13, 2023

While were at it, I'd also like to propose to retire the millis suffix. We had that as a suffix for constants and member variables for some time, but this will get obsolete with <chrono> types and literals fast. So I'd propose to stick with the ms actually since that mirrors std::chrono_literals. Wdyt?

Okay for me. By the way, should I also rename gui_tick_time to gui_tick_s then? I think it's in seconds if I remember correctly.

@Swiftb0y
Copy link
Member

Okay for me. By the way, should I also rename gui_tick_time to gui_tick_s then? I think it's in seconds if I remember correctly.

Sure. though I didn't check either, never heard of that CO before tbh...

@daschuer
Copy link
Member

'guiTickTime' and 'guiTick50ms' have are both in seconds in terms of std::chrono.
The difference is that the guiTickTime is advanced in refresh rate steps and guiTick50ms is advanced in 50ms steps. The diffrence is the period in terms of chono.

So we may think of
'gui_full_period_tick_s'
'gui_50ms_period_tick_s'

@daschuer
Copy link
Member

Derived form that are
'indicator_250millis'
'indicator_500millis'

They just cycle 0.0 ad 1.0.
Rename as well?

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 84 to 89
GuiTickTimer::GuiTickTimer(QObject* pParent)
: QObject(pParent),
m_pGuiTick(make_parented<ControlProxy>(
"[Master]", "guiTickTime", this)),
QStringLiteral("[App]"), QStringLiteral("gui_tick_time"), this)),
m_bActive(false) {
}
Copy link
Member

Choose a reason for hiding this comment

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

this was removed anyway in #11850, just fyi

Comment on lines +13 to +17
ConfigKey(kAppGroup, QStringLiteral("gui_tick_full_period_s")));
m_pCOGuiTickTime->addAlias(ConfigKey(kLegacyGroup, QStringLiteral("guiTickTime")));
m_pCOGuiTick50ms = std::make_unique<ControlObject>(
ConfigKey(kAppGroup, QStringLiteral("gui_tick_50ms_period_s")));
m_pCOGuiTick50ms->addAlias(ConfigKey(kLegacyGroup, QStringLiteral("guiTick50ms")));
Copy link
Member

Choose a reason for hiding this comment

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

just for the future, we should probably not document these are they will be obsolete with QML, or rather they would have to be reimplemented.

Comment on lines -62 to 64
m_pCOTGuiTick = new ControlProxy("[Master]", "guiTick50ms", this);
m_pCOTGuiTick = new ControlProxy(
QStringLiteral("[App]"), QStringLiteral("gui_tick_50ms_period_s"), this);
m_pCOTGuiTick->connectValueChanged(this, &WTrackTableView::slotGuiTick50ms);
Copy link
Member

Choose a reason for hiding this comment

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

this dependency is... interesting... worrisome?
Anyways, obsolete with QML.

const meterConnection = engine.makeConnection("[Master]", "guiTick50ms", function(_value) {
const meterConnection = engine.makeConnection("[App]", "gui_tick_50ms_period_s", function(_value) {
Copy link
Member

Choose a reason for hiding this comment

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

we should probably track this in an issue on the QML project board, otherwise this will silently break under QML. putting this on an engine.beginTimer instead should be sufficient.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

LGTM. last chance for anyone to object.

@Holzhaus
Copy link
Member Author

Holzhaus commented Sep 14, 2023

I was planning to add tests for the legacy aliases as @JoergAtGithub requested, but the CoreServicesTest (which would be the ideal location for such a test because it creates all COs) does not work on CI. I'll try to find another way.

@JoergAtGithub
Copy link
Member

I was planning to add tests for the legacy aliases as @JoergAtGithub requested, but at the CoreServicesTest (which would be the ideal location for such a test because it creates all COs) does not work on CI. I'll try to find another way.

I appreciate your effort! I think it's safer to have this test case in place before merging this. Otherwise this is LGTM!

@github-actions github-actions bot added the build label Sep 16, 2023
class ControlObjectAliasTest : public MixxxTest {
};

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this needs to be removed when merging into main, right?

@Holzhaus
Copy link
Member Author

I was planning to add tests for the legacy aliases as @JoergAtGithub requested, but at the CoreServicesTest (which would be the ideal location for such a test because it creates all COs) does not work on CI. I'll try to find another way.

I appreciate your effort! I think it's safer to have this test case in place before merging this. Otherwise this is LGTM!

Tests are in place now.

Copy link
Member

@JoergAtGithub JoergAtGithub left a comment

Choose a reason for hiding this comment

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

LGTM! Waiting for CI

@JoergAtGithub JoergAtGithub merged commit e336dfa into mixxxdj:2.4 Sep 16, 2023
10 of 11 checks passed
@JoergAtGithub
Copy link
Member

Thank you!

@Swiftb0y
Copy link
Member

Thank you as well.

@Holzhaus
Copy link
Member Author

mixxxdj/manual#579

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.

4 participants