Skip to content
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

[MU3] Fix #314935 - Adding instruments on top of others whose parts have be… #7209

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

njvdberg
Copy link
Contributor

@njvdberg njvdberg commented Jan 9, 2021

Resolves: https://musescore.org/en/node/314935

When adding/removing or changing the order of staves, for all Excerpts the track mapping between Excerpt and masterScore must be updated but the original implementation had some flaws.

  • 1 The rebuild of the mapping was incomplete
  • 2 The rebuild of the mapping was in MuseScore::editInstrList() which also adds/removes staves. However this adding/removing was done via the "undo" mechanism, the rebuild if the mapping was't.

PR #7029 moved the rebuild of the mapping inside the "undo" class SortStaves() which used when the order of the staves was changed.

This PR moves the rebuild of the mapping into a nwe "undo" class MapExcerptTracks() and inside MuseScore::editInstrList() a new instance of the class is created and added to the undo stack. As a result, the mapping will always adapted to the new staff order.

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

…en created leads to fatal corruption.

Rebuild the track mapping of the excerpts after any change in staves list.
@njvdberg njvdberg changed the title Fix #314935 - Adding instruments on top of others whose parts have be… [MU3] Fix #314935 - Adding instruments on top of others whose parts have be… Jan 9, 2021
@vpereverzev vpereverzev merged commit cd2e93e into musescore:3.x Jan 11, 2021
igorkorsukov added a commit to igorkorsukov/MuseScore that referenced this pull request Feb 12, 2021
vpereverzev pushed a commit that referenced this pull request Feb 12, 2021
@njvdberg njvdberg deleted the issue-314935-track-mapping branch March 10, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants