fix for mmrest + start repeat

This commit is contained in:
ws 2014-10-10 14:24:37 +02:00
parent 9b8c7c67ee
commit 986f35d149
3 changed files with 19 additions and 14 deletions

View file

@ -200,6 +200,7 @@ void ChordRest::writeProperties(Xml& xml) const
if (!duration().isZero() && (!actualDurationType().fraction().isValid()
|| (actualDurationType().fraction() != duration())))
xml.fTag("duration", duration());
foreach(const Articulation* a, _articulations)
a->write(xml);
#ifndef NDEBUG

View file

@ -1805,19 +1805,23 @@ void Measure::read(XmlReader& e, int staffIdx)
barLine->read(e);
Segment::Type st;
if (isMMRest()) {
// to find out the right segment type
setTick(e.lastMeasure()->tick());
e.initTick(e.lastMeasure()->tick());
}
//
// SegStartRepeatBarLine: always at the beginning tick of a measure
// SegBarLine: in the middle of a measure, has no semantic
// SegEndBarLine: at the end tick of a measure
if ((e.tick() != tick()) && (e.tick() != endTick())) {
if ((e.tick() != tick()) && (e.tick() != endTick()))
st = Segment::Type::BarLine;
}
else if (barLine->barLineType() == BarLineType::START_REPEAT && e.tick() == tick())
st = Segment::Type::StartRepeatBarLine;
else {
else
st = Segment::Type::EndBarLine;
}
segment = getSegment(st, e.tick()); // let the bar line know it belongs to a Segment,
segment->add(barLine); // before setting its flags
if (st == Segment::Type::EndBarLine) {
@ -1829,16 +1833,6 @@ void Measure::read(XmlReader& e, int staffIdx)
barLine->setSpanFrom(staff->barLineFrom());
barLine->setSpanTo(staff->barLineTo());
}
if (isMMRest()) {
// this is a multi measure rest
// always preceded by the first measure it replaces
Measure* m = e.lastMeasure();
Q_ASSERT(m); // debug
if (m) {
m->setMMRest(this);
setTick(m->tick());
}
}
}
}
else if (tag == "Chord") {

View file

@ -260,6 +260,16 @@ void Score::readStaff(XmlReader& e)
e.setLastMeasure(measure);
e.initTick(measure->tick() + measure->ticks());
}
else {
// this is a multi measure rest
// always preceded by the first measure it replaces
Measure* m = e.lastMeasure();
if (m) {
m->setMMRest(measure);
measure->setTick(m->tick());
}
}
}
else if (tag == "HBox" || tag == "VBox" || tag == "TBox" || tag == "FBox") {
MeasureBase* mb = static_cast<MeasureBase*>(Element::name2Element(tag, this));