本文整理汇总了C++中StaffType::isTabStaff方法的典型用法代码示例。如果您正苦于以下问题:C++ StaffType::isTabStaff方法的具体用法?C++ StaffType::isTabStaff怎么用?C++ StaffType::isTabStaff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaffType
的用法示例。
在下文中一共展示了StaffType::isTabStaff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void Stem::layout()
{
qreal l = _len + _userLen;
qreal _up = up() ? -1.0 : 1.0;
l *= _up;
qreal y1 = 0.0; // vertical displacement to match note attach point
Staff* stf = staff();
if (chord()) {
int tick = chord()->tick();
StaffType* st = stf->staffType(tick);
if (st->isTabStaff() ) { // TAB staves
if (st->stemThrough()) {
// if stems through staves, gets Y pos. of stem-side note relative to chord other side
qreal lineDist = st->lineDistance().val() * spatium();
y1 = (chord()->downString() - chord()->upString()) * _up * lineDist;
// if fret marks above lines, raise stem beginning by 1/2 line distance
if (!st->onLines())
y1 -= lineDist * 0.5;
// shorten stem by 1/2 lineDist to clear the note and a little more to keep 'air' betwen stem and note
lineDist *= 0.7 * mag();
y1 += _up * lineDist;
}
// in other TAB types, no correction
}
else { // non-TAB
// move stem start to note attach point
Note* n = up() ? chord()->downNote() : chord()->upNote();
y1 += (up() ? n->stemUpSE().y() : n->stemDownNW().y());
rypos() = n->rypos();
}
}
qreal lw5 = _lineWidth * .5;
line.setLine(0.0, y1, 0.0, l);
// compute bounding rectangle
QRectF r(line.p1(), line.p2());
setbbox(r.normalized().adjusted(-lw5, -lw5, lw5, lw5));
adjustReadPos(); // does not work if stem is layouted twice
}