void OttavaSegment::layout() { TextLineBaseSegment::layout(); if (parent()) { qreal y; if (placeAbove()) { y = score()->styleP(Sid::ottavaPosAbove); } else { qreal sh = ottava()->staff() ? ottava()->staff()->height() : 0; y = score()->styleP(Sid::ottavaPosBelow) + sh; } rypos() = y; if (autoplace()) { setUserOff(QPointF()); 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; } } } }
void OttavaSegment::layout() { if (autoplace()) setUserOff(QPointF()); TextLineSegment::layout(); if (parent()) { qreal yo = score()->styleP(StyleIdx::ottavaY) * mag(); if (ottava()->placement() == Element::Placement::BELOW) yo = -yo + staff()->height(); rypos() += yo; if (autoplace()) { qreal minDistance = spatium() * .7; Shape s1 = shape().translated(pos()); if (ottava()->placement() == Element::Placement::ABOVE) { 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(); } }
QVariant OttavaSegment::getProperty(P_ID id) const { switch (id) { case P_ID::OTTAVA_TYPE: return ottava()->getProperty(id); default: return TextLineSegment::getProperty(id); } }
QVariant OttavaSegment::propertyDefault(P_ID id) const { switch (id) { case P_OTTAVA_TYPE: return ottava()->propertyDefault(id); default: return TextLineSegment::propertyDefault(id); } }
bool OttavaSegment::setProperty(P_ID id, const QVariant& v) { switch (id) { case P_OTTAVA_TYPE: return ottava()->setProperty(id, v); default: return TextLineSegment::setProperty(id, v); } }
void OttavaSegment::undoChangeProperty(Pid id, const QVariant& v, PropertyFlags ps) { if (id == Pid::OTTAVA_TYPE || id == Pid::NUMBERS_ONLY || id == Pid::PLACEMENT) { ScoreElement::undoChangeProperty(id, v, ps); ottava()->updateStyledProperties(); } else { ScoreElement::undoChangeProperty(id, v, ps); } }
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(); }
QVariant OttavaSegment::getProperty(P_ID id) const { switch (id) { case P_ID::OTTAVA_TYPE: case P_ID::PLACEMENT: case P_ID::NUMBERS_ONLY: return ottava()->getProperty(id); default: return TextLineBaseSegment::getProperty(id); } }
bool OttavaSegment::setProperty(P_ID id, const QVariant& v) { switch (id) { case P_ID::LINE_WIDTH: case P_ID::LINE_STYLE: case P_ID::OTTAVA_TYPE: case P_ID::NUMBERS_ONLY: return ottava()->setProperty(id, v); default: return TextLineSegment::setProperty(id, v); } }
void OttavaSegment::resetProperty(P_ID id) { switch (id) { case P_ID::OTTAVA_TYPE: case P_ID::LINE_WIDTH: case P_ID::LINE_STYLE: case P_ID::NUMBERS_ONLY: return ottava()->resetProperty(id); default: return TextLineSegment::resetProperty(id); } }
PropertyStyle OttavaSegment::propertyStyle(P_ID id) const { switch (id) { case P_ID::OTTAVA_TYPE: case P_ID::LINE_WIDTH: case P_ID::LINE_STYLE: case P_ID::NUMBERS_ONLY: return ottava()->propertyStyle(id); default: return TextLineSegment::propertyStyle(id); } }
QVariant OttavaSegment::propertyDefault(P_ID id) const { switch (id) { case P_ID::LINE_WIDTH: case P_ID::LINE_STYLE: case P_ID::OTTAVA_TYPE: case P_ID::PLACEMENT: case P_ID::NUMBERS_ONLY: return ottava()->propertyDefault(id); default: return TextLineSegment::propertyDefault(id); } }
void OttavaSegment::styleChanged() { ottava()->styleChanged(); }