Skip to content

Commit

Permalink
fix export part of musescore#15903 for 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lvinken committed Jul 23, 2023
1 parent 59f5aa5 commit 25a27d9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
// TODO LVI 2011-10-30: determine how to report export errors.
// Currently all output (both debug and error reports) are done using qDebug.

#include <iostream>
#include <math.h>
#include "config.h"

Expand Down Expand Up @@ -2026,11 +2027,17 @@ void ExportMusicXml::keysig(const KeySig* ks, ClefType ct, int staff, bool visib
for (const KeySym& ksym : map) {
int line = static_cast<int>(round(2 * ksym.spos.y()));
int step = (po - line) % 7;
//qDebug(" keysym sym %d spos %g,%g pos %g,%g -> line %d step %d",
// ksym.sym, ksym.spos.x(), ksym.spos.y(), ksym.pos.x(), ksym.pos.y(), line, step);
_xml.tag("key-step", QString(QChar(table2[step])));
_xml.tag("key-alter", accSymId2alter(ksym.sym));
_xml.tag("key-accidental", accSymId2MxmlString(ksym.sym));
QString tagName = "key-accidental";
QString s = accSymId2MxmlString(ksym.sym);
//qDebug(" keysym sym %d spos %g,%g pos %g,%g -> line %d step %d s '%s' name '%s'",
// static_cast<int>(ksym.sym), ksym.spos.x(), ksym.spos.y(), ksym.pos.x(), ksym.pos.y(),
// line, step, qPrintable(s), Sym::id2name(ksym.sym));
if (s == "other") {
tagName += QString(" smufl=\"%1\"").arg(Sym::id2name(ksym.sym));
}
_xml.tag(tagName, s);
}
}
else {
Expand Down Expand Up @@ -2313,6 +2320,9 @@ static void writeAccidental(XmlWriter& xml, const QString& tagName, const Accide
QString s = accidentalType2MxmlString(acc->accidentalType());
if (s != "") {
QString tag = tagName;
if (s == "other") {
tag += " smufl=\"" + accidentalType2SmuflMxmlString(acc->accidentalType()) + "\"";
}
if (acc->bracket() != AccidentalBracket::NONE)
tag += " parentheses=\"yes\"";
xml.tag(tag, s);
Expand Down

0 comments on commit 25a27d9

Please sign in to comment.