[MEI] Import floating objects#33168
Conversation
📝 WalkthroughWalkthroughControl-event anchoring in the MEI importer was changed to use a new 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/importexport/mei/internal/meiimporter.cpp`:
- Around line 628-637: The code sets pos.measure = measure too early so failed
`@startid/`@tstamp lookups appear successful; move the assignment of pos.measure =
measure until after resolving the real position via the startId/tstamp lookup
(i.e., after verifying m_startIdChordRests contains startId and after the
findStart()/tstamp resolution succeeds), and ensure both the `@startid` branch
(use of xmlIdFrom/startId and m_startIdChordRests) and the `@tstamp` branch return
early without setting pos.measure when lookup fails; apply the same fix for the
similar logic around the block at lines 650-651 (so functions like xmlIdFrom and
the code that calls findStart()/addAnnotation/addSpanner only see pos.measure
set when a valid position is found).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 16752a09-e4e1-425c-842b-386e411e2f40
📒 Files selected for processing (2)
src/importexport/mei/internal/meiimporter.cppsrc/importexport/mei/internal/meiimporter.h
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/importexport/mei/internal/meiimporter.cpp`:
- Line 572: The trill handling drops floating `@tstamp` because addToChordRest()
reduces the new ControlElementPosition to a ChordRest* (chordRest), so when
findStart(meiElement, measure) returns only {measure, tick, track} with
chordRest == nullptr, readTrill() bails before creating the floating spanner;
modify addToChordRest() (or add an overload) to preserve and return the full
ControlElementPosition (or nullptr vs valid ControlElementPosition) instead of
only ChordRest*, update callers (including readTrill()) to use the returned
ControlElementPosition from findStart()/addToChordRest() and branch: if
chordRest is present attach to ChordRest, otherwise follow the new
floating-spanner creation path using the preserved ControlElementPosition so
floating `@tstamp` trills are handled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d38b40e2-b5cd-4deb-91d2-e03fb98778e3
📒 Files selected for processing (1)
src/importexport/mei/internal/meiimporter.cpp
This refactors the MEI import for handling
@tstampto also import control objects not connected to chords or rests.pinging @lpugin