本文整理汇总了C++中BarLine::staffIdx方法的典型用法代码示例。如果您正苦于以下问题:C++ BarLine::staffIdx方法的具体用法?C++ BarLine::staffIdx怎么用?C++ BarLine::staffIdx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarLine
的用法示例。
在下文中一共展示了BarLine::staffIdx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: manageSpanData
void InspectorBarLine::manageSpanData()
{
#if 0
BarLine* bl = toBarLine(inspector->element());
// determine MIN and MAX for SPANFROM and SPANTO
Staff* staffFrom = bl->staff();
Staff* staffTo = bl->score()->staff(bl->staffIdx() + bl->span() - 1);
int staffFromLines= (staffFrom ? staffFrom->lines(bl->tick()) : 5);
int staffToLines = (staffTo ? staffTo->lines(bl->tick()) : 5);
// From: min = minimum possible according to number of staff lines
// max = if same as To, at least 1sp (2 units) above To; if not, max possible according to num.of lines
int min = staffFromLines == 1 ? BARLINE_SPAN_1LINESTAFF_FROM : MIN_BARLINE_SPAN_FROMTO;
int max = bl->span() < 2 ? bl->spanTo() - MIN_BARLINE_FROMTO_DIST
: (staffFromLines == 1 ? BARLINE_SPAN_1LINESTAFF_TO : (staffFromLines-1) * 2 + 2);
b.spanFrom->setMinimum(min);
b.spanFrom->setMaximum(max);
// To: min = if same as From, at least 1sp (2 units) below From; if not, min possible according to num.of lines
// max = max possible according to number of staff lines
min = bl->span() < 2 ? bl->spanFrom() + MIN_BARLINE_FROMTO_DIST
: (staffToLines == 1 ? BARLINE_SPAN_1LINESTAFF_FROM : MIN_BARLINE_SPAN_FROMTO);
max = staffToLines == 1 ? BARLINE_SPAN_1LINESTAFF_TO : (staffToLines-1) * 2 + 2;
b.spanTo->setMinimum(min);
b.spanTo->setMaximum(max);
// determine MAX for SPAN
max = bl->score()->nstaves() - bl->staffIdx();
b.span->setMaximum(max);
#endif
}