-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
lp1935703: Use nearest frame boundary in lookupBeatPositions() #4095
lp1935703: Use nearest frame boundary in lookupBeatPositions() #4095
Conversation
@JoergAtGithub please test. |
Please rebase |
Beat searches using fractional positions should be allowed, only saving fractional positions should cause a debug assertion. This should fix the issue reported here: https://bugs.launchpad.net/mixxx/+bug/1935703/comments/6
fd056d3
to
015ad88
Compare
Pull Request Test Coverage Report for Build 1018795091
💛 - Coveralls |
src/test/beatmaptest.cpp
Outdated
@@ -10,6 +10,15 @@ using namespace mixxx; | |||
|
|||
namespace { | |||
|
|||
int countBeatsInIterator(std::unique_ptr<BeatIterator> pIterator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An iterator is a pointer tow a beat. So there can be now beats in it.
numberOfRemainingBeats() or such might be fit better.
Or numberOfBeatsinRange() ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iterator is created by std::lower_bound
"Returns an iterator pointing to the first element in the range [first, last]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -481,15 +481,14 @@ std::unique_ptr<BeatIterator> BeatMap::findBeats( | |||
return std::unique_ptr<BeatIterator>(); | |||
} | |||
|
|||
Beat startBeat = beatFromFramePos(startPosition); | |||
Beat endBeat = beatFromFramePos(endPosition); | |||
Beat startBeat = beatFromFramePos(startPosition.toUpperFrameBoundary()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the rational to shrink the range here compared to the original version?
I think a comment would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It this whole function unused? Delete!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, it is used in WaveformRenderBeat::draw() to find the visible beats in a time range. So it is still required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the rational to shrink the range here compared to the original version?
I think a comment would be helpful.
Beats can only appear a full frame positions.
Let's say a beat is at pos 100. If I say "Give me all beats between 100.5 and 200", it should not give me the beat at 100.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Beat searches using fractional positions should be allowed, only saving
fractional positions should cause a debug assertion. This should fix the
issue reported here: https://bugs.launchpad.net/mixxx/+bug/1935703/comments/6