您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ staff函数代码示例

51自学网 2021-06-03 08:21:19
  C++
这篇教程C++ staff函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中staff函数的典型用法代码示例。如果您正苦于以下问题:C++ staff函数的具体用法?C++ staff怎么用?C++ staff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了staff函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: staff

void Stem::draw(QPainter* painter) const      {      bool useTab = false;      Staff* st = staff();      if (st && st->isTabStaff()) {     // stems used in palette do not have a staff            if (st->staffType()->slashStyle())                  return;            useTab = true;            }      qreal lw = point(score()->styleS(ST_stemWidth));      painter->setPen(QPen(curColor(), lw, Qt::SolidLine, Qt::RoundCap));      painter->drawLine(line);      // NOT THE BEST PLACE FOR THIS?      // with tablatures, dots are not drawn near 'notes', but near stems      // TODO: adjust bounding rectangle in layout()      if (useTab) {            int nDots = chord()->dots();            if (nDots > 0) {                  qreal sp = spatium();                  qreal y = stemLen() - ( ((StaffTypeTablature*)st->staffType())->stemsDown() ?                              (STAFFTYPE_TAB_DEFAULTSTEMLEN_DN - 0.75) * sp : 0.0 );                  symbols[score()->symIdx()][dotSym].draw(painter, magS(),                              QPointF(STAFFTYPE_TAB_DEFAULTDOTDIST_X * sp, y), nDots);                  }            }      }
开发者ID:kuribas,项目名称:MuseScore,代码行数:27,


示例2: setUserOff

void OttavaSegment::layout()      {      if (autoplace())            setUserOff(QPointF());      TextLineBaseSegment::layout();      if (parent()) {            qreal yo = score()->styleP(StyleIdx::ottavaY) * mag();            if (ottava()->placeBelow())                  yo = -yo + staff()->height();            rypos() += yo;            if (autoplace()) {                  qreal minDistance = spatium() * .7;                  Shape s1 = shape().translated(pos());                  if (ottava()->placeAbove()) {                        qreal d  = system()->topDistance(staffIdx(), s1);                        if (d > -minDistance)                              rUserYoffset() = -d - minDistance;                        }                  else {                        qreal d  = system()->bottomDistance(staffIdx(), s1);                        if (d > -minDistance)                              rUserYoffset() = d + minDistance;                        }                  }            else                  adjustReadPos();            }      }
开发者ID:sidewayss,项目名称:MuseScore,代码行数:29,


示例3: staff

void BarLine::read(XmlReader& e)      {      // if bar line belongs to a staff, span values default to staff values      if (staff()) {            _span     = staff()->barLineSpan();            _spanFrom = staff()->barLineFrom();            _spanTo   = staff()->barLineTo();            }      while (e.readNextStartElement()) {            const QStringRef& tag(e.name());            if (tag == "subtype") {                  bool ok;                  const QString& val(e.readElementText());                  int i = val.toInt(&ok);                  if (!ok)                        setBarLineType(val);                  else {                        BarLineType ct = NORMAL_BAR;                        switch (i) {                              default:                              case  0: ct = NORMAL_BAR; break;                              case  1: ct = DOUBLE_BAR; break;                              case  2: ct = START_REPEAT; break;                              case  3: ct = END_REPEAT; break;                              case  4: ct = BROKEN_BAR; break;                              case  5: ct = END_BAR; break;                              case  6: ct = END_START_REPEAT; break;                              case  7: ct = DOTTED_BAR; break;                              }                        setBarLineType(ct);                        }                  if (parent() && parent()->type() == SEGMENT) {                        Measure* m = static_cast<Segment*>(parent())->measure();                        if (barLineType() != m->endBarLineType())                              _customSubtype = true;                        }                  }            else if (tag == "customSubtype")                  _customSubtype = e.readInt();            else if (tag == "span") {                  _span       = e.readInt();                  _spanFrom   = e.intAttribute("from", _spanFrom);                  _spanTo     = e.intAttribute("to", _spanTo);                  // WARNING: following statements assume staff and staff bar line spans are correctly set                  if (staff() && (_span != staff()->barLineSpan()                     || _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))                        _customSpan = true;                  }            else if (tag == "Articulation") {                  Articulation* a = new Articulation(score());                  a->read(e);                  add(a);                  }            else if (!Element::readProperties(e))                  e.unknown();            }      }
开发者ID:shadowphiar,项目名称:MuseScore,代码行数:57,


示例4: staff

void BarLine::read(const QDomElement& de)      {      // if bar line belongs to a staff, span values default to staff values      if(staff()) {            _span       = staff()->barLineSpan();            _spanFrom   = staff()->barLineFrom();            _spanTo     = staff()->barLineTo();      }      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {            const QString& tag(e.tagName());            const QString& val(e.text());            if (tag == "subtype") {                  bool ok;                  int i = val.toInt(&ok);                  if (!ok)                        setSubtype(val);                  else {                        BarLineType ct = NORMAL_BAR;                        switch (i) {                              default:                              case  0: ct = NORMAL_BAR; break;                              case  1: ct = DOUBLE_BAR; break;                              case  2: ct = START_REPEAT; break;                              case  3: ct = END_REPEAT; break;                              case  4: ct = BROKEN_BAR; break;                              case  5: ct = END_BAR; break;                              case  6: ct = END_START_REPEAT; break;                              case  7: ct = DOTTED_BAR; break;                              }                        setSubtype(ct);                        }                  if(parent() && parent()->type() == SEGMENT) {                        Measure* m = static_cast<Segment*>(parent())->measure();                        if(subtype() != m->endBarLineType())                              setCustomSubtype(true);                        }                  }            else if (tag == "customSubtype")                  setCustomSubtype(val.toInt() != 0);            else if (tag == "span") {                  _span       = val.toInt();                  _spanFrom   = e.attribute("from", QString::number(_spanFrom)).toInt();                  _spanTo     = e.attribute("to", QString::number(_spanTo)).toInt();                  // WARNING: following statements assume staff and staff bar line spans are correctly set                  if(staff() && (_span != staff()->barLineSpan()                              || _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))                        _customSpan = true;                  }            else if (tag == "Articulation") {                  Articulation* a = new Articulation(score());                  a->read(e);                  add(a);                  }            else if (!Element::readProperties(e))                  domError(e);            }      }
开发者ID:aeliot,项目名称:MuseScore,代码行数:57,


示例5: staff

void Articulation::draw(Painter* painter) const      {      SymId sym = _up ? articulationList[subtype()].upSym : articulationList[subtype()].downSym;      int flags = articulationList[subtype()].flags;      if (staff()) {            bool tab = staff()->useTablature();            if (tab) {                  if (!(flags & ARTICULATION_SHOW_IN_TABLATURE))                        return;                  }            else {                  if (!(flags & ARTICULATION_SHOW_IN_PITCHED_STAFF))                        return;                  }            }      symbols[score()->symIdx()][sym].draw(painter, magS());      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:17,


示例6: spatium

void KeySig::layout()      {      qreal _spatium = spatium();      setbbox(QRectF());      if (staff() && !staff()->genKeySig()) {     // no key sigs on TAB staves            qDeleteAll(keySymbols);            return;            }      if (isCustom()) {            foreach(KeySym* ks, keySymbols) {                  ks->pos = ks->spos * _spatium;                  addbbox(symBbox(ks->sym).translated(ks->pos));                  }            return;            }
开发者ID:mastashake08,项目名称:MuseScore,代码行数:17,


示例7: draw

void Articulation::draw(QPainter* painter) const      {      SymId sym = _up ? articulationList[articulationType()].upSym : articulationList[articulationType()].downSym;      int flags = articulationList[articulationType()].flags;      if (staff()) {            if (staff()->staffGroup() == TAB_STAFF_GROUP) {                  if (!(flags & ARTICULATION_SHOW_IN_TABLATURE))                        return;                  }            else {                  if (!(flags & ARTICULATION_SHOW_IN_PITCHED_STAFF))                        return;                  }            }      painter->setPen(curColor());      drawSymbol(sym, painter, QPointF(-0.5 * width(), _up ? 0.0 : height()));      }
开发者ID:33akash,项目名称:MuseScore,代码行数:17,


示例8: rypos

void TrillSegment::layout(){    if (parent())        rypos() += score()->styleS(StyleIdx::trillY).val() * spatium();    if (staff())        setMag(staff()->mag());    if (spannerSegmentType() == SpannerSegmentType::SINGLE || spannerSegmentType() == SpannerSegmentType::BEGIN) {        Accidental* a = trill()->accidental();        if (a) {            a->layout();            a->setMag(a->mag() * .6);            qreal _spatium = spatium();            a->setPos(_spatium * 1.3, -2.2 * _spatium);            a->adjustReadPos();        }        switch (trill()->trillType()) {        case Trill::Type::TRILL_LINE:            symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);            break;        case Trill::Type::PRALLPRALL_LINE:            symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);            break;        case Trill::Type::UPPRALL_LINE:            if (score()->scoreFont()->isValid(SymId::ornamentBottomLeftConcaveStroke))                symbolLine(SymId::ornamentBottomLeftConcaveStroke,                           SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);            else                symbolLine(SymId::ornamentUpPrall,                           // SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);                           SymId::ornamentZigZagLineNoRightEnd);            break;        case Trill::Type::DOWNPRALL_LINE:            if (score()->scoreFont()->isValid(SymId::ornamentLeftVerticalStroke))                symbolLine(SymId::ornamentLeftVerticalStroke,                           SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);            else                symbolLine(SymId::ornamentDownPrall,                           // SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);                           SymId::ornamentZigZagLineNoRightEnd);            break;        }    }    else        symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);    adjustReadPos();}
开发者ID:curiousbadger,项目名称:MuseScore,代码行数:46,


示例9: staff

void Harmony::write(Xml& xml) const      {      if (!xml.canWrite(this)) return;      xml.stag("Harmony");      if (_leftParen)            xml.tagE("leftParen");      if (_rootTpc != Tpc::TPC_INVALID || _baseTpc != Tpc::TPC_INVALID) {            int rRootTpc = _rootTpc;            int rBaseTpc = _baseTpc;            if (staff()) {                  const Interval& interval = staff()->part()->instr()->transpose();                  if (xml.clipboardmode && !score()->styleB(StyleIdx::concertPitch) && interval.chromatic) {                        rRootTpc = transposeTpc(_rootTpc, interval, false);                        rBaseTpc = transposeTpc(_baseTpc, interval, false);                        }                  }            if (rRootTpc != Tpc::TPC_INVALID)                  xml.tag("root", rRootTpc);            if (_id > 0)                  xml.tag("extension", _id);            if (_textName != "")                  xml.tag("name", _textName);            if (rBaseTpc != Tpc::TPC_INVALID)                  xml.tag("base", rBaseTpc);            foreach(const HDegree& hd, _degreeList) {                  HDegreeType tp = hd.type();                  if (tp == HDegreeType::ADD || tp == HDegreeType::ALTER || tp == HDegreeType::SUBTRACT) {                        xml.stag("degree");                        xml.tag("degree-value", hd.value());                        xml.tag("degree-alter", hd.alter());                        switch (tp) {                              case HDegreeType::ADD:                                    xml.tag("degree-type", "add");                                    break;                              case HDegreeType::ALTER:                                    xml.tag("degree-type", "alter");                                    break;                              case HDegreeType::SUBTRACT:                                    xml.tag("degree-type", "subtract");                                    break;                              default:                                    break;                              }                        xml.etag();                        }                  }
开发者ID:jinnaiyuu,项目名称:MuseScore,代码行数:46,


示例10: TEST

/// Tests the Constructors/// @return True if all tests were executed, false if notbool StaffTestSuite::TestCaseConstructor(){    //------Last Checked------//    // - Jan 5, 2005        // TEST CASE: Default Constructor    {        Staff staff;        TEST(wxT("Default Constructor"),            (staff.GetClef() == Staff::DEFAULT_CLEF) &&            (staff.GetTablatureStaffType() == Staff::DEFAULT_TABLATURE_STAFF_TYPE) &&            (staff.GetStandardNotationStaffAboveSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_ABOVE_SPACING) &&            (staff.GetStandardNotationStaffBelowSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_BELOW_SPACING) &&            (staff.GetSymbolSpacing() == Staff::DEFAULT_SYMBOL_SPACING) &&            (staff.GetTablatureStaffBelowSpacing() == Staff::DEFAULT_TABLATURE_STAFF_BELOW_SPACING)        );    }        // TEST CASE: Primary Constructor    {        Staff staff(4, Staff::BASS_CLEF);        staff.m_positionArray[0].Add(new Position);        staff.m_positionArray[1].Add(new Position);                TEST(wxT("Copy Constructor"),            (staff.GetClef() == Staff::BASS_CLEF) &&            (staff.GetTablatureStaffType() == 4) &&            (staff.GetStandardNotationStaffAboveSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_ABOVE_SPACING) &&            (staff.GetStandardNotationStaffBelowSpacing() == Staff::DEFAULT_STANDARD_NOTATION_STAFF_BELOW_SPACING) &&            (staff.GetSymbolSpacing() == Staff::DEFAULT_SYMBOL_SPACING) &&            (staff.GetTablatureStaffBelowSpacing() == Staff::DEFAULT_TABLATURE_STAFF_BELOW_SPACING)        );    }        // TEST CASE: Copy Constructor    {        Staff staff(4, Staff::BASS_CLEF);        staff.m_positionArray[0].Add(new Position);        staff.m_positionArray[1].Add(new Position);        Staff staff2(staff);                TEST(wxT("Copy Constructor"), staff == staff2);    }        return (true);}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:48,


示例11: draw

void Articulation::draw(QPainter* painter) const      {      SymId sym = _up ? articulationList[articulationType()].upSym : articulationList[articulationType()].downSym;      int flags = articulationList[articulationType()].flags;      if (staff()) {            if (staff()->staffGroup() == TAB_STAFF) {                  if (!(flags & ARTICULATION_SHOW_IN_TABLATURE))                        return;                  }            else {                  if (!(flags & ARTICULATION_SHOW_IN_PITCHED_STAFF))                        return;                  }            }      painter->setPen(curColor());      symbols[score()->symIdx()][sym].draw(painter, magS());      }
开发者ID:jglasson,项目名称:MuseScore,代码行数:17,


示例12: draw

void Articulation::draw(QPainter* painter) const      {      SymId sym = _up ? articulationList[int(articulationType())].upSym : articulationList[int(articulationType())].downSym;      ArticulationShowIn flags = articulationList[int(articulationType())].flags;      if (staff()) {            if (staff()->staffGroup() == StaffGroup::TAB) {                  if (!(flags & ArticulationShowIn::TABLATURE))                        return;                  }            else {                  if (!(flags & ArticulationShowIn::PITCHED_STAFF))                        return;                  }            }      painter->setPen(curColor());      drawSymbol(sym, painter, QPointF(-0.5 * width(), 0.0));      }
开发者ID:FryderykChopin,项目名称:MuseScore,代码行数:17,


示例13: spatium

void Ottava::setYoff(qreal val)      {      qreal _spatium = spatium();      qreal yo(score()->styleS(StyleIdx::ottavaY).val() * _spatium);      if (placement() == Element::Placement::BELOW)            yo = -yo + staff()->height();      rUserYoffset() += val * _spatium - yo;      }
开发者ID:cynisright,项目名称:MuseScore,代码行数:8,


示例14: staff

void StaffTextBase::layout()      {      Staff* s = staff();      qreal y = placeAbove() ? styleP(Sid::staffTextPosAbove) : styleP(Sid::staffTextPosBelow) + (s ? s->height() : 0.0);      setPos(QPointF(0.0, y));      TextBase::layout1();      autoplaceSegmentElement(styleP(Sid::staffTextMinDistance));      }
开发者ID:theMusicalGamer,项目名称:MuseScore,代码行数:8,


示例15: nn

/**  In record mode  add new 'empty' note segment at the end off the staff when index is on its last note * but ignore last possible note on the staff - new staff is already created with a new single note */void TmultiScore::checkAndAddNote(TscoreStaff* sendStaff, int noteIndex) {  if (insertMode() == e_record && noteIndex == sendStaff->count() - 1 && noteIndex != sendStaff->maxNoteCount() - 1) {      Tnote nn(0, 0, 0);      m_addNoteAnim = false; // do not show adding note animation when note is added here      sendStaff->addNote(nn);      if (staff()->noteSegment(0)->noteName())        sendStaff->noteSegment(sendStaff->count() - 1)->showNoteName();  }}
开发者ID:SeeLook,项目名称:nootka,代码行数:11,


示例16: getNote

Tnote TmultiScore::getNote(int index) {  if (index >= 0 && index < notesCount()) {    if (insertMode() == e_single)      return *staff()->getNote(index);    else      return *noteFromId(index)->note();  } else      return Tnote();}
开发者ID:SeeLook,项目名称:nootka,代码行数:9,


示例17: scoreScene

void TmultiScore::setInsertMode(TmultiScore::EinMode mode) {  if (mode != m_inMode) {    bool ignoreThat = false;    if ((mode == e_record && m_inMode == e_multi) || (mode == e_multi && m_inMode == e_record))      ignoreThat = true;    m_inMode = mode;    if (ignoreThat)      return;    if (mode == e_single) {        scoreScene()->left()->enableToAddNotes(false); // It has to be invoked before deleteNotes() to hide 'enter note' text        scoreScene()->right()->enableToAddNotes(false);        deleteNotes();        staff()->noteSegment(0)->setBackgroundColor(-1); // unset background        staff()->setStafNumber(-1);        staff()->setViewWidth(0.0);        staff()->setSelectableNotes(false);        m_addNoteAnim = false;        staff()->insertNote(1, true);        m_addNoteAnim = false;        staff()->insertNote(2, true);        setControllersEnabled(true, false);        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);        m_currentIndex = 0;        m_selectReadOnly = false;        if (!m_fakeLines.isEmpty()) {          for (int i = 0 ; i < m_fakeLines.size(); ++i)            delete m_fakeLines[i];          m_fakeLines.clear();        }    } else {        staff()->setStafNumber(0);        staff()->removeNote(2);        staff()->removeNote(1);        staff()->setSelectableNotes(true);        setControllersEnabled(true, true);        scoreScene()->left()->enableToAddNotes(true);        scoreScene()->right()->enableToAddNotes(true);        setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);        setMaximumWidth(QWIDGETSIZE_MAX); // revert what TsimpleScore 'broke'        setNote(0, Tnote());    }    resizeEvent(0);  }}
开发者ID:SeeLook,项目名称:nootka,代码行数:44,


示例18: staff

void Ottava::endEdit()      {      if (editTick != tick() || editTick2 != tick2()) {            Staff* s = staff();            s->updateOttava();            score()->addLayoutFlags(LayoutFlag::FIX_PITCH_VELO);            score()->setPlaylistDirty(true);            }      TextLine::endEdit();      }
开发者ID:cynisright,项目名称:MuseScore,代码行数:10,


示例19: clefChanged

void TsimpleScore::onClefChanged(Tclef clef) {  if (isPianoStaff())    emit clefChanged(Tclef(Tclef::e_pianoStaff));  else    emit clefChanged(staff()->scoreClef()->clef());  if ((m_clefType == Tclef::e_pianoStaff && clef.type() != Tclef::e_pianoStaff) ||      (m_clefType != Tclef::e_pianoStaff && clef.type() == Tclef::e_pianoStaff)  )          resizeEvent(0);  m_clefType = clef.type();}
开发者ID:SeeLook,项目名称:nootka,代码行数:10,


示例20: QGraphicsSimpleTextItem

void TsimpleScore::addBGglyph(int instr) {  if (instr < 0 || instr > 3)      return;  m_prevBGglyph = instr;  if (m_bgGlyph)    delete m_bgGlyph;  m_bgGlyph = new QGraphicsSimpleTextItem(instrumentToGlyph(Einstrument(instr)));  m_bgGlyph->setParentItem(staff());  m_bgGlyph->setFont(TnooFont());  QColor bgColor = palette().highlight().color();  bgColor.setAlpha(50);  m_bgGlyph->setBrush(bgColor);  qreal factor = (staff()->height() / m_bgGlyph->boundingRect().height());  m_bgGlyph->setScale(factor);  m_bgGlyph->setPos((staff()->width() - m_bgGlyph->boundingRect().width() * factor) / 2 ,                  (staff()->height() - m_bgGlyph->boundingRect().height() * factor) / 2);  m_bgGlyph->setZValue(1);}
开发者ID:SeeLook,项目名称:nootka,代码行数:19,


示例21: spatium

void KeySig::layout(){    qreal _spatium = spatium();    setbbox(QRectF());    if (staff() && !staff()->genKeySig()) {     // no key sigs on TAB staves        foreach(KeySym* ks, keySymbols)            delete ks;        keySymbols.clear();        return;    }    if (isCustom()) {        foreach(KeySym* ks, keySymbols) {            ks->pos = ks->spos * _spatium;            addbbox(symbols[score()->symIdx()][ks->sym].bbox(magS()).translated(ks->pos));        }        return;    }
开发者ID:ho-chiahua,项目名称:MuseScore,代码行数:19,


示例22: draw

void Symbol::draw(QPainter* p) const      {      if (!isNoteDot() || !staff()->isTabStaff(tick())) {            p->setPen(curColor());            if (_scoreFont)                  _scoreFont->draw(_sym, p, magS(), QPointF());            else                  drawSymbol(_sym, p);            }      }
开发者ID:IsaacWeiss,项目名称:MuseScore,代码行数:10,


示例23: draw

void Symbol::draw(QPainter* p) const{    if (type() != NOTEDOT || !staff()->isTabStaff()) {        p->setPen(curColor());        if (_scoreFont)            _scoreFont->draw(_sym, p, magS(), QPointF());        else            drawSymbol(_sym, p);    }}
开发者ID:joergsichermann,项目名称:MuseScore,代码行数:10,


示例24: staff

void InstrumentChange::write(Xml& xml) const      {      xml.stag("InstrumentChange");      if (segment())            staff()->part()->instr(segment()->tick())->write(xml); // _instrument may not reflect mixer changes      else            _instrument.write(xml);      Text::writeProperties(xml);      xml.etag();      }
开发者ID:Annovae,项目名称:MuseScore,代码行数:10,


示例25: changeCurrentIndex

void TmultiScore::setNote(const Tnote& note) {  if (insertMode() != e_single) {      if (currentIndex() == -1)        changeCurrentIndex(0);      TscoreStaff *thisStaff = currentStaff();      if (insertMode() == e_record) {          if (m_clickedOff > 0)            checkAndAddNote(thisStaff, currentIndex() % staff()->maxNoteCount());          changeCurrentIndex(currentIndex() + m_clickedOff);          thisStaff = currentStaff();          m_clickedOff = 1;      }      thisStaff->setNote(currentIndex() % staff()->maxNoteCount(), note);      if (staffCount() > 1)        QTimer::singleShot(5, this, SLOT(ensureNoteIsVisible()));  } else {      TsimpleScore::setNote(0, note);  }}
开发者ID:SeeLook,项目名称:nootka,代码行数:19,


示例26: symId

void Fermata::draw(QPainter* painter) const      {#if 0      SymId sym = symId();      FermataShowIn flags = articulationList[int(articulationType())].flags;      if (staff()) {            if (staff()->staffGroup() == StaffGroup::TAB) {                  if (!(flags & FermataShowIn::TABLATURE))                        return;                  }            else {                  if (!(flags & FermataShowIn::PITCHED_STAFF))                        return;                  }            }#endif      painter->setPen(curColor());      drawSymbol(_symId, painter, QPointF(-0.5 * width(), 0.0));      }
开发者ID:mmuman,项目名称:MuseScore,代码行数:19,


示例27: switch

bool Ottava::setProperty(P_ID propertyId, const QVariant& val)      {      switch (propertyId) {            case P_ID::OTTAVA_TYPE:                  setOttavaType(OttavaType(val.toInt()));                  break;            case P_ID::LINE_WIDTH:                  lineWidthStyle = PropertyStyle::UNSTYLED;                  TextLine::setProperty(propertyId, val);                  break;            case P_ID::LINE_STYLE:                  lineStyleStyle = PropertyStyle::UNSTYLED;                  TextLine::setProperty(propertyId, val);                  break;            case P_ID::NUMBERS_ONLY:                  setNumbersOnly(val.toBool());                  setOttavaType(_ottavaType);                  numbersOnlyStyle = PropertyStyle::UNSTYLED;                  break;            case P_ID::SPANNER_TICK2:                  staff()->pitchOffsets().remove(tick2());                  setTick2(val.toInt());                  staff()->updateOttava(this);                  break;            case P_ID::SPANNER_TICK:                  staff()->pitchOffsets().remove(tick());                  setTick(val.toInt());                  staff()->updateOttava(this);                  break;            default:                  if (!TextLine::setProperty(propertyId, val))                        return false;                  break;            }      score()->setLayoutAll(true);      return true;      }
开发者ID:Igevorse,项目名称:MuseScore,代码行数:43,


示例28: staff

void Stem::draw(QPainter* painter) const      {      Staff* st = staff();      bool useTab = st && st->isTabStaff();      if (useTab && st->staffType()->slashStyle())            return;      qreal lw = lineWidth();      painter->setPen(QPen(curColor(), lw, Qt::SolidLine, Qt::RoundCap));      painter->drawLine(line);      if (!useTab)            return;      // TODO: adjust bounding rectangle in layout() for dots and for slash      StaffTypeTablature* stt = static_cast<StaffTypeTablature*>(st->staffType());      qreal sp = spatium();      // slashed half note stem      if (chord() && chord()->durationType().type() == TDuration::V_HALF         && stt->minimStyle() == TAB_MINIM_SLASHED) {            qreal wdt   = sp * STAFFTYPE_TAB_SLASH_WIDTH;            qreal sln   = sp * STAFFTYPE_TAB_SLASH_SLANTY;            qreal thk   = sp * STAFFTYPE_TAB_SLASH_THICK;            qreal displ = sp * STAFFTYPE_TAB_SLASH_DISPL;            QPainterPath path;            qreal y = stt->stemsDown() ?                         _len - STAFFTYPE_TAB_SLASH_2STARTY_DN*sp :                        -_len + STAFFTYPE_TAB_SLASH_2STARTY_UP*sp;            for (int i = 0; i < 2; ++i) {                  path.moveTo( wdt*0.5-lw, y);        // top-right corner                  path.lineTo( wdt*0.5-lw, y+thk);    // bottom-right corner                  path.lineTo(-wdt*0.5,    y+thk+sln);// bottom-left corner                  path.lineTo(-wdt*0.5,    y+sln);    // top-left corner                  path.closeSubpath();                  y += displ;                  }//            setbbox(path.boundingRect());            painter->setBrush(QBrush(curColor()));            painter->setPen(Qt::NoPen);            painter->drawPath(path);            }      // dots      // NOT THE BEST PLACE FOR THIS?      // with tablatures, dots are not drawn near 'notes', but near stems      int nDots = chord()->dots();      if (nDots > 0) {            qreal y = stemLen() - (stt->stemsDown() ?                        (STAFFTYPE_TAB_DEFAULTSTEMLEN_DN - 0.75) * sp : 0.0 );            symbols[score()->symIdx()][dotSym].draw(painter, magS(),                        QPointF(STAFFTYPE_TAB_DEFAULTDOTDIST_X * sp, y), nDots);            }      }
开发者ID:santh,项目名称:MuseScore,代码行数:54,


示例29: TscoreStaff

void TmultiScore::addStaff(TscoreStaff* st) {  if (st == 0) { // create new staff at the end of a list    m_staves << new TscoreStaff(scoreScene(), 0);    lastStaff()->onClefChanged(m_staves.first()->scoreClef()->clef());    lastStaff()->scoreClef()->setReadOnly(m_staves.first()->scoreClef()->readOnly());    lastStaff()->setEnableKeySign(staff()->scoreKey());    if (lastStaff()->scoreKey())      lastStaff()->scoreKey()->setKeySignature(m_staves.first()->scoreKey()->keySignature());    connect(lastStaff(), SIGNAL(hiNoteChanged(int,qreal)), this, SLOT(staffHiNoteChanged(int,qreal))); // ignore for first    lastStaff()->setDisabled(m_isDisabled);  } else { // staff of TsimpleScore is added this way
开发者ID:SeeLook,项目名称:nootka,代码行数:11,


示例30: yo

void OttavaSegment::layout()      {      TextLineSegment::layout1();      if (parent()) {     // for palette            qreal yo(score()->styleS(StyleIdx::ottavaY).val() * spatium());            if (ottava()->placement() == Placement::BELOW)                  yo = -yo + staff()->height();            rypos() += yo;            }      adjustReadPos();      }
开发者ID:Igevorse,项目名称:MuseScore,代码行数:11,



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


C++ staffIdx函数代码示例
C++ stackblock函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。