Skip to content

Commit

Permalink
fix #16173: Changing and introducing time signatrues after Inser One …
Browse files Browse the repository at this point in the history
…Measure causes corruption
  • Loading branch information
wschweer committed Jun 27, 2012
1 parent f677cc6 commit 9767fb2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 11,327 deletions.
9 changes: 6 additions & 3 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,19 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts)
Fraction ns = ts->sig();
int tick = fm->tick();
TimeSig* lts = staff(staffIdx)->timeSig(tick);
Fraction stretch, lsig;
Fraction stretch;
Fraction lsig; // last signature
if (lts) {
stretch = lts->stretch();
lsig = lts->sig();
}
else {
stretch.set(1,1);
lsig.set(4,4);
lsig.set(4,4); // set to default
}

int track = staffIdx * VOICES;
Segment* seg = fm->getSegment(SegTimeSig, tick);
Segment* seg = fm->undoGetSegment(SegTimeSig, tick);
TimeSig* ots = static_cast<TimeSig*>(seg->element(track));
if (ots) {
//
Expand All @@ -512,6 +513,7 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts)
return;
}
}
#if 0
else {
//
// check for local timesig (only staff value changes)
Expand All @@ -525,6 +527,7 @@ void Score::cmdAddTimeSig(Measure* fm, int staffIdx, TimeSig* ts)
return;
}
}
#endif
Measure* nfm = fm;
if (ots && ots->sig() == ts->sig() && ots->stretch() == ts->stretch()) {
//
Expand Down
2 changes: 1 addition & 1 deletion libmscore/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void Segment::add(Element* el)
if (_elist[track]) {
qDebug("Segment::add(%s) there is already an %s at %d track %d\n",
el->name(), _elist[track]->name(), tick(), track);
// abort();
abort();
return;
}
if (track % VOICES)
Expand Down
1 change: 1 addition & 0 deletions libmscore/staff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ Fraction Staff::timeStretch(int tick) const

//---------------------------------------------------------
// timeSig
// lookup time signature before or at tick
//---------------------------------------------------------

TimeSig* Staff::timeSig(int tick) const
Expand Down
Loading

0 comments on commit 9767fb2

Please sign in to comment.