本文整理汇总了C++中BarLine::generated方法的典型用法代码示例。如果您正苦于以下问题:C++ BarLine::generated方法的具体用法?C++ BarLine::generated怎么用?C++ BarLine::generated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarLine
的用法示例。
在下文中一共展示了BarLine::generated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readScore
void TestBarline::barline02()
{
char msg[256];
Score* score = readScore(DIR + "barline02.mscx");
QVERIFY(score);
Measure* msr = score->firstMeasure()->nextMeasure();
TimeSig* ts = new TimeSig(score);
ts->setSig(Fraction(3, 4), TimeSigType::NORMAL);
score->cmdAddTimeSig(msr, 0, ts, false);
score->doLayout();
msr = score->firstMeasure();
int msrNo = 1;
while ((msr = msr->nextMeasure())) {
++msrNo;
Segment* seg = msr->findSegment(SegmentType::EndBarLine, msr->tick()+msr->ticks());
sprintf(msg, "No SegEndBarLine in measure %d.", msrNo);
QVERIFY2(seg != nullptr, msg);
BarLine* bar = static_cast<BarLine*>(seg->element(0));
sprintf(msg, "No barline in measure %d.", msrNo);
QVERIFY2(bar != nullptr, msg);
// bar line should be generated if NORMAL, except the END one at the end
sprintf(msg, "Barline in measure %d changed into 'non-generated'.", msrNo);
// ws: end barline is also generated
// bool test = (bar->barLineType() == BarLineType::NORMAL) ? bar->generated() : !bar->generated();
bool test = bar->generated();
QVERIFY2(test, msg);
}
// QVERIFY(saveCompareScore(score, "barline02.mscx", DIR + "barline02-ref.mscx"));
delete score;
}