void TrillSegment::layout() { if (staff()) setMag(staff()->mag(tick())); if (isSingleType() || isBeginType()) { 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->setParent(this); } 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: symbolLine(SymId::ornamentBottomLeftConcaveStroke, SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd); break; case Trill::Type::DOWNPRALL_LINE: symbolLine(SymId::ornamentLeftVerticalStroke, SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd); break; } } else symbolLine(SymId::wiggleTrill, SymId::wiggleTrill); autoplaceSpannerSegment(); }
void VibratoSegment::layout() { if (staff()) setMag(staff()->mag(tick())); if (spanner()->placeBelow()) rypos() = staff() ? staff()->height() : 0.0; if (isSingleType() || isBeginType()) { switch (vibrato()->vibratoType()) { case Vibrato::Type::GUITAR_VIBRATO: symbolLine(SymId::guitarVibratoStroke, SymId::guitarVibratoStroke); break; case Vibrato::Type::GUITAR_VIBRATO_WIDE: symbolLine(SymId::guitarWideVibratoStroke, SymId::guitarWideVibratoStroke); break; case Vibrato::Type::VIBRATO_SAWTOOTH: symbolLine(SymId::wiggleSawtooth, SymId::wiggleSawtooth); break; case Vibrato::Type::VIBRATO_SAWTOOTH_WIDE: symbolLine(SymId::wiggleSawtoothWide, SymId::wiggleSawtoothWide); break; } } else symbolLine(SymId::wiggleVibrato, SymId::wiggleVibrato); if (isStyled(Pid::OFFSET)) roffset() = vibrato()->propertyDefault(Pid::OFFSET).toPointF(); autoplaceSpannerSegment(); }
void VibratoSegment::layout() { if (staff()) setMag(staff()->mag(tick())); if (isSingleType() || isBeginType()) { switch (vibrato()->vibratoType()) { case Vibrato::Type::GUITAR_VIBRATO: symbolLine(SymId::guitarVibratoStroke, SymId::guitarVibratoStroke); break; case Vibrato::Type::GUITAR_VIBRATO_WIDE: symbolLine(SymId::guitarWideVibratoStroke, SymId::guitarWideVibratoStroke); break; case Vibrato::Type::VIBRATO_SAWTOOTH: symbolLine(SymId::wiggleSawtooth, SymId::wiggleSawtooth); break; case Vibrato::Type::VIBRATO_SAWTOOTH_WIDE: symbolLine(SymId::wiggleSawtoothWide, SymId::wiggleSawtoothWide); break; } } else symbolLine(SymId::wiggleVibrato, SymId::wiggleVibrato); autoplaceSpannerSegment(spatium() * 1.0); }
void Arpeggio::layout() { qreal y1 = -_userLen1; qreal y2 = _height + _userLen2; switch (arpeggioType()) { case ArpeggioType::NORMAL: { symbolLine(SymId::wiggleArpeggiatoUp, SymId::wiggleArpeggiatoUp); // string is rotated -90 degrees QRectF r(symBbox(symbols)); setbbox(QRectF(0.0, -r.x() + y1, r.height(), r.width())); } break; case ArpeggioType::UP: { symbolLine(SymId::wiggleArpeggiatoUpArrow, SymId::wiggleArpeggiatoUp); // string is rotated -90 degrees QRectF r(symBbox(symbols)); setbbox(QRectF(0.0, -r.x() + y1, r.height(), r.width())); } break; case ArpeggioType::DOWN: { symbolLine(SymId::wiggleArpeggiatoDownArrow, SymId::wiggleArpeggiatoDown); // string is rotated +90 degrees QRectF r(symBbox(symbols)); setbbox(QRectF(0.0, r.x() + y1, r.height(), r.width())); } break; case ArpeggioType::UP_STRAIGHT: { qreal _spatium = spatium(); qreal x1 = _spatium * .5; qreal w = symBbox(SymId::arrowheadBlackUp).width(); qreal lw = score()->styleS(StyleIdx::ArpeggioLineWidth).val() * _spatium; setbbox(QRectF(x1 - w * .5, y1, w, y2 - y1 + lw * .5)); } break; case ArpeggioType::DOWN_STRAIGHT: { qreal _spatium = spatium(); qreal x1 = _spatium * .5; qreal w = symBbox(SymId::arrowheadBlackDown).width(); qreal lw = score()->styleS(StyleIdx::ArpeggioLineWidth).val() * _spatium; setbbox(QRectF(x1 - w * .5, y1 - lw * .5, w, y2 - y1 + lw * .5)); } break; case ArpeggioType::BRACKET: { qreal _spatium = spatium(); qreal lw = score()->styleS(StyleIdx::ArpeggioLineWidth).val() * _spatium * .5; qreal w = score()->styleS(StyleIdx::ArpeggioHookLen).val() * _spatium; setbbox(QRectF(0.0, y1, w, y2-y1).adjusted(-lw, -lw, lw, lw)); break; } } }
void TrillSegment::layout() { if (autoplace()) setUserOff(QPointF()); if (staff()) setMag(staff()->mag(tick())); if (isSingleType() || isBeginType()) { 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->setParent(this); } 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: symbolLine(SymId::ornamentBottomLeftConcaveStroke, SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd); break; case Trill::Type::DOWNPRALL_LINE: symbolLine(SymId::ornamentLeftVerticalStroke, SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd); break; } } else symbolLine(SymId::wiggleTrill, SymId::wiggleTrill); if (parent()) { qreal yo = score()->styleP(trill()->placeBelow() ? Sid::trillPosBelow : Sid::trillPosAbove); rypos() = yo; if (autoplace()) { qreal minDistance = spatium(); Shape s1 = shape().translated(pos()); if (trill()->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; } } } }
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(); }