本文整理汇总了C++中MasterScore::setGraceNote方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::setGraceNote方法的具体用法?C++ MasterScore::setGraceNote怎么用?C++ MasterScore::setGraceNote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::setGraceNote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: grace
void TestNote::grace()
{
MasterScore* score = readScore(DIR + "grace.mscx");
score->doLayout();
Ms::Chord* chord = score->firstMeasure()->findChord(0, 0);
Note* note = chord->upNote();
// create
score->setGraceNote(chord, note->pitch(), NoteType::APPOGGIATURA, MScore::division/2);
Ms::Chord* gc = chord->graceNotes().first();
Note* gn = gc->notes().front();
// Note* n = static_cast<Note*>(writeReadElement(gn));
// QCOMPARE(n->noteType(), NoteType::APPOGGIATURA);
// delete n;
// tie
score->select(gn);
score->cmdAddTie();
// n = static_cast<Note*>(writeReadElement(gn));
// QVERIFY(n->tieFor() != 0);
// delete n;
// tremolo
score->startCmd();
Tremolo* tr = new Tremolo(score);
tr->setTremoloType(TremoloType::R16);
tr->setParent(gc);
tr->setTrack(gc->track());
score->undoAddElement(tr);
score->endCmd();
// Ms::Chord* c = static_cast<Ms::Chord*>(writeReadElement(gc));
// QVERIFY(c->tremolo() != 0);
// delete c;
// articulation
score->startCmd();
Articulation* ar = new Articulation(SymId::articAccentAbove, score);
ar->setParent(gc);
ar->setTrack(gc->track());
score->undoAddElement(ar);
score->endCmd();
// c = static_cast<Ms::Chord*>(writeReadElement(gc));
// QVERIFY(c->articulations().size() == 1);
// delete c;
QVERIFY(saveCompareScore(score, "grace-test.mscx", DIR + "grace-ref.mscx"));
}