Skip to content

Commit ca8186a

Browse files
committed
Updated PR to add support to regression scenarios
This PR still has an scenario to deal with (testTuplets5.xml). A thread has been opened within this PR to determine how to deal with it
1 parent cfc1a11 commit ca8186a

File tree

4 files changed

+298
-199
lines changed

4 files changed

+298
-199
lines changed

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

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,9 @@ static void resizeTitleBox(VBox* vbox)
10171017
}
10181018
}
10191019

1020-
const auto height = Spatium::fromMM(calculatedVBoxHeight, vbox->spatium());
1021-
if (height > vbox->propertyDefault(Pid::BOX_HEIGHT).value<Spatium>()) {
1022-
vbox->undoChangeProperty(Pid::BOX_HEIGHT, height);
1020+
double heightInSp = calculatedVBoxHeight / vbox->spatium();
1021+
if (heightInSp > vbox->propertyDefault(Pid::BOX_HEIGHT).toDouble()) {
1022+
vbox->undoChangeProperty(Pid::BOX_HEIGHT, heightInSp);
10231023
}
10241024
}
10251025

@@ -2373,9 +2373,6 @@ void MusicXmlParserPass1::partGroup(const int scoreParts,
23732373
if (m_e.readText() == "no") {
23742374
barlineSpan = false;
23752375
}
2376-
} else if (m_e.name() == "group-time") {
2377-
m_score->style().set(Sid::timeSigPlacement, TimeSigPlacement::ACROSS_STAVES);
2378-
m_e.skipCurrentElement(); // skip but don't log
23792376
} else {
23802377
skipLogCurrElem();
23812378
}
@@ -2426,7 +2423,6 @@ void MusicXmlParserPass1::scorePart(const String& curPartGroupName)
24262423
String name = m_e.readText();
24272424
m_parts[id].setName(name);
24282425
} else if (m_e.name() == "part-name-display") {
2429-
m_parts[id].setPrintName(m_e.asciiAttribute("print-object") != "no");
24302426
String name;
24312427
while (m_e.readNextStartElement()) {
24322428
if (m_e.name() == "display-text") {
@@ -2449,7 +2445,6 @@ void MusicXmlParserPass1::scorePart(const String& curPartGroupName)
24492445
String name = m_e.readText();
24502446
m_parts[id].setAbbr(name);
24512447
} else if (m_e.name() == "part-abbreviation-display") {
2452-
m_parts[id].setPrintAbbr(m_e.asciiAttribute("print-object") != "no");
24532448
String name;
24542449
while (m_e.readNextStartElement()) {
24552450
if (m_e.name() == "display-text") {
@@ -2892,7 +2887,6 @@ void MusicXmlParserPass1::measure(const String& partId,
28922887

28932888
// delete tuplets
28942889
nesTuplets.clear();
2895-
28962890
addError(checkAtEndElement(m_e, u"measure"));
28972891
}
28982892

@@ -3330,6 +3324,10 @@ void MusicXmlParserPass1::notations(MusicXmlStartStop& tupletStartStop, unsigned
33303324
tupletsTimeMod.clear();
33313325

33323326
while (m_e.readNextStartElement()) {
3327+
if (m_e.isStartElement()) {
3328+
}
3329+
if (m_e.isEndElement()) {
3330+
}
33333331
if (m_e.name() == "tuplet") {
33343332
String tupletType = m_e.attribute("type");
33353333

@@ -3545,31 +3543,30 @@ void MusicXmlParserPass1::note(const String& partId,
35453543

35463544
if (tupletStartStop == MusicXmlStartStop::START) {
35473545
unsigned int tupletDepth = nestedTupletState.currentTupletDepth();
3548-
Fraction realTimeMod;
3546+
Fraction currentTupletTimeMod;
35493547

35503548
for (unsigned int i = 1; i <= numberOfStartsOrStops; ++i) {
35513549
++tupletDepth;
35523550
nesTuplets[voice][tupletDepth] = tupletsTimeMod[i];
3553-
realTimeMod = nesTuplets[voice][tupletDepth];
3554-
3555-
nestedTupletState.determineTupletAction(mnd.duration(), realTimeMod, tupletStartStop,
3551+
currentTupletTimeMod = nesTuplets[voice][tupletDepth];
3552+
nestedTupletState.determineTupletAction(mnd.duration(), mnd.timeMod(), currentTupletTimeMod, tupletStartStop,
35563553
mnd.normalType(), missingPrev, missingCurr);
35573554
}
35583555
} else if (tupletStartStop == MusicXmlStartStop::STOP) {
35593556
unsigned int tupletDepth;
3560-
Fraction realTimeMod;
3557+
Fraction currentTupletTimeMod;
35613558

35623559
for (unsigned int i = numberOfStartsOrStops; i > 0; --i) {
35633560
tupletDepth = nestedTupletState.currentTupletDepth();
3564-
realTimeMod = nesTuplets[voice][tupletDepth];
3565-
nestedTupletState.determineTupletAction(mnd.duration(), realTimeMod, tupletStartStop,
3561+
currentTupletTimeMod = nesTuplets[voice][tupletDepth];
3562+
nestedTupletState.determineTupletAction(mnd.duration(), mnd.timeMod(), currentTupletTimeMod, tupletStartStop,
35663563
mnd.normalType(), missingPrev, missingCurr);
35673564
}
35683565
} else {
35693566
unsigned int tupletDepth = nestedTupletState.currentTupletDepth();
3570-
Fraction realTimeMod = nesTuplets[voice][tupletDepth];
3571-
nestedTupletState.determineTupletAction(mnd.duration(), realTimeMod, tupletStartStop, mnd.normalType(), missingPrev,
3572-
missingCurr);
3567+
Fraction currentTupletTimeMod = nesTuplets[voice][tupletDepth];
3568+
nestedTupletState.determineTupletAction(mnd.duration(), mnd.timeMod(), currentTupletTimeMod, tupletStartStop,
3569+
mnd.normalType(), missingPrev, missingCurr);
35733570
}
35743571
}
35753572

0 commit comments

Comments
 (0)