Skip to content

Commit

Permalink
ENG-41: Add space between tempo text and metro
Browse files Browse the repository at this point in the history
Add logic to add a space between the words and the metronome marking,
if there isn't already a space present at the end of the words.
  • Loading branch information
iveshenry18 committed Jun 8, 2021
1 parent 73a589d commit 9353ec6
Show file tree
Hide file tree
Showing 6 changed files with 2,716 additions and 1 deletion.
5 changes: 4 additions & 1 deletion importexport/musicxml/importmxmlpass2.cpp
Expand Up @@ -2472,7 +2472,10 @@ void MusicXMLParserDirection::direction(const QString& partId,
else {
_tpoSound /= 60;
t = new TempoText(_score);
t->setXmlText(_wordsText + _metroText);
QString rawWordsText = _wordsText;
rawWordsText.remove(QRegularExpression("(<.*?>)"));
QString sep = _metroText != "" && _wordsText != "" && rawWordsText.back() != ' ' ? " " : "";
t->setXmlText(_wordsText + sep + _metroText);
((TempoText*) t)->setTempo(_tpoSound);
((TempoText*) t)->setFollowText(true);
_score->setTempo(tick, _tpoSound);
Expand Down

0 comments on commit 9353ec6

Please sign in to comment.