Skip to content

Commit

Permalink
fix #240166: Barlines extend over multiple staves by adding a staff/s…
Browse files Browse the repository at this point in the history
…tave to an instrument
  • Loading branch information
wschweer committed Aug 4, 2017
1 parent b889608 commit e65a269
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 28 deletions.
25 changes: 3 additions & 22 deletions libmscore/instrtemplate.cpp
Expand Up @@ -132,7 +132,7 @@ InstrumentTemplate::InstrumentTemplate()
smallStaff[i] = false;
bracket[i] = BracketType::NO_BRACKET;
bracketSpan[i] = 0;
barlineSpan[i] = 0;
barlineSpan[i] = false;
}
transpose.diatonic = 0;
transpose.chromatic = 0;
Expand Down Expand Up @@ -340,8 +340,8 @@ void InstrumentTemplate::read(XmlReader& e)
else if (tag == "staves") {
staves = e.readInt();
bracketSpan[0] = staves;
for (int i = 0; i < staves-1; ++i)
barlineSpan[i] = true;
// for (int i = 0; i < staves-1; ++i)
// barlineSpan[i] = true;
}
else if (tag == "clef") { // sets both transposing and concert clef
int idx = readStaffIdx(e);
Expand Down Expand Up @@ -474,25 +474,6 @@ void InstrumentTemplate::read(XmlReader& e)
else
e.unknown();
}
//
// check bar line spans
//
int barLine = 0;
for (int i = 0; i < staves; ++i) {
int bls = barlineSpan[i];
if (barLine) {
if (bls)
barlineSpan[i] = 0;
}
else {
if (bls == 0) {
bls = 1;
barlineSpan[i] = 1;
}
barLine = bls;
}
--barLine;
}
if (channel.empty()) {
Channel a;
a.chorus = 0;
Expand Down
1 change: 0 additions & 1 deletion libmscore/score.cpp
Expand Up @@ -3388,7 +3388,6 @@ void Score::appendPart(const QString& name)
}
undoInsertStaff(staff, i);
}

part->staves()->front()->setBarLineSpan(part->nstaves());
undoInsertPart(part, n);
fixTicks();
Expand Down
3 changes: 0 additions & 3 deletions mscore/instrdialog.cpp
Expand Up @@ -286,8 +286,6 @@ void MuseScore::editInstrList()
linked.append(staff);
}
}
if (linked.size() == 0)
part->staves()->front()->setBarLineSpan(part->nstaves());

//insert keysigs
int sidx = masterScore->staffIdx(part);
Expand Down Expand Up @@ -324,7 +322,6 @@ void MuseScore::editInstrList()

Staff* linkedStaff = 0;
if (sli->linked()) {

if (rstaff > 0)
linkedStaff = part->staves()->front();
else {
Expand Down
5 changes: 3 additions & 2 deletions mscore/instrwidget.cpp
Expand Up @@ -984,7 +984,7 @@ void InstrumentsWidget::createInstruments(Score* cs)
}
// if a staff was removed from instrument:
if (part->staff(0)->barLineSpan() > rstaff) {
part->staff(0)->setBarLineSpan(rstaff);
//TODO part->staff(0)->setBarLineSpan(rstaff);
part->staff(0)->setBracketType(0, BracketType::NO_BRACKET);
}

Expand All @@ -996,6 +996,7 @@ void InstrumentsWidget::createInstruments(Score* cs)
m->cmdAddStaves(sidx, eidx, true);
staffIdx += rstaff;
}
#if 0 // TODO
//
// check for bar lines
//
Expand All @@ -1014,7 +1015,7 @@ void InstrumentsWidget::createInstruments(Score* cs)

staffIdx = nstaffIdx;
}

#endif
cs->setLayoutAll();
}

Expand Down

0 comments on commit e65a269

Please sign in to comment.