Skip to content

Conversation

@miiizen
Copy link
Contributor

@miiizen miiizen commented Dec 11, 2025

Resolves: #31398

This PR makes lyrics lines selectable in the score. Their position can be changed via offset in properties or by dragging. They can be made short or longer without reanchoring the start/end points.
Thickness is also now configurable.

Screen.Recording.2025-12-11.at.16.48.08.mov

@miiizen miiizen requested review from bkunda and mike-spa December 11, 2025 16:49
@miiizen miiizen force-pushed the 31398-editLyricLines branch from fcfa166 to ec2563e Compare December 16, 2025 16:24
@miiizen miiizen added the vtests This PR produces approved changes to vtest results label Dec 17, 2025
Copy link
Contributor

@mike-spa mike-spa left a comment

Choose a reason for hiding this comment

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

Really great job, only minor comments

// This trill is on a cross-staff chord. Don't try to rebase its anchors when dragging.
return;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Good one, thanks for the tidy up

}
}

undoChangeProperty(Pid::GENERATED, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like a slightly weird place to do this, because:

  • I think it's already handled somewhere at a lower level, EngravingObject::undoChangeProperty if I'm not mistaken. In other words any time any property is edited the element is also automatically un-flagged as generated, so I'm not 100% sure this is needed.
  • If it only applies to lyrics lines should it perhaps go there, instead?

if (el->isLyricsLine()) {
LyricsLine* separator = toLyricsLine(el);
m_separator = separator;
score()->addUnmanagedSpanner(separator);
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you actually understood what "unmanaged spanners" are? Cause I never had the time to properly look into it so I really never did 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No not really! We could probably remove this distinction at this point.

void mu::engraving::PartialLyricsLine::setIsEndMelisma(bool val)
{
m_isEndMelisma = val;
styleChanged();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why styleChanged()? It looks a bit unrelated. If it's just about resetting some properties I'd consider doing that directly

initElementStyle(&lyricsLineElementStyle);
setAnchor(Spanner::Anchor::SEGMENT);
m_nextLyrics = 0;
setGenerated(true); // no need to save it, as it can be re-generated
Copy link
Contributor

Choose a reason for hiding this comment

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

GENERATED is also a flag I believe, so you could add the flag to the constructor's arguments instead of setting it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generated needs to be set to true after initElementStyle as any call to undoChangeProperty sets generated to false. The base class constructor where flags are set is called first.

return result;
}

Lyrics* searchNextLyrics(Segment* s, staff_idx_t staffIdx, int verse, PlacementV p)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a big fan of this utils class, as it ends up containing a miscellaneous of things that are completely unrelated to each other, whereas I've always felt that most of these utiliy functions could just be in their related DOM class, perhaps as static functions. But let's rethink about that another time, I've no problem with this staying here for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vtests This PR produces approved changes to vtest results

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make lyric extension lines editable

2 participants