gp-import: creating groups of brackets for chord#33614
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds createGhostNoteParenGroups(Chord*) to detect contiguous ghost-note runs and attach paired left/right parentheses via the engraving Factory, marks notes with HAS_PARENTHESES, and hides generated parentheses. Integrates this utility into GPConverter::convertNotes and GuitarPro5::readBeat (called after chord sorting). Updates GP/GPX test reference files to include hideGeneratedParentheses=1 on affected ghost Note elements. 🚥 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/importexport/guitarpro/internal/importgtp-gp5.cpp`:
- Around line 390-394: cr may be nullptr after the note cleanup, so avoid
dereferencing it; change the block that currently does if (cr->isChord()) {
Chord* chord = toChord(cr); chord->sortNotes();
mu::iex::guitarpro::utils::createGhostNoteParenGroups(chord); } to first check
cr for null (e.g. if (cr && cr->isChord()) { ... }) or otherwise return/skip
when cr == nullptr so toChord(), chord->sortNotes(), and
createGhostNoteParenGroups() are only called on a valid Chord pointer.
In `@src/importexport/guitarpro/internal/utils.cpp`:
- Line 145: There is an extra blank line / codestyle violation in the insertion
around the function addParenthesesToNotes; run the project's uncrustify (or
code-style) script on src/importexport/guitarpro/internal/utils.cpp, fix the
blank-line/codestyle around the static void addParenthesesToNotes(Chord* ch,
const std::vector<Note*>& notes) block, and amend the commit so the file passes
checkcodestyle.
🪄 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: CHILL
Plan: Pro
Run ID: 5baeeb3a-f218-40a0-aab3-45424ed2d4ff
📒 Files selected for processing (6)
src/importexport/guitarpro/internal/gtp/gpconverter.cppsrc/importexport/guitarpro/internal/importgtp-gp5.cppsrc/importexport/guitarpro/internal/utils.cppsrc/importexport/guitarpro/internal/utils.hsrc/importexport/guitarpro/tests/data/ghost-note.gp-ref.mscxsrc/importexport/guitarpro/tests/data/ghost-note.gpx-ref.mscx
b409255 to
1332ca6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/importexport/guitarpro/internal/utils.cpp`:
- Around line 146-157: The addParenthesesToNotes function currently always
appends a new NoteParenthesisInfo to a Chord, causing duplicate ghost-note
parentheses on reprocessing; modify addParenthesesToNotes (and the analogous
block used at lines 165-176) to first remove or skip any existing
NoteParenthesisInfo entries that were generated for the same set of Notes before
creating and adding a new one: fetch existing NoteParenthesisInfo objects from
the Chord (via ch->noteParenthesisInfo or equivalent accessor), compare their
note lists with the incoming notes (or mark generated entries with a flag),
remove matching/previously-generated entries from the chord (or return early if
already present), then create the two Parenthesis objects and add the new
NoteParenthesisInfo via ch->addNoteParenthesisInfo only when no duplicate
exists.
🪄 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: CHILL
Plan: Pro
Run ID: 72c76da2-b309-4544-8142-198fc3580ced
📒 Files selected for processing (6)
src/importexport/guitarpro/internal/gtp/gpconverter.cppsrc/importexport/guitarpro/internal/importgtp-gp5.cppsrc/importexport/guitarpro/internal/utils.cppsrc/importexport/guitarpro/internal/utils.hsrc/importexport/guitarpro/tests/data/ghost-note.gp-ref.mscxsrc/importexport/guitarpro/tests/data/ghost-note.gpx-ref.mscx
✅ Files skipped from review due to trivial changes (1)
- src/importexport/guitarpro/tests/data/ghost-note.gp-ref.mscx
🚧 Files skipped from review as they are similar to previous changes (3)
- src/importexport/guitarpro/internal/gtp/gpconverter.cpp
- src/importexport/guitarpro/internal/importgtp-gp5.cpp
- src/importexport/guitarpro/internal/utils.h
1332ca6 to
f785cf9
Compare
|
Actionable comments posted: 0 |
grouping notes by brackets during guitar pro import