当前位置: 首页>>代码示例>>C++>>正文


C++ StaffType::doty1方法代码示例

本文整理汇总了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));
                  }
            }
      }
开发者ID:Soerboe,项目名称:MuseScore,代码行数:32,代码来源:barline.cpp

示例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));
                  }
            }
      }
开发者ID:shadowphiar,项目名称:MuseScore,代码行数:34,代码来源:barline.cpp

示例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));
                  }
            }
      }
开发者ID:Mistobaan,项目名称:MuseScore,代码行数:27,代码来源:barline.cpp


注:本文中的StaffType::doty1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。