From 4cb09e2b6058155efc9920ea09a973071ce1c58e Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 27 Aug 2023 18:21:38 +0200 Subject: [PATCH] Fix the base note automation fix (#6828) Towards the end of the development for the fix of #6548 (via #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. --- src/core/DataFile.cpp | 2 ++ src/core/UpgradeExtendedNoteRange.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 6ad2f8526..5c98ec81c 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -1671,6 +1671,8 @@ void DataFile::upgrade_extendedNoteRange() { auto root = documentElement(); UpgradeExtendedNoteRange upgradeExtendedNoteRange(root); + + upgradeExtendedNoteRange.upgrade(); } diff --git a/src/core/UpgradeExtendedNoteRange.cpp b/src/core/UpgradeExtendedNoteRange.cpp index e61da3723..6ed98e63e 100644 --- a/src/core/UpgradeExtendedNoteRange.cpp +++ b/src/core/UpgradeExtendedNoteRange.cpp @@ -193,6 +193,7 @@ static void fixTrack(QDomElement & track, std::set & automatedBase for (int i = 0; i < subTracks.size(); ++i) { QDomElement subTrack = subTracks.item(i).toElement(); + assert (static_cast(subTrack.attribute("type").toInt()) != Track::Type::Pattern); fixTrack(subTrack, automatedBaseNoteIds); } }