Skip to content

Commit 54d505d

Browse files
authored
Merge pull request #29823 from rettinghaus/xml/symbols
[MusicXML] minor improvements for symbols
2 parents ba8539d + dc9f91d commit 54d505d

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

src/importexport/musicxml/internal/musicxml/export/exportmusicxml.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6147,12 +6147,15 @@ static void directionMarker(XmlWriter& xml, const Marker* const m, const std::ve
61476147
{
61486148
const MarkerType mtp = getEffectiveMarkerType(m, jumps);
61496149
String words;
6150+
String smufl;
61506151
String type;
61516152
String sound;
61526153

61536154
switch (mtp) {
6154-
case MarkerType::CODA:
61556155
case MarkerType::VARCODA:
6156+
smufl = u"codaSquare";
6157+
[[fallthrough]];
6158+
case MarkerType::CODA:
61566159
case MarkerType::CODETTA:
61576160
type = u"coda";
61586161
if (m->label() == "") {
@@ -6161,8 +6164,10 @@ static void directionMarker(XmlWriter& xml, const Marker* const m, const std::ve
61616164
sound = u"coda=\"" + m->label() + u"\"";
61626165
}
61636166
break;
6164-
case MarkerType::SEGNO:
61656167
case MarkerType::VARSEGNO:
6168+
smufl = u"segnoSerpent1";
6169+
[[fallthrough]];
6170+
case MarkerType::SEGNO:
61666171
type = u"segno";
61676172
if (m->label() == "") {
61686173
sound = u"segno=\"1\"";
@@ -6201,6 +6206,9 @@ static void directionMarker(XmlWriter& xml, const Marker* const m, const std::ve
62016206
xml.startElement("direction-type");
62026207
String attrs = color2xml(m);
62036208
attrs += ExportMusicXml::positioningAttributes(m);
6209+
if (!smufl.empty()) {
6210+
attrs += String(u" smufl=\"%1\"").arg(smufl);
6211+
}
62046212
if (!type.empty()) {
62056213
xml.tagRaw(type + attrs);
62066214
}

src/importexport/musicxml/internal/musicxml/import/importmusicxmlpass2.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4026,10 +4026,23 @@ void MusicXmlParserDirection::directionType(std::vector<MusicXmlSpannerDesc>& st
40264026
} else if (m_e.name() == "wedge") {
40274027
wedge(type, n, starts, stops);
40284028
} else if (m_e.name() == "coda") {
4029-
m_wordsText += u"<sym>coda</sym>";
4029+
const String smufl = m_e.attribute("smufl");
4030+
if (!smufl.empty()) {
4031+
m_wordsText += u"<sym>" + smufl + u"</sym>";
4032+
} else {
4033+
m_wordsText += u"<sym>coda</sym>";
4034+
}
40304035
m_e.skipCurrentElement();
40314036
} else if (m_e.name() == "segno") {
4032-
m_wordsText += u"<sym>segno</sym>";
4037+
const String smufl = m_e.attribute("smufl");
4038+
if (!smufl.empty()) {
4039+
m_wordsText += u"<sym>" + smufl + u"</sym>";
4040+
} else {
4041+
m_wordsText += u"<sym>segno</sym>";
4042+
}
4043+
m_e.skipCurrentElement();
4044+
} else if (m_e.name() == "eyeglasses") {
4045+
m_wordsText += u"<sym>miscEyeglasses</sym>";
40334046
m_e.skipCurrentElement();
40344047
} else if (m_e.name() == "symbol") {
40354048
const String smufl = m_e.readText();

0 commit comments

Comments
 (0)