Skip to content

Commit

Permalink
Fix the base note automation fix (LMMS#6828)
Browse files Browse the repository at this point in the history
Towards the end of the development for the fix of LMMS#6548 (via LMMS#6725) the upgrade code was refactored into its own class. While doing so it was forgotten to actually call the `upgrade` method on the `UpgradeExtendedNoteRange` instance. As a result almost all files should currently open in a wrong state with many instruments transposed. This commit fixes this.

Also explicitly check the assertion that BB tracks do not contain other BB tracks.
  • Loading branch information
michaelgregorius committed Aug 27, 2023
1 parent fc2f6a0 commit 4cb09e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/DataFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,8 @@ void DataFile::upgrade_extendedNoteRange()
{
auto root = documentElement();
UpgradeExtendedNoteRange upgradeExtendedNoteRange(root);

upgradeExtendedNoteRange.upgrade();
}


Expand Down
1 change: 1 addition & 0 deletions src/core/UpgradeExtendedNoteRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static void fixTrack(QDomElement & track, std::set<unsigned int> & automatedBase
for (int i = 0; i < subTracks.size(); ++i)
{
QDomElement subTrack = subTracks.item(i).toElement();
assert (static_cast<Track::Type>(subTrack.attribute("type").toInt()) != Track::Type::Pattern);
fixTrack(subTrack, automatedBaseNoteIds);
}
}
Expand Down

0 comments on commit 4cb09e2

Please sign in to comment.