bool Articulation::setProperty(P_ID propertyId, const QVariant& v) { score()->addRefresh(canvasBoundingRect()); switch (propertyId) { case P_DIRECTION: setDirection(MScore::Direction(v.toInt())); break; case P_ARTICULATION_ANCHOR: anchorStyle = PropertyStyle::UNSTYLED; setAnchor(ArticulationAnchor(v.toInt())); break; case P_TIME_STRETCH: setTimeStretch(v.toDouble()); score()->fixTicks(); break; default: return Element::setProperty(propertyId, v); } score()->addRefresh(canvasBoundingRect()); // layout: if (chordRest()) chordRest()->layoutArticulations(); else if (parent() && parent()->type() == BAR_LINE) static_cast<BarLine*>(parent())->layout(); score()->addRefresh(canvasBoundingRect()); score()->setLayoutAll(false); //DEBUG return true; }
bool Articulation::setProperty(P_ID propertyId, const QVariant& v) { switch (propertyId) { case P_ID::DIRECTION: setDirection(v.value<Direction>()); break; case P_ID::ARTICULATION_ANCHOR: setAnchor(ArticulationAnchor(v.toInt())); break; case P_ID::PLAY: setPlayArticulation(v.toBool()); break; case P_ID::ORNAMENT_STYLE: setOrnamentStyle(MScore::OrnamentStyle(v.toInt())); break; case P_ID::TIME_STRETCH: setTimeStretch(v.toDouble()); score()->fixTicks(); break; default: return Element::setProperty(propertyId, v); } triggerLayout(); return true; }
bool Fermata::setProperty(Pid propertyId, const QVariant& v) { switch (propertyId) { case Pid::PLACEMENT: { Placement p = Placement(v.toInt()); if (p != placement()) { QString s = Sym::id2name(_symId); bool up = placeAbove(); if (s.endsWith(up ? "Above" : "Below")) { QString s2 = s.left(s.size() - 5) + (up ? "Below" : "Above"); _symId = Sym::name2id(s2); } setPlacement(p); } } break; case Pid::PLAY: setPlay(v.toBool()); break; case Pid::TIME_STRETCH: setTimeStretch(v.toDouble()); score()->fixTicks(); break; default: return Element::setProperty(propertyId, v); } triggerLayout(); return true; }
bool Articulation::setProperty(P_ID propertyId, const QVariant& v) { score()->addRefresh(canvasBoundingRect()); switch (propertyId) { case P_ID::DIRECTION: setDirection(MScore::Direction(v.toInt())); break; case P_ID::ARTICULATION_ANCHOR: anchorStyle = PropertyStyle::UNSTYLED; setAnchor(ArticulationAnchor(v.toInt())); break; case P_ID::PLAY: setPlayArticulation(v.toBool()); break; case P_ID::ORNAMENT_STYLE: setOrnamentStyle(MScore::OrnamentStyle(v.toInt())); break; case P_ID::TIME_STRETCH: setTimeStretch(v.toDouble()); score()->fixTicks(); break; case P_ID::USER_OFF: setUserOff(v.toPointF()); if (_articulationType == ArticulationType::Tenuto) { // moving a tenuto may move slurs: score()->setLayoutAll(true); } return true; default: return Element::setProperty(propertyId, v); } // layout: if (chordRest()) chordRest()->layoutArticulations(); else if (parent() && parent()->type() == Element::Type::BAR_LINE) static_cast<BarLine*>(parent())->layout(); score()->addRefresh(canvasBoundingRect()); score()->setLayoutAll(false); // DEBUG canvasBoundingRectChanged(); // rebuild bsp tree return true; }