当前位置: 首页>>代码示例>>C++>>正文


C++ MasterScore::firstMeasure方法代码示例

本文整理汇总了C++中MasterScore::firstMeasure方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::firstMeasure方法的具体用法?C++ MasterScore::firstMeasure怎么用?C++ MasterScore::firstMeasure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MasterScore的用法示例。


在下文中一共展示了MasterScore::firstMeasure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: insertBfKeyChange

void TestMeasure::insertBfKeyChange()
      {
      MasterScore* score = readScore(DIR + "measure-insert_bf_key.mscx");
      // 4th measure
      Measure* m = score->firstMeasure()->nextMeasure();
      m = m->nextMeasure()->nextMeasure();
      score->startCmd();
      score->insertMeasure(ElementType::MEASURE, m);
      score->endCmd();
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key.mscx", DIR + "measure-insert_bf_key-ref.mscx"));
      score->undoRedo(true);
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key_undo.mscx", DIR + "measure-insert_bf_key.mscx"));
      m = score->firstMeasure()->nextMeasure()->nextMeasure()->nextMeasure()->nextMeasure()->nextMeasure();
      score->startCmd();
      score->insertMeasure(ElementType::MEASURE, m);
      score->endCmd();
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key-2.mscx", DIR + "measure-insert_bf_key-2-ref.mscx"));
      score->undoRedo(true);
      QVERIFY(score->checkKeys());
      QVERIFY(saveCompareScore(score, "measure-insert_bf_key_undo.mscx", DIR + "measure-insert_bf_key.mscx"));
      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:25,代码来源:tst_measure.cpp

示例2: readScore

void TestSpanners::spanners13()
{
    DropData          dropData;
    LayoutBreak*      brk;

    MasterScore* score = readScore(DIR + "lyricsline06.mscx");
    QVERIFY(score);
    score->doLayout();

    // DROP A BREAK AT FIRST MEASURE AND VERIFY
    Measure*    msr   = score->firstMeasure();
    QVERIFY(msr);
    brk               = new LayoutBreak(score);
    brk->setLayoutBreakType(LayoutBreak::Type::LINE);
    dropData.pos      = msr->pagePos();
    dropData.element  = brk;
    score->startCmd();
    msr->drop(dropData);
    score->endCmd();
    // VERIFY SEGMENTS IN SYSTEMS AND THEN SCORE
    for (System* sys : score->systems())
        QVERIFY(sys->spannerSegments().size() == 1);
    QVERIFY(saveCompareScore(score, "lyricsline06.mscx", DIR + "lyricsline06-ref.mscx"));

    // UNDO AND VERIFY
    score->undoStack()->undo();
    score->doLayout();      // systems need to be re-computed
    QVERIFY(saveCompareScore(score, "lyricsline06.mscx", DIR + "lyricsline06.mscx"));
    delete score;
}
开发者ID:sidewayss,项目名称:MuseScore,代码行数:30,代码来源:tst_spanners.cpp

示例3: undoSlashFill

void TestTools::undoSlashFill()
{
    QString readFile(DIR + "undoSlashFill.mscx");
    QString writeFile1("undoSlashFill01-test.mscx");
    QString reference1(DIR  + "undoSlashFill01-ref.mscx");
    QString writeFile2("undoSlashFill02-test.mscx");
    QString reference2(DIR  + "undoSlashFill02-ref.mscx");

    MasterScore* score = readScore(readFile);

    // select
    Segment* s = score->firstMeasure()->findSegment(Segment::Type::ChordRest, MScore::division * 2);
    score->selection().setRange(s, score->lastSegment(), 0, 2);

    // do
    score->startCmd();
    score->cmdSlashFill();
    score->endCmd();
    QVERIFY(saveCompareScore(score, writeFile1, reference1));

    // undo
    score->undoStack()->undo();
    QVERIFY(saveCompareScore(score, writeFile2, reference2));

    delete score;
}
开发者ID:ericfont,项目名称:MuseScore,代码行数:26,代码来源:tst_tools.cpp

示例4: checkMeasure

void TestMeasure::checkMeasure()
      {
      MasterScore* score = readScore(DIR + "checkMeasure.mscx");
      Element* tst       = 0;
      Measure* m         = score->firstMeasure()->nextMeasure();

      Segment* s = m->undoGetSegment(Segment::Type::ChordRest, 2880);
      tst = s->element(1);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap() && toRest(tst)->actualTicks() == 480/*&& toRest(tst)->durationType() == TDuration::DurationType::V_HALF*/);

      m = m->nextMeasure();
//      s = m->undoGetSegment(Segment::Type::ChordRest, 3840);
//      tst = s->element(2);
//      Q_ASSERT(tst);

//      QVERIFY(tst->isRest() && toRest(tst)->isGap() && toRest(tst)->actualTicks() == 480/*&& toRest(tst)->durationType() == TDuration::DurationType::V_HALF*/);

      m = m->nextMeasure();
      s = m->undoGetSegment(Segment::Type::ChordRest, 6240);
      tst = s->element(1);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap() && toRest(tst)->actualTicks() == 120/*&& toRest(tst)->durationType() == TDuration::DurationType::V_HALF*/);

      s = m->undoGetSegment(Segment::Type::ChordRest, 6480);
      tst = s->element(1);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap() && toRest(tst)->actualTicks() == 120/*&& toRest(tst)->durationType() == TDuration::DurationType::V_HALF*/);

      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:34,代码来源:tst_measure.cpp

示例5: quarter

void TestMeasure::undoDelInitialVBox_269919()
      {
      MasterScore* score = readScore(DIR + "undoDelInitialVBox_269919.mscx");

      // 1. delete initial VBox
      score->startCmd();
      MeasureBase* initialVBox = score->measure(0);
      score->select(initialVBox);
      score->cmdDeleteSelection();
      score->endCmd();

      // 2. change duration of first chordrest
      score->startCmd();
      Measure* m = score->firstMeasure();
      ChordRest* cr = m->findChordRest(Fraction(0,1), 0);
      Fraction quarter(4, 1);
      score->changeCRlen(cr, quarter);
      score->endCmd();

      // 3. Undo to restore first chordrest
      score->undoRedo(true, 0);

      // 4. Undo to restore initial VBox resulted in assert failure crash
      score->undoRedo(true, 0);

      QVERIFY(saveCompareScore(score, "undoDelInitialVBox_269919.mscx", DIR + "undoDelInitialVBox_269919-ref.mscx"));
      delete score;
      }
开发者ID:wschweer,项目名称:MuseScore,代码行数:28,代码来源:tst_measure.cpp

示例6: testClear

void TestChordSymbol::testClear()
      {
      MasterScore* score = test_pre("clear");
      Measure* m = score->firstMeasure();
      score->select(m, SelectType::SINGLE, 0);
      score->cmdDeleteSelection();
      score->doLayout();
      test_post(score, "clear");
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:9,代码来源:tst_chordsymbol.cpp

示例7: testExtend

void TestChordSymbol::testExtend()
      {
      MasterScore* score = test_pre("extend");
      Measure* m = score->firstMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      ChordRest* cr = s->cr(0);
      score->changeCRlen(cr, TDuration::DurationType::V_WHOLE);
      score->doLayout();
      test_post(score, "extend");
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:10,代码来源:tst_chordsymbol.cpp

示例8: testDelete

void TestInstrumentChange::testDelete()
      {
      MasterScore* score = test_pre("delete");
      Measure* m = score->firstMeasure()->nextMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      InstrumentChange* ic = toInstrumentChange(s->annotations()[0]);
      score->deleteItem(ic);
      score->doLayout();
      test_post(score, "delete");
      }
开发者ID:AntonioBL,项目名称:MuseScore,代码行数:10,代码来源:tst_instrumentchange.cpp

示例9: spanner_b

void TestMeasure::spanner_b()
      {
      MasterScore* score = readScore(DIR + "measure-4.mscx");

      Measure* m = score->firstMeasure();
      score->startCmd();
      score->insertMeasure(ElementType::MEASURE, m);
      score->endCmd();
      QVERIFY(saveCompareScore(score, "measure-5.mscx", DIR + "measure-5-ref.mscx"));
      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:11,代码来源:tst_measure.cpp

示例10: spanner_A

void TestMeasure::spanner_A()
      {
      MasterScore* score = readScore(DIR + "measure-6.mscx");

      score->select(score->firstMeasure());
      score->startCmd();
      score->localTimeDelete();
      score->endCmd();
      score->doLayout();
      QVERIFY(saveCompareScore(score, "measure-6.mscx", DIR + "measure-6-ref.mscx"));
      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:12,代码来源:tst_measure.cpp

示例11: insertMeasureBegin

void TestMeasure::insertMeasureBegin()
      {
      MasterScore* score = readScore(DIR + "measure-1.mscx");

      score->startCmd();
      Measure* m = score->firstMeasure();
      score->insertMeasure(Element::Type::MEASURE, m);
      score->endCmd();
      QVERIFY(saveCompareScore(score, "measure-2.mscx", DIR + "measure-2-ref.mscx"));

      delete score;
      }
开发者ID:sidewayss,项目名称:MuseScore,代码行数:12,代码来源:tst_measure.cpp

示例12: gap

void TestMeasure::gap()
      {
      MasterScore* score = readScore(DIR + "gaps.mscx");
      Element* tst       = 0;

      //Select and delete third quarter rest in first Measure (voice 2)
      score->startCmd();
      Measure* m  = score->firstMeasure();
      Segment* s  = m->undoGetSegment(SegmentType::ChordRest, Fraction::fromTicks(960));
      Element* el = s->element(1);
      score->select(el);
      score->cmdDeleteSelection();
      score->endCmd();

      tst = s->element(1);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap() /*&& toRest(tst)->durationType() == TDuration::DurationType::V_QUARTER*/);

      //Select and delete second quarter rest in third Measure (voice 4)
      score->startCmd();
      m  = m->nextMeasure()->nextMeasure();
      s  = m->undoGetSegment(SegmentType::ChordRest, Fraction::fromTicks(4320));
      el = s->element(3);
      score->select(el);
      score->cmdDeleteSelection();
      score->endCmd();

      tst = s->element(3);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap() /*&& toRest(tst)->durationType() == TDuration::DurationType::V_QUARTER*/);

      //Select and delete first quarter rest in third Measure (voice 4)
      score->startCmd();
      s  = m->undoGetSegment(SegmentType::ChordRest, Fraction::fromTicks(3840));
      el = s->element(3);
      score->select(el);
      score->cmdDeleteSelection();
      score->endCmd();

      tst = s->element(3);
      Q_ASSERT(tst);

      QVERIFY(tst->isRest() && toRest(tst)->isGap()
         && toRest(tst)->actualTicks() == Fraction::fromTicks(960)
         /*&& toRest(tst)->durationType() == TDuration::DurationType::V_HALF*/
         );


      delete score;
      }
开发者ID:wschweer,项目名称:MuseScore,代码行数:52,代码来源:tst_measure.cpp

示例13: testAdd

void TestInstrumentChange::testAdd()
      {
      MasterScore* score = test_pre("add");
      Measure* m = score->firstMeasure()->nextMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      InstrumentChange* ic = new InstrumentChange(score);
      ic->setParent(s);
      ic->setTrack(0);
      ic->setXmlText("Instrument");
      score->undoAddElement(ic);
      score->doLayout();
      test_post(score, "add");
      }
开发者ID:AntonioBL,项目名称:MuseScore,代码行数:13,代码来源:tst_instrumentchange.cpp

示例14: readScore

void TestKeySig::keysig_78216()
      {
      MasterScore* score = readScore(DIR + "keysig_78216.mscx");

      Measure* m1 = score->firstMeasure();
      Measure* m2 = m1->nextMeasure();
      Measure* m3 = m2->nextMeasure();

      // verify no keysig exists in segment of final tick of m1, m2, m3
      QVERIFY2(m1->findSegment(SegmentType::KeySig, m1->endTick()) == nullptr, "Should be no keysig at end of measure 1.");
      QVERIFY2(m2->findSegment(SegmentType::KeySig, m2->endTick()) == nullptr, "Should be no keysig at end of measure 2.");
      QVERIFY2(m3->findSegment(SegmentType::KeySig, m3->endTick()) == nullptr, "Should be no keysig at end of measure 3.");
      }
开发者ID:IsaacWeiss,项目名称:MuseScore,代码行数:13,代码来源:tst_keysig.cpp

示例15: spanner_C

void TestMeasure::spanner_C()
      {
      MasterScore* score = readScore(DIR + "measure-8.mscx");

      Measure* m = score->firstMeasure()->nextMeasure();
      score->select(m);
      score->startCmd();
      score->localTimeDelete();
      score->endCmd();

      QVERIFY(saveCompareScore(score, "measure-8.mscx", DIR + "measure-8-ref.mscx"));
      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:13,代码来源:tst_measure.cpp


注:本文中的MasterScore::firstMeasure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。