-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Write location before spanner end on score end #20107
Conversation
prevLoc.setStaff(s->staffIdx()); | ||
|
||
spannerEndLoc.toRelative(prevLoc); | ||
if (spannerEndLoc.frac() != Fraction(0, 1)) { |
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.
Shouldn't this condition better get moved up to the first if
?
if (frac == s->score()->endTick() && frac != Fraction(0,1)) {
Or ever the other way round?
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.
No, as spannerEndLoc
has been made relative to the previous location by this point. This is checking if spannerEndLoc
is the same as the previous location written to the file (difference between fractions is 0). If so, we don't need to bother writing to the file.
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.
I see, thanks for explaining
@DmitryArefiev Since #17646 seems also related to playback, does this also need to be tested by you? |
@cbjeukendrup I've tested #17646 on Win10 - looks fine, but #17646 also doesn't occur in 4.2 latest master (and happens in 4.1.1) |
Resolves: #19082
Resolves: #17646
This PR writes a location tag before any spanner which ends at the end of the score. Ususally, these spanners would be written to the beginning of the following bar. Instead they are written to the end of the bar, but when reading the file the location is ambiguous. The location tag ensures the location is updated to the end tick of the file when reading the spanner end.