本文整理汇总了C++中Sheet::addBar方法的典型用法代码示例。如果您正苦于以下问题:C++ Sheet::addBar方法的具体用法?C++ Sheet::addBar怎么用?C++ Sheet::addBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sheet
的用法示例。
在下文中一共展示了Sheet::addBar方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testNotePitch
void testNotePitch()
{
Sheet* sheet = new Sheet();
Bar* bar = sheet->addBar();
Part* part = sheet->addPart("part");
Voice* voice = part->addVoice();
Staff* staff = part->addStaff();
VoiceBar* vb = bar->voice(voice);
for (int p = -20; p <= 20; p++) {
Chord* c = new Chord(QuarterNote);
c->addNote(staff, p);
vb->addElement(c);
}
validateOutput(sheet, "notepitch.xml");
delete sheet;
}
示例2: testNoteAccidentals
void testNoteAccidentals()
{
Sheet* sheet = new Sheet();
Bar* bar = sheet->addBar();
Part* part = sheet->addPart("part");
Voice* voice = part->addVoice();
Staff* staff = part->addStaff();
VoiceBar* vb = bar->voice(voice);
for (int a = -2; a <= 2; a++) {
Chord* c = new Chord(QuarterNote);
c->addNote(staff, 0, a);
vb->addElement(c);
}
validateOutput(sheet, "noteaccidentals.xml");
delete sheet;
}
示例3: testNestedPartGroups
void testNestedPartGroups()
{
Sheet* sheet = new Sheet();
sheet->addBar();
for (int i = 0; i < 7; i++) {
sheet->addPart(QString("part %1").arg(i));
}
sheet->addPartGroup(0, 1)->setName("group 1");
sheet->addPartGroup(1, 2)->setName("group 2");
sheet->addPartGroup(2, 3)->setName("group 3");
sheet->addPartGroup(0, 6)->setName("group 4");
sheet->addPartGroup(4, 5)->setName("group 5");
sheet->addPartGroup(4, 5)->setName("group 6");
validateOutput(sheet, "nestedpartgroups.xml");
delete sheet;
}
示例4: testNoteDurations
void testNoteDurations()
{
Sheet* sheet = new Sheet();
Bar* bar = sheet->addBar();
Part* part = sheet->addPart("part");
Voice* voice = part->addVoice();
Staff* staff = part->addStaff();
VoiceBar* vb = bar->voice(voice);
for (Duration d = HundredTwentyEighthNote; d <= BreveNote; d = (Duration)(d + 1)) {
Chord* c = new Chord(d);
c->addNote(staff, 0);
vb->addElement(c);
}
for (int i = 1; i < 4; i++) {
Chord* c = new Chord(QuarterNote, i);
c->addNote(staff, 0);
vb->addElement(c);
}
validateOutput(sheet, "notedurations.xml");
delete sheet;
}
示例5: testPartGroups
void testPartGroups()
{
Sheet* sheet = new Sheet();
sheet->addBar();
for (int i = 0; i < 8; i++) {
sheet->addPart(QString("part %1").arg(i));
}
PartGroup* pg = sheet->addPartGroup(0, 1);
pg->setName("group 1");
pg = sheet->addPartGroup(2, 3);
pg->setSymbol(PartGroup::Brace);
pg = sheet->addPartGroup(4, 5);
pg->setSymbol(PartGroup::Line);
pg = sheet->addPartGroup(6, 7);
pg->setSymbol(PartGroup::Bracket);
pg->setCommonBarLines(false);
validateOutput(sheet, "partgroups.xml");
delete sheet;
}