From 5cff23496af7368ed5c795d8c8a0fdf925249b9f Mon Sep 17 00:00:00 2001 From: mike-spa <93707756+mike-spa@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:27:08 +0100 Subject: [PATCH] Add support for local time signature with parts Resolves: #18089 Backport of #26100, commit 3, TODO --- libmscore/edit.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libmscore/edit.cpp b/libmscore/edit.cpp index 8848df6fcdd56..af0f309383ed6 100644 --- a/libmscore/edit.cpp +++ b/libmscore/edit.cpp @@ -605,12 +605,6 @@ bool Score::rewriteMeasures(Measure* fm, const Fraction& ns, int staffIdx) Measure* nm = nullptr; LayoutBreak* sectionBreak = nullptr; - // disable local time sig modifications in linked staves - if (staffIdx != -1 && excerpts().size() > 0) { - MScore::setError(CANNOT_CHANGE_LOCAL_TIMESIG_HAS_EXCERPTS); - return false; - } - // // split into Measure segments fm-lm // @@ -774,10 +768,23 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local) endStaffIdx = startStaffIdx + 1; } else { +#if 1 // TODO: get index for this score qDebug("cmdAddTimeSig: unable to write local time signature change to linked score"); startStaffIdx = 0; endStaffIdx = 0; +#else + const Staff* thisStaff = staff(staffIdx); + const Staff* linkedStaff = thisStaff->findLinkedInScore(score); + if (linkedStaff) { + startStaffIdx = linkedStaff->idx(); + endStaffIdx = startStaffIdx + 1; + } + else { + startStaffIdx = 0; + endStaffIdx = 0; + } +#endif } } else { @@ -909,11 +916,6 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts, bool local) void Score::cmdRemoveTimeSig(TimeSig* ts) { - if (ts->isLocal() && excerpts().size() > 0) { - MScore::setError(CANNOT_CHANGE_LOCAL_TIMESIG_HAS_EXCERPTS); - return; - } - Measure* m = ts->measure(); Segment* s = ts->segment();