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

[MU3 Backend] MusicXML compiler warnings #8554

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2973,16 +2973,16 @@ static void writeBeam(XmlWriter& xml, ChordRest* const cr, Beam* const b)
// TODO: correctly handle Beam::Mode::AUTO
// when equivalent to BEGIN32 or BEGIN64
if ((blp < i && bln >= i)
|| bmc == Beam::Mode::BEGIN32 && i > 1
|| bmc == Beam::Mode::BEGIN64 && i > 2)
|| (bmc == Beam::Mode::BEGIN32 && i > 1)
|| (bmc == Beam::Mode::BEGIN64 && i > 2))
text = "begin";
else if (blp < i && bln < i) {
if (bln > 0) text = "forward hook";
else if (blp > 0) text = "backward hook";
}
else if ((blp >= i && bln < i)
|| bmn == Beam::Mode::BEGIN32 && i > 1
|| bmn == Beam::Mode::BEGIN64 && i > 2)
|| (bmn == Beam::Mode::BEGIN32 && i > 1)
|| (bmn == Beam::Mode::BEGIN64 && i > 2))
text = "end";
else if (blp >= i && bln >= i)
text = "continue";
Expand Down
11 changes: 8 additions & 3 deletions importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,11 @@ void MusicXMLParserDirection::direction(const QString& partId,
t = new TempoText(_score);
QString rawWordsText = _wordsText;
rawWordsText.remove(QRegularExpression("(<.*?>)"));
QString sep = _metroText != "" && _wordsText != "" && rawWordsText.back() != ' ' ? " " : "";
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QString sep = _metroText != "" && _wordsText != "" && rawWordsText.back() != ' ' ? " " : "";
#else
QString sep = _metroText != "" && _wordsText != "" && rawWordsText.at(rawWordsText.size() - 1) != ' ' ? " " : "";
#endif
t->setXmlText(_wordsText + sep + _metroText);
if (_tpoSound > 0.1) {
_tpoSound /= 60;
Expand Down Expand Up @@ -2791,9 +2795,10 @@ void MusicXMLParserDirection::direction(const QString& partId,

QString wordsPlacement = placement();
// Case-based defaults
if (wordsPlacement.isEmpty())
if (wordsPlacement.isEmpty()) {
if (isVocalStaff) wordsPlacement = "above";
else if (isExpressionText) wordsPlacement = "below";
}

if (isLikelyFingering()) {
_logger->logDebugInfo(QString("Inferring fingering: %1").arg(_wordsText));
Expand Down Expand Up @@ -5139,7 +5144,7 @@ Note* MusicXMLParserPass2::note(const QString& partId,
else if (_e.name() == "stem")
stem(stemDir, noStem);
else if (_e.name() == "type") {
small = _e.attributes().value("size") == "cue" | _e.attributes().value("size") == "grace-cue";
small = (_e.attributes().value("size") == "cue") || (_e.attributes().value("size") == "grace-cue");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I was suggesting the parenthezise the entire || expression, not their elements

type = _e.readElementText();
}
else if (_e.name() == "voice")
Expand Down