本文整理汇总了C++中StaffType::fretBoxH方法的典型用法代码示例。如果您正苦于以下问题:C++ StaffType::fretBoxH方法的具体用法?C++ StaffType::fretBoxH怎么用?C++ StaffType::fretBoxH使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaffType
的用法示例。
在下文中一共展示了StaffType::fretBoxH方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slurPos
void Tie::slurPos(SlurPos* sp)
{
bool useTablature = staff() != nullptr && staff()->isTabStaff();
StaffType* stt = nullptr;
if (useTablature)
stt = staff()->staffType();
qreal _spatium = spatium();
qreal hw = startNote()->tabHeadWidth(stt); // if stt == 0, defaults to headWidth()
qreal __up = _up ? -1.0 : 1.0;
// y offset for ties inside chord margins (typically multi-note chords): lined up with note top or bottom margin
// or outside (typically single-note chord): overlaps note and is above/below it
// Outside: Tab: uses font size and may be asymmetric placed above/below line (frets ON or ABOVE line)
// Std: assumes notehead is 1 sp high, 1/2 sp above and 1/2 below line; add 1/4 sp to it
// Inside: Tab: 1/2 of Outside offset
// Std: use a fixed pecentage of note width
qreal yOffOutside = useTablature
? (_up ? stt->fretBoxY() : stt->fretBoxY() + stt->fretBoxH()) * magS()
: 0.75 * _spatium * __up;
qreal yOffInside = useTablature ? yOffOutside * 0.5 : hw * .3 * __up;
Chord* sc = startNote()->chord();
Q_ASSERT(sc);
sp->system1 = sc->measure()->system();
if (!sp->system1) {
Measure* m = sc->measure();
qDebug("No system: measure is %d has %d count %d", m->isMMRest(), m->hasMMRest(), m->mmRestCount());
}
Q_ASSERT(sp->system1);
qreal xo;
qreal yo;
bool shortStart = false;
// determine attachment points
// similar code is used in Chord::layoutPitched()
// to allocate extra space to enforce minTieLength
// so keep these in sync
//------p1
if ((sc->notes().size() > 1) || (sc->stem() && (sc->up() == _up))) {
xo = startNote()->x() + hw * 1.12;
yo = startNote()->pos().y() + yOffInside;
shortStart = true;
}
else {
xo = startNote()->x() + hw * 0.65;
yo = startNote()->pos().y() + yOffOutside;
}
sp->p1 = sc->pagePos() - sp->system1->pagePos() + QPointF(xo, yo);
//------p2
if (endNote() == 0) {
sp->p2 = sp->p1 + QPointF(_spatium * 3, 0.0);
sp->system2 = sp->system1;
return;
}
Chord* ec = endNote()->chord();
sp->system2 = ec->measure()->system();
if (!sp->system2) {
qDebug("Tie::slurPos no system2");
sp->system2 = sp->system1;
}
hw = endNote()->tabHeadWidth(stt);
if ((ec->notes().size() > 1) || (ec->stem() && !ec->up() && !_up))
xo = endNote()->x() - hw * 0.12;
else if (shortStart)
xo = endNote()->x() + hw * 0.15;
else
xo = endNote()->x() + hw * 0.35;
sp->p2 = ec->pagePos() - sp->system2->pagePos() + QPointF(xo, yo);
}