本文整理汇总了C++中Part::addVoice方法的典型用法代码示例。如果您正苦于以下问题:C++ Part::addVoice方法的具体用法?C++ Part::addVoice怎么用?C++ Part::addVoice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::addVoice方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例4: KoFrameShape
MusicShape::MusicShape()
: KoFrameShape("http://www.koffice.org/music", "shape"),
m_firstSystem(0),
m_style(new MusicStyle),
m_engraver(new Engraver()),
m_renderer(new MusicRenderer(m_style)),
m_successor(0),
m_predecessor(0)
{
/* kDebug() << "firstShape:" << firstShape << "this:" << this;
if (firstShape) {
firstShape->m_successor = this;
m_predecessor = firstShape;
m_sheet = firstShape->m_sheet;
m_firstSystem = firstShape->m_lastSystem+1;
m_engraver->engraveSheet(m_sheet, m_firstSystem, QSizeF(1e9, 1e9), true, &m_lastSystem);
firstShape = this;
} else {
firstShape = this;*/
m_sheet = new Sheet();
Bar* bar = m_sheet->addBar();
Part* part = m_sheet->addPart("Part 1");
Staff* staff = part->addStaff();
part->addVoice();
bar->addStaffElement(new Clef(staff, 0, Clef::Trebble, 2, 0));
bar->addStaffElement(new TimeSignature(staff, 0, 4, 4));
// add some more default bars
for (int i = 0; i < 9; i++) {
m_sheet->addBar();
}
m_engraver->engraveSheet(m_sheet, 0, QSizeF(1e9, 1e9), true, &m_lastSystem);
// }
}