Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #22622: Partial fix, export barlines subtypes #2499

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion mscore/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4839,6 +4839,62 @@ void ExportMusicXml::writeElement(Element* el, const Measure* m, int sstaff, boo
// TODO: print barline only if middle
// if (el->subtype() != BarLineType::START_REPEAT)
// bar((BarLine*) el);

if(el->parent()==m->last()){
const Measure* mmR1 = m->mmRest1(); // the multi measure rest this measure is covered by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indent by 6 spaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

const Measure* mmRLst = mmR1->isMMRest() ? mmR1->mmRestLast() : 0; // last measure of replaced sequence of empty measures
// note: use barlinetype as found in multi measure rest for last measure of replaced sequence
BarLineType bst = m == mmRLst ? mmR1->endBarLineType() : m->endBarLineType();
BarLine* bl = static_cast<BarLine*>(el);
if(bl->customSubtype())
bst= bl->barLineType();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

bool visible = m->endBarLineVisible();
bool needBarStyle = (bst != BarLineType::NORMAL && bst != BarLineType::START_REPEAT) || !visible;
Measure* temp= const_cast<Measure*>(m);
Volta* volta = findVolta(temp, false);

if (!needBarStyle && !volta)
break;
xml.stag(QString("barline location=\"right\""));
if (needBarStyle) {
if (!visible) {
xml.tag("bar-style", QString("none"));
} else {
switch (bst) {
case BarLineType::DOUBLE:
xml.tag("bar-style", QString("light-light"));
break;
case BarLineType::END_REPEAT:
xml.tag("bar-style", QString("light-heavy"));
break;
case BarLineType::BROKEN:
xml.tag("bar-style", QString("dashed"));
break;
case BarLineType::DOTTED:
xml.tag("bar-style", QString("dotted"));
break;
case BarLineType::END:
case BarLineType::END_START_REPEAT:
xml.tag("bar-style", QString("light-heavy"));
break;
default:
qDebug("ExportMusicXml::bar(): bar subtype %d not supported", int(bst));
break;
}
}
}
if (volta)
ending(xml, volta, false);
if (bst == BarLineType::END_REPEAT || bst == BarLineType::END_START_REPEAT)
{
if (m->repeatCount() > 2) {
xml.tagE(QString("repeat direction=\"backward\" times=\"%1\"").arg(m->repeatCount()));
} else {
xml.tagE("repeat direction=\"backward\"");
}
}
xml.etag();
}
break;
case Element::Type::BREATH:
// ignore, already exported as note articulation
Expand Down Expand Up @@ -5102,6 +5158,7 @@ void ExportMusicXml::write(QIODevice* dev)
spannerStart(this, strack, etrack, st, sstaff, seg);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace damage

// write element el if necessary
writeElement(el, m, sstaff, part->instrument()->useDrumset());

Expand All @@ -5123,7 +5180,8 @@ void ExportMusicXml::write(QIODevice* dev)
repeatAtMeasureStop(xml, m, strack, etrack, strack);
// note: don't use "m->repeatFlags() & Repeat::END" here, because more
// barline types need to be handled besides repeat end ("light-heavy")
barlineRight(m);
//barlineRight(m);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

xml.etag();
}
staffCount += staves;
Expand Down Expand Up @@ -5392,3 +5450,4 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd

}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto