本文整理汇总了C++中MasterScore::undoAddElement方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::undoAddElement方法的具体用法?C++ MasterScore::undoAddElement怎么用?C++ MasterScore::undoAddElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::undoAddElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"));
}
示例2: testAddPart
void TestChordSymbol::testAddPart()
{
MasterScore* score = test_pre("add-part");
Segment* seg = score->firstSegment(Segment::Type::ChordRest);
ChordRest* cr = seg->cr(0);
Harmony* harmony = new Harmony(score);
harmony->setHarmony("C7");
harmony->setTrack(cr->track());
harmony->setParent(cr->segment());
score->undoAddElement(harmony);
score->doLayout();
test_post(score, "add-part");
}
示例3: 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");
}
示例4: testCopy
void TestInstrumentChange::testCopy()
{
MasterScore* score = test_pre("copy");
Measure* m = score->firstMeasure()->nextMeasure();
Segment* s = m->first(Segment::Type::ChordRest);
InstrumentChange* ic = static_cast<InstrumentChange*>(s->annotations()[0]);
m = m->nextMeasure();
s = m->first(Segment::Type::ChordRest);
InstrumentChange* nic = new InstrumentChange(*ic);
nic->setParent(s);
nic->setTrack(4);
score->undoAddElement(nic);
score->doLayout();
test_post(score, "copy");
}