本文整理汇总了C++中StaffType::doty1方法的典型用法代码示例。如果您正苦于以下问题:C++ StaffType::doty1方法的具体用法?C++ StaffType::doty1怎么用?C++ StaffType::doty1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaffType
的用法示例。
在下文中一共展示了StaffType::doty1方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawDots
void BarLine::drawDots(QPainter* painter, qreal x) const
{
qreal _spatium = spatium();
if (parent() == 0) { // for use in palette
drawSymbol(SymId::repeatDot, painter, QPointF(x, 2.0 * _spatium));
drawSymbol(SymId::repeatDot, painter, QPointF(x, 3.0 * _spatium));
}
else if (parent()->type() == Element::Type::SEGMENT) {
System* s = static_cast<Segment*>(parent())->measure()->system();
int staffIdx1 = staffIdx();
int staffIdx2 = staffIdx1 + _span - 1;
int sp = _span;
if (staffIdx2 >= score()->nstaves()) {
qDebug("BarLine: bad _span %d", _span);
staffIdx2 = score()->nstaves() - 1;
sp = staffIdx2 - staffIdx1 + 1;
}
qreal dy = s->staff(staffIdx1)->y();
for (int i = 0; i < sp; ++i) {
Staff* staff = score()->staff(staffIdx1 + i);
StaffType* st = staff->staffType();
qreal doty1 = (st->doty1() + .5) * _spatium;
qreal doty2 = (st->doty2() + .5) * _spatium;
qreal staffy = s->staff(staffIdx1 + i)->y() - dy;
drawSymbol(SymId::repeatDot, painter, QPointF(x, staffy + doty1));
drawSymbol(SymId::repeatDot, painter, QPointF(x, staffy + doty2));
}
}
}
示例2: drawDots
void BarLine::drawDots(QPainter* painter, qreal x) const
{
const Sym& dotsym = symbols[score()->symIdx()][dotSym];
qreal mags = magS();
qreal _spatium = spatium();
if (parent() == 0) { // for use in palette
dotsym.draw(painter, mags, QPointF(x, 1.5 * _spatium));
dotsym.draw(painter, mags, QPointF(x, 2.5 * _spatium));
}
else if (parent()->type() == SEGMENT) {
System* s = static_cast<Segment*>(parent())->measure()->system();
int staffIdx1 = staffIdx();
int staffIdx2 = staffIdx1 + _span - 1;
int sp = _span;
if (staffIdx2 >= score()->nstaves()) {
qDebug("BarLine: bad _span %d", _span);
staffIdx2 = score()->nstaves() - 1;
sp = staffIdx2 - staffIdx1 + 1;
}
qreal dy = s->staff(staffIdx1)->y();
for (int i = 0; i < sp; ++i) {
Staff* staff = score()->staff(staffIdx1 + i);
StaffType* st = staff->staffType();
qreal doty1 = st->doty1() * _spatium;
qreal doty2 = st->doty2() * _spatium;
qreal staffy = s->staff(staffIdx1 + i)->y() - dy;
dotsym.draw(painter, mags, QPointF(x, staffy + doty1));
dotsym.draw(painter, mags, QPointF(x, staffy + doty2));
}
}
}
示例3: drawDots
void BarLine::drawDots(QPainter* painter, qreal x) const
{
const Sym& dotsym = symbols[score()->symIdx()][dotSym];
qreal mags = magS();
qreal _spatium = spatium();
if (parent() == 0) { // for use in palette
dotsym.draw(painter, mags, QPointF(x, 1.5 * _spatium));
dotsym.draw(painter, mags, QPointF(x, 2.5 * _spatium));
}
else {
System* s = measure()->system();
int _staffIdx = staffIdx();
qreal dy = s->staff(_staffIdx)->y();
for (int i = 0; i < _span; ++i) {
Staff* staff = score()->staff(_staffIdx + i);
StaffType* st = staff->staffType();
qreal doty1 = st->doty1() * _spatium;
qreal doty2 = st->doty2() * _spatium;
qreal staffy = s->staff(_staffIdx + i)->y() - dy;
dotsym.draw(painter, mags, QPointF(x, staffy + doty1));
dotsym.draw(painter, mags, QPointF(x, staffy + doty2));
}
}
}