feat: clef additional and after-barline in mx::api - #375
Open
rpatters1 wants to merge 1 commit into
Open
Conversation
ClefData::location was read from clef@after-barline but never written. Adds Bool ClefData::additional and maps both attributes in both directions.
webern
approved these changes
Jul 29, 2026
webern
left a comment
Owner
There was a problem hiding this comment.
This one is pretty straightforward and looks good. Easy to approve from the phone. 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human Summary
Add Bool ClefData::additional and map MusicXML's clef@additional in both directions. unspecified (the default) omits the attribute; yes/no are
written verbatim.
Summary
Also fix a write-side gap found while adding it: ClefData::location was
already populated by MeasureReader from clef@after-barline, but
PropertiesWriter never emitted the attribute, so the value was silently
lost on write. afterBarline and beforeBarline now write after-barline
yes/no; unspecified and midMeasure emit nothing, since MusicXML ignores the attribute on mid-measure clefs. Document ClefLocation, which had no comment.
Tests cover yes/no/omitted for both attributes, plus an all-fields
round-trip over ClefData that pins the remaining eight fields. That test
records one deliberate normalization: writeStaffNumber=no on a
single-staff part reads back as unspecified, because the knob records
only a divergence from the automatic rule and the automatic rule already
omits the number there. The emitted XML is identical either way.
data/synthetic/clef.3.0.xml and clef.3.1.xml still fail the api
roundtrip on unmodeled position, font, color, and id attributes, so
neither is pinned. The discovery pass-list is unchanged at 297.