-
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
New score and parts interactions #18722
New score and parts interactions #18722
Conversation
7d926f9
to
20eb630
Compare
f72747d
to
27517cb
Compare
27517cb
to
856b437
Compare
70df530
to
74da07b
Compare
424e4db
to
f6c7b02
Compare
f6c7b02
to
7d453d0
Compare
fc9b1e6
to
9554aa1
Compare
9554aa1
to
c2c2c1d
Compare
Found a bug:
Schermopname.2023-09-24.om.20.59.31.mov |
Another questionable bit of behaviour:
So the question is: should the "exclude from parts" checkbox be available for system header clefs? And if yes, how should it behave? |
34c65c6
to
375421e
Compare
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'm still not entirely trough it, but here are some comments and questions already!
src/engraving/dom/property.h
Outdated
extern const std::set<Pid>& positionProperties(); ///< All the properties that have to do with the position of an item | ||
extern const std::set<Pid>& textProperties(); ///< Text body of text items | ||
extern const std::set<Pid>& appearanceProperties(); ///< All the properties that are not position or text properties |
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.
Given the ways these methods are currently used, I'm thinking it might be more elegant to add a propertyGroup
field in PropertyMetaData
/ propertyList
. This has some advantages:
- it forces each property to be in a category (we'd need to add a "none" category for those special excluded properties though) without the need for that logic in
appearanceProperties()
- retrieving the category of a property can be done in constant time
- the stuff in
EngravingItem::relinkPropertiesToMaster
may become a bit cleaner in terms of code (just iterate over all properties and check propertyGroup equality) without becoming very different in terms of functionality and performance - it might be a slightly more extensible approach, if we ever introduce other categories
src/engraving/dom/edit.cpp
Outdated
|
||
if (score == this) { | ||
result = newMeasureBase; | ||
} else if (!result && score == scores.back()) { | ||
result = newMeasureBase; |
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 purpose of this change? It looks like this could cause that the returned MeasureBase*
points to a measure that is not part of the Score*
on which insertMeasure
was called. Is that desired?
src/engraving/dom/engravingitem.cpp
Outdated
return PropertyPropagation::NONE; | ||
} | ||
|
||
bool EngravingItem::canBeExcludedFromOtherParts() const |
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.
Is there a specific reason to choose for this implementation instead of making this a virtual method? I consider it closely related to manageExclusionFromParts
, which is virtual, so I'd personally prefer to keep these methods close to each other.
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.
Mostly because for such simple methods I hate to spread the information across 10 different files: it makes it harder later to find what I need, for no real benefit. I agree that in this case it looks more consistent with manageExclusionFromParts though
src/engraving/dom/textbase.cpp
Outdated
score()->undo(new ChangeTextProperties(m_cursor, id, v, ps)); | ||
} else { | ||
|
||
bool isTextSpecificProperty = id == Pid::FONT_STYLE || id == Pid::FONT_FACE || id == Pid::FONT_SIZE || id == Pid::TEXT_SCRIPT_ALIGN; |
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.
Here I see a lot more properties listed than in textProperties()
. Of course, this is about something different, so the list need not be the same, but still... shouldn't these properties also be in textProperties()
? Or otherwise, why only FONT_STYLE
and these others not?
} | ||
|
||
Score* linkedScore = linkedText->score(); | ||
TextCursor* linkedCursor = linkedText->cursor(); |
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.
Am I understanding correctly that this is about setting properties to selected characters of the text (and that that is the reason that TextCursor is being used here)? In that case, can we be certain that the linkedCursor
is synchronised with the "original" one? If it's not, I'm afraid that could give quite strange results, couldn't it?
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, this gets called also when changing the property of the "full" text item, without necessarily entering edit mode and therefore having an actual cursor. linkedCursor
is a default-initialized one, it's not actually linked to the present cursor. When editing individual characters things get more complicated and indeed there are still imperfections, but that's a minor case that can (and will) be smoothed out later. The format of the full text works fine as expected
@cbjeukendrup not a blocker. There's a plan to open an issue with a checklist of quirks and refinements as soon as we merge this. Let's add it there and I'll work through it together with with the rest. |
@cbjeukendrup also not a blocker, same thing as previous one. Btw no, for header clefs the "exclude from part/score" checkbox shouldn't be available, and I was sure it wasn't, so I'll have to check what's happening. |
@cbjeukendrup all done! Let's merge soon if we can 👍 |
MeasureBase* scoreMeasure = score->first(); | ||
|
||
if (!scoreMeasure || !scoreMeasure->isVBox()) { | ||
if ((!scoreMeasure || !scoreMeasure->isVBox()) && !masterMeasure->excludeFromOtherParts()) { |
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.
Note: this causes a crash when creating parts for a score that contains no measures nor boxes. Although 4.1.1 also shows some funny behaviour in that situation, it does not crash, so this will be a regression.
(just making a note of it so that we can log/fix it later)
The large diffs are due to: - Increased file version to 4.20 - Introduction of the new property "Exclude from other parts". The property now defaults to true for frames, but we set it to false for frames done pre-4.2 for compatibility.
15737ad
to
6342655
Compare
(a little bit)
6342655
to
64cbb5b
Compare
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.
🥳🥳🥳🥳🥳
@mike-spa I'll leave the honour of pressing the big green button to you! I've already rebased #19127 on top of this; that looks a bit messy now, but it will be alright. The procedure is now as follows:
(Don't wait for me tomorrow morning, I'll probably be late!) |
Resolves: #16544
This PR provides a number of important, long-awaited new functionalities on the interaction between score and parts. A short summary: