Skip to content

Commit

Permalink
Add support for local time signature with parts
Browse files Browse the repository at this point in the history
Resolves: musescore#18089

Backport of musescore#26100, commit 3, TODO
  • Loading branch information
mike-spa authored and Jojo-Schmitz committed Jan 16, 2025
1 parent 9aeb958 commit 5cff234
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 5cff234

Please sign in to comment.