-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Hook height migration #32467
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
base: master
Are you sure you want to change the base?
Hook height migration #32467
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2804,6 +2804,7 @@ void TRead::read(GradualTempoChange* c, XmlReader& xml, ReadContext& ctx) | |
| } | ||
| } | ||
|
|
||
| compat::CompatUtils::resetHookHeightSign(c); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(c); | ||
| } | ||
|
|
||
|
|
@@ -2909,6 +2910,7 @@ void TRead::read(Hairpin* h, XmlReader& e, ReadContext& ctx) | |
| } | ||
| } | ||
|
|
||
| compat::CompatUtils::resetHookHeightSign(h); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(h); | ||
|
|
||
| h->styleChanged(); | ||
|
|
@@ -3077,6 +3079,7 @@ void TRead::read(LetRing* r, XmlReader& e, ReadContext& ctx) | |
| e.unknown(); | ||
| } | ||
| } | ||
| compat::CompatUtils::resetHookHeightSign(r); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(r); | ||
| } | ||
|
|
||
|
|
@@ -3406,6 +3409,7 @@ void TRead::read(Ottava* o, XmlReader& e, ReadContext& ctx) | |
| while (e.readNextStartElement()) { | ||
| readProperties(o, e, ctx); | ||
| } | ||
| compat::CompatUtils::resetHookHeightSign(o); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(o); | ||
| if (o->ottavaType() != OttavaType::OTTAVA_8VA || o->numbersOnly() != o->propertyDefault(Pid::NUMBERS_ONLY).toBool()) { | ||
| o->styleChanged(); | ||
|
|
@@ -3461,6 +3465,7 @@ void TRead::read(PalmMute* p, XmlReader& e, ReadContext& ctx) | |
| e.unknown(); | ||
| } | ||
| } | ||
| compat::CompatUtils::resetHookHeightSign(p); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(p); | ||
| } | ||
|
|
||
|
|
@@ -3608,6 +3613,7 @@ void TRead::read(Pedal* p, XmlReader& e, ReadContext& ctx) | |
| p->setPropertyFlags(Pid::END_TEXT, PropertyFlags::STYLED); | ||
| } | ||
| } | ||
| compat::CompatUtils::resetHookHeightSign(p); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(p); | ||
| } | ||
|
|
||
|
|
@@ -4134,6 +4140,8 @@ void TRead::read(TextLineBase* b, XmlReader& e, ReadContext& ctx) | |
| e.unknown(); | ||
| } | ||
| } | ||
|
|
||
| compat::CompatUtils::resetHookHeightSign(b); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like there's code before the function call that does the same thing as the function? |
||
| compat::CompatUtils::setTextLineTextPositionFromAlign(b); | ||
| } | ||
|
|
||
|
|
@@ -4470,6 +4478,7 @@ void TRead::read(Volta* v, XmlReader& e, ReadContext& ctx) | |
| e.unknown(); | ||
| } | ||
| } | ||
| compat::CompatUtils::resetHookHeightSign(v); | ||
| compat::CompatUtils::setTextLineTextPositionFromAlign(v); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,8 @@ | |
| <Spanner type="HairPin"> | ||
| <HairPin> | ||
| <subtype>0</subtype> | ||
| <beginHookHeight>-1.9</beginHookHeight> | ||
| <endHookHeight>-1.9</endHookHeight> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests changes look quite weird: why are we suddenly adding hookHeight tags to hairpins?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <eid>O_O</eid> | ||
| </HairPin> | ||
| <next> | ||
|
|
||

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 makes me a bit uncomfortable to have to add this compat function to 20 different places across all the read module. Could we not move this to
EngravingCompat::doPreLayoutCompat? It will perhaps slightly add to the reading time as we need to navigate and find these spanners, but it's well worth it IMO if it saves us from calling it so many timesUh oh!
There was an error while loading. Please reload this page.
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.
We could, but I'm keen to put as much compatibility code which doesn't require score context in the file reading code as possible. Otherwise we need to add the same compatibility fix for palette items in PaletteCompat, which is something we always forget to do and I'd prefer to avoid where possible. This was part of the motivation behind versioning the palette files.
I agree this is a bit messy though.
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.
Ah good point about the palettes, then yeah I think it's fine 👍