diff --git a/importexport/musicxml/exportxml.cpp b/importexport/musicxml/exportxml.cpp index 8d6b80fcc514b..d6f42c0a55551 100644 --- a/importexport/musicxml/exportxml.cpp +++ b/importexport/musicxml/exportxml.cpp @@ -1930,6 +1930,10 @@ void ExportMusicXml::timesig(TimeSig* tsig) tagName += " symbol=\"common\""; else if (st == TimeSigType::ALLA_BREVE) tagName += " symbol=\"cut\""; + else if (st == TimeSigType::CUT_BACH) + tagName += " symbol=\"cut2\""; + else if (st == TimeSigType::CUT_TRIPLE) + tagName += " symbol=\"cut3\""; if (!tsig->visible()) tagName += " print-object=\"no\""; tagName += color2xml(tsig); diff --git a/importexport/musicxml/importmxmlpass1.cpp b/importexport/musicxml/importmxmlpass1.cpp index d6ad6e7463391..037d2b974800f 100644 --- a/importexport/musicxml/importmxmlpass1.cpp +++ b/importexport/musicxml/importmxmlpass1.cpp @@ -2392,6 +2392,18 @@ static bool determineTimeSig(MxmlLogger* logger, const QXmlStreamReader* const x btp = 4; return true; } + else if (beats == "2" && beatType == "2" && timeSymbol == "cut2") { + st = TimeSigType::CUT_BACH; + bts = 2; + btp = 2; + return true; + } + else if (beats == "9" && beatType == "8" && timeSymbol == "cut3") { + st = TimeSigType::CUT_TRIPLE; + bts = 9; + btp = 8; + return true; + } else { if (!timeSymbol.isEmpty() && timeSymbol != "normal") { logger->logError(QString("time symbol '%1' not recognized with beats=%2 and beat-type=%3") diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index cabecfdd5d291..415eb0ea0c727 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -3744,6 +3744,18 @@ static bool determineTimeSig(const QString beats, const QString beatType, const btp = 4; return true; } + else if (beats == "2" && beatType == "2" && timeSymbol == "cut2") { + st = TimeSigType::CUT_BACH; + bts = 2; + btp = 2; + return true; + } + else if (beats == "9" && beatType == "8" && timeSymbol == "cut3") { + st = TimeSigType::CUT_TRIPLE; + bts = 9; + btp = 8; + return true; + } else { if (!timeSymbol.isEmpty() && timeSymbol != "normal") { qDebug("determineTimeSig: time symbol <%s> not recognized with beats=%s and beat-type=%s", diff --git a/libmscore/sym.cpp b/libmscore/sym.cpp index e62fd8b39611d..102cbd46f7329 100644 --- a/libmscore/sym.cpp +++ b/libmscore/sym.cpp @@ -5511,12 +5511,12 @@ const std::array Sym::symUserNames = { { "Control character for denominator digit", "Control character for numerator digit", "Time signature comma", - "Common time", + QT_TRANSLATE_NOOP("symUserNames", "Common time"), "Reversed common time", "Turned common time", - "Cut time (Bach)", - "Cut triple time (9/8)", - "Cut time", + QT_TRANSLATE_NOOP("symUserNames", "Cut time (Bach)"), + QT_TRANSLATE_NOOP("symUserNames", "Cut triple time (9/8)"), + QT_TRANSLATE_NOOP("symUserNames", "Cut time"), "Reversed cut time", "Turned cut time", "Time signature equals", diff --git a/libmscore/timesig.cpp b/libmscore/timesig.cpp index 2d763c7224a14..703a70074d674 100644 --- a/libmscore/timesig.cpp +++ b/libmscore/timesig.cpp @@ -310,6 +310,20 @@ void TimeSig::layout() ns.push_back(SymId::timeSigCutCommon); ds.clear(); } + else if (sigType == TimeSigType::CUT_BACH) { + pz = QPointF(0.0, yoff); + setbbox(symBbox(SymId::timeSigCut2).translated(pz)); + ns.clear(); + ns.push_back(SymId::timeSigCut2); + ds.clear(); + } + else if (sigType == TimeSigType::CUT_TRIPLE) { + pz = QPointF(0.0, yoff); + setbbox(symBbox(SymId::timeSigCut3).translated(pz)); + ns.clear(); + ns.push_back(SymId::timeSigCut3); + ds.clear(); + } else { if (_numeratorString.isEmpty()) { ns = toTimeSigString(_numeratorString.isEmpty() ? QString::number(_sig.numerator()) : _numeratorString); @@ -567,10 +581,16 @@ QString TimeSig::accessibleInfo() const QString timeSigString; switch (timeSigType()) { case TimeSigType::FOUR_FOUR: - timeSigString = QObject::tr("Common time"); + timeSigString = qApp->translate("symUserNames", "Common time"); break; case TimeSigType::ALLA_BREVE: - timeSigString = QObject::tr("Cut time"); + timeSigString = qApp->translate("symUserNames", "Cut time"); + break; + case TimeSigType::CUT_BACH: + timeSigString = qApp->translate("symUserNames", "Cut time (Bach)"); + break; + case TimeSigType::CUT_TRIPLE: + timeSigString = qApp->translate("symUserNames", "Cut triple time (9/8)"); break; default: timeSigString = QObject::tr("%1/%2 time").arg(QString::number(numerator()), QString::number(denominator())); diff --git a/libmscore/timesig.h b/libmscore/timesig.h index 3d22d42e3fba2..3666bae5217b7 100644 --- a/libmscore/timesig.h +++ b/libmscore/timesig.h @@ -31,6 +31,8 @@ enum class TimeSigType : char { NORMAL, // use sz/sn text FOUR_FOUR, // common time (4/4) ALLA_BREVE, // cut time (2/2) + CUT_BACH, // cut time (Bach) + CUT_TRIPLE, // cut triple time (9/8) }; //--------------------------------------------------------------------------------------- diff --git a/mscore/menus.cpp b/mscore/menus.cpp index dad02dacde3fb..a2814564864c4 100644 --- a/mscore/menus.cpp +++ b/mscore/menus.cpp @@ -1741,11 +1741,13 @@ PalettePanel* MuseScore::newTimePalettePanel() { 7, 8, TimeSigType::NORMAL, "7/8" }, { 9, 8, TimeSigType::NORMAL, "9/8" }, { 12, 8, TimeSigType::NORMAL, "12/8" }, - { 4, 4, TimeSigType::FOUR_FOUR, QT_TRANSLATE_NOOP("Palette", "4/4 common time") }, - { 2, 2, TimeSigType::ALLA_BREVE, QT_TRANSLATE_NOOP("Palette", "2/2 alla breve") }, + { 4, 4, TimeSigType::FOUR_FOUR, QT_TRANSLATE_NOOP("symUserNames", "Common time") }, + { 2, 2, TimeSigType::ALLA_BREVE, QT_TRANSLATE_NOOP("symUserNames", "Cut time") }, { 2, 2, TimeSigType::NORMAL, "2/2" }, { 3, 2, TimeSigType::NORMAL, "3/2" }, { 4, 2, TimeSigType::NORMAL, "4/2" }, + { 2, 2, TimeSigType::CUT_BACH, QT_TRANSLATE_NOOP("symUserNames", "Cut time (Bach)") }, + { 9, 8, TimeSigType::CUT_TRIPLE, QT_TRANSLATE_NOOP("symUserNames", "Cut triple time (9/8)") }, }; PalettePanel* sp = new PalettePanel(PalettePanel::Type::TimeSig); diff --git a/mscore/timesigproperties.cpp b/mscore/timesigproperties.cpp index d5227ba545153..6798fcf13b19c 100644 --- a/mscore/timesigproperties.cpp +++ b/mscore/timesigproperties.cpp @@ -66,7 +66,7 @@ TimeSigProperties::TimeSigProperties(TimeSig* t, QWidget* parent) zNominal->setEnabled(false); nNominal->setEnabled(false); - // TODO: fix http://musescore.org/en/node/42341 + // TODO: fix https://musescore.org/en/node/42341 // for now, editing of actual (local) time sig is disabled in dialog // but more importantly, the dialog should make it clear that this is "local" change only // and not normally the right way to add 7/4 to a score @@ -82,6 +82,12 @@ TimeSigProperties::TimeSigProperties(TimeSig* t, QWidget* parent) case TimeSigType::ALLA_BREVE: allaBreveButton->setChecked(true); break; + case TimeSigType::CUT_BACH: +// cutBachButton->setChecked(true); +// break; + case TimeSigType::CUT_TRIPLE: +// cutTripleButton->setChecked(true); + break; } // set ID's of other symbols diff --git a/mtest/libmscore/timesig/tst_timesig.cpp b/mtest/libmscore/timesig/tst_timesig.cpp index 7005deb6f9c22..41bbfeb50ca60 100644 --- a/mtest/libmscore/timesig/tst_timesig.cpp +++ b/mtest/libmscore/timesig/tst_timesig.cpp @@ -279,10 +279,16 @@ void TestTimesig::timesig10() ts2->setSig(Fraction(2, 2), TimeSigType::NORMAL); TimeSig* ts3 = new TimeSig(score); ts3->setSig(Fraction(4, 4), TimeSigType::FOUR_FOUR); + //TimeSig* ts4 = new TimeSig(score); + //ts4->setSig(Fraction(2, 2), TimeSigType::CUT_BACH); score->cmdAddTimeSig(m2, 0, ts2, false); m2 = score->firstMeasure()->nextMeasure(); score->cmdAddTimeSig(m2, 0, ts3, false); + //m2 = score->firstMeasure()->nextMeasure(); + //score->cmdAddTimeSig(m2, 0, ts4, false); + //m2 = score->firstMeasure()->nextMeasure(); + //score->cmdAddTimeSig(m2, 0, ts5, false); score->doLayout(); QVERIFY(saveCompareScore(score, "timesig-10.mscx", DIR + "timesig-10-ref.mscx")); @@ -304,11 +310,15 @@ void TestTimesig::timesig_78216() Measure* m1 = score->firstMeasure(); Measure* m2 = m1->nextMeasure(); Measure* m3 = m2->nextMeasure(); + //Measure* m4 = m3->nextMeasure(); + //Measure* m5 = m4->nextMeasure(); // verify no timesig exists in segment of final tick of m1, m2, m3 QVERIFY2(!m1->findSegment(SegmentType::TimeSig, m1->endTick()), "Should be no timesig at the end of measure 1."); QVERIFY2(!m2->findSegment(SegmentType::TimeSig, m2->endTick()), "Should be no timesig at the end of measure 2."); QVERIFY2(!m3->findSegment(SegmentType::TimeSig, m3->endTick()), "Should be no timesig at the end of measure 3."); + //QVERIFY2(!m4->findSegment(SegmentType::TimeSig, m4->endTick()), "Should be no timesig at the end of measure 4."); + //QVERIFY2(!m5->findSegment(SegmentType::TimeSig, m5->endTick()), "Should be no timesig at the end of measure 5."); delete score; } diff --git a/share/workspaces/Advanced.xml b/share/workspaces/Advanced.xml index 5046068669638..8a8c1227d4eaa 100644 --- a/share/workspaces/Advanced.xml +++ b/share/workspaces/Advanced.xml @@ -360,7 +360,7 @@ 8 - + 1 1 @@ -368,7 +368,7 @@ 4 - + 1 2 diff --git a/share/workspaces/Basic.xml b/share/workspaces/Basic.xml index 46d5e90993e2c..e83af516930b6 100644 --- a/share/workspaces/Basic.xml +++ b/share/workspaces/Basic.xml @@ -206,7 +206,7 @@ 8 - + 1 1 @@ -214,7 +214,7 @@ 4 - + 1 2