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. 3): Add ControlPotMeter aliasing and move audio_latency_* COs #11998

Merged
merged 11 commits into from
Sep 24, 2023

Conversation

Holzhaus
Copy link
Member

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

I had to add proper support for adding aliases to ControlPotMeter due to audio_latency_usage and audio_latency_overload. However, I'm wondering why these controls are ControlPotMeter objects in the first place. These should be read-only IIRC, so there is no need for all these setter-COs.

Old Name New Name Alias?
[Master],audio_latency_usage [App],audio_latency_usage ✔️
[Master],audio_latency_overload [App],audio_latency_overload ✔️
[Master],audio_latency_overload_count [App],audio_latency_overload_count ✔️

@Holzhaus Holzhaus added code quality control objects Issues and bugs specifically in regard to mixxx `ControlObjects` labels Sep 17, 2023
@Holzhaus Holzhaus added this to the 2.4.0 milestone Sep 17, 2023
@Holzhaus Holzhaus marked this pull request as ready for review September 18, 2023 22:47
@Holzhaus
Copy link
Member Author

However, I'm wondering why these controls are ControlPotmeter objects in the first place. These should be read-only IIRC, so there is no need for all these setter-COs.

I couldn't find any use of the additional ControlPotmeter COs, and I think they don't make sense. I converted audio_latency_usage and audio_latency_overload into regular COs.

Comment on lines 135 to 136
m_controlMinusToggle.addAlias(ConfigKey(
key.group, QString(key.item) + QStringLiteral("_minus_toggle")));
Copy link
Member

Choose a reason for hiding this comment

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

this is duplicated across the constructor, I'm worried that we might forget to update both places in case we add another suffix, would this be possible to deduplicate?

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 don't really know how to do that in an elegant way. I pushed a little helper function to make the ConfigKey creation less verbose though.

Copy link
Member

@Swiftb0y Swiftb0y Sep 21, 2023

Choose a reason for hiding this comment

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

Well, I came up with this: https://compiler-explorer.com/z/xxE83Gf8r
I find it very elegant, just don't know how easy it is to understand.
Frankly, now that I've written it, I don't think we should use it here. Its very seldom that we would add another suffix for ControlPotMeter and the complexity doesn't warrant it.

Copy link
Member

@Swiftb0y Swiftb0y Sep 21, 2023

Choose a reason for hiding this comment

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

Next best thing would just be a comment in both parts reminding the reader of the other part.

Copy link
Member Author

Choose a reason for hiding this comment

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

src/engine/enginemixer.cpp Outdated Show resolved Hide resolved
src/engine/enginemixer.cpp Outdated Show resolved Hide resolved
@ronso0
Copy link
Member

ronso0 commented Sep 19, 2023

I couldn't find any use of the additional ControlPotmeter COs, and I think they don't make sense. I converted audio_latency_usage and audio_latency_overload into regular COs.

Great! So we don't need Potmeter aliasing at all? If yes, why keep that commit?

@Holzhaus
Copy link
Member Author

I couldn't find any use of the additional ControlPotmeter COs, and I think they don't make sense. I converted audio_latency_usage and audio_latency_overload into regular COs.

Great! So we don't need Potmeter aliasing at all? If yes, why keep that commit?

There are other COs that might need it. We didn't rename all of them.

And I thinks it's good if addAlias "just works". Without that commit, if we later add an alias to an ControlPotmeter, it would work but just alias the main control, not the other ones and we might not notice it.

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 otherwise, thank you

src/engine/enginemixer.cpp Outdated Show resolved Hide resolved
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, thank you.

@Holzhaus
Copy link
Member Author

Merge?

@Swiftb0y Swiftb0y merged commit c8fdb89 into mixxxdj:2.4 Sep 24, 2023
11 of 13 checks passed
@Holzhaus
Copy link
Member Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build code quality control objects Issues and bugs specifically in regard to mixxx `ControlObjects` controller mappings skins ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants