From 67c12d395853135c3739f393fa8bc469606c5d56 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Wed, 19 Jun 2024 12:06:22 +0200 Subject: [PATCH] Update importmxmlpass2.cpp --- importexport/musicxml/importmxmlpass2.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index e6a6ad3c1a22e..a51648af18642 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -3879,12 +3879,20 @@ void MusicXMLParserDirection::textToDynamic(QString& text) const } } } - for (auto dyn : dynList) { - if (dyn.tag == simplifiedText) { - text = text.replace(simplifiedText, dyn.text); - break; +#if 0 + // We don't want to count a single 'm', 'r', 's' or 'z' as a whole dynamic + static const QRegularExpression singleCharDynamic("^[mrsz]$"); + // try to find a dynamic - xml representation or + // if found add to dynamics list and set text to blank string + if (!simplifiedText.contains(singleCharDynamic) && TConv::dynamicValid(simplifiedText.toStdString())) { + Dynamic::Type dt = TConv::fromXml(simplifiedText.toStdString(), Dynamic::Type::OTHER); + if (dt != Dynamic::Type::OTHER) { + _dynaVelocity = QString::number(round(Dynamic::dynamicVelocity(dt) / 0.9)); + _dynamicsList.push_back(Dynamic::dynamicTypeName(dt)); + text.clear(); } } +#endif } //---------------------------------------------------------