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

Use mixxx::Bpm for some Beats functions Pt. 2 #4045

Merged
merged 5 commits into from
Jul 6, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Jul 1, 2021

Follow up to #4044.

@Holzhaus Holzhaus marked this pull request as ready for review July 6, 2021 11:11
@Holzhaus
Copy link
Member Author

Holzhaus commented Jul 6, 2021

I rebased on latest main. The added validity checks from #4044 uncovered two more code locations where the bpm value may be invalid, in EngineBuffer and SyncControl. To keep the changes small and leave the business logic unchanged, I added FIXMEs and just used Bpm::kValueUndefined in these cases. Ready to merge.

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Some minor comments

@@ -516,7 +516,7 @@ void SyncControl::notifySeek(double dNewPlaypos) {
double SyncControl::fileBpm() const {
mixxx::BeatsPointer pBeats = m_pBeats;
if (pBeats) {
return pBeats->getBpm();
return pBeats->getBpm().getValue();
}
return 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

return mixxx::Bpm::kValueUndefined instead of 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.

if (!isValid()) {
return -1;
return mixxx::Bpm();
Copy link
Contributor

Choose a reason for hiding this comment

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

Either return mixxx::Bpm() or {} but not a mixture of both in various places. I would prefer the latter, because we don't need to repeat the return type multiple times.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

@uklotzde uklotzde merged commit 14590f4 into mixxxdj:main Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants