void Ottava::setSubtype(int val) { setEndHook(true); Element::setSubtype(val); switch(val) { case 0: setBeginText("8va", TEXT_STYLE_OTTAVA); setContinueText("(8va)", TEXT_STYLE_OTTAVA); setEndHookHeight(Spatium(1.5)); _pitchShift = 12; break; case 1: setBeginText("15ma", TEXT_STYLE_OTTAVA); setContinueText("(15ma)", TEXT_STYLE_OTTAVA); setEndHookHeight(Spatium(1.5)); _pitchShift = 24; break; case 2: setBeginText("8vb", TEXT_STYLE_OTTAVA); setContinueText("(8vb)", TEXT_STYLE_OTTAVA); setEndHookHeight(Spatium(-1.5)); _pitchShift = -12; break; case 3: setBeginText("15mb", TEXT_STYLE_OTTAVA); setContinueText("(15mb)", TEXT_STYLE_OTTAVA); setEndHookHeight(Spatium(-1.5)); _pitchShift = -24; break; } }
void Ottava::setOttavaType(OttavaType val) { setEndHook(true); _ottavaType = val; Spatium hook(score()->styleS(ST_ottavaHook)); SymId id; if (_numbersOnly) id = ottavaDefault[int(val)].numbersOnlyId; else id = ottavaDefault[int(val)].id; if (beginSymbolStyle == PropertyStyle::STYLED) setBeginSymbol(id); if (continueSymbolStyle == PropertyStyle::STYLED) setContinueSymbol(id); setBeginSymbolOffset(ottavaDefault[int(val)].offset); setContinueSymbolOffset(ottavaDefault[int(val)].offset); setEndHookHeight(hook * ottavaDefault[int(val)].hookDirection); setPlacement(ottavaDefault[int(val)].place); _pitchShift = ottavaDefault[int(val)].shift; foreach(SpannerSegment* s, spannerSegments()) { OttavaSegment* os = static_cast<OttavaSegment*>(s); os->clearText(); }
bool Pedal::setProperty(P_ID propertyId, const QVariant& val) { switch (propertyId) { case P_ID::PLACEMENT: if (val != getProperty(propertyId)) { // reverse hooks setBeginHookHeight(-beginHookHeight()); setEndHookHeight(-endHookHeight()); } setPlacement(Placement(val.toInt())); break; case P_ID::LINE_WIDTH: lineWidthStyle = PropertyStyle::UNSTYLED; TextLineBase::setProperty(propertyId, val); break; case P_ID::LINE_STYLE: lineStyleStyle = PropertyStyle::UNSTYLED; TextLineBase::setProperty(propertyId, val); break; default: if (!TextLineBase::setProperty(propertyId, val)) return false; break; } score()->setLayoutAll(); return true; }
void Volta::layout() { setLineWidth(score()->styleS(ST_voltaLineWidth)); Spatium hook(score()->styleS(ST_voltaHook)); setBeginHookHeight(hook); setEndHookHeight(hook); TextLine::layout(); }
Pedal::Pedal(Score* s) : TextLine(s) { setBeginSymbol(pedalPedSym); setBeginSymbolOffset(QPointF(0.0, -.2)); setEndHook(true); setBeginHookHeight(Spatium(-1.2)); setEndHookHeight(Spatium(-1.2)); }
Pedal::Pedal(Score* s) : TextLine(s) { setBeginHookHeight(Spatium(-1.2)); setEndHookHeight(Spatium(-1.2)); setLineWidth(score()->styleS(StyleIdx::pedalLineWidth)); lineWidthStyle = PropertyStyle::STYLED; setLineStyle(Qt::PenStyle(score()->styleI(StyleIdx::pedalLineStyle))); lineStyleStyle = PropertyStyle::STYLED; }
void Ottava::setOttavaType(OttavaType val) { if (val == _ottavaType) return; setEndHook(true); _ottavaType = val; Spatium hook(score()->styleS(ST_ottavaHook)); const TextStyle& ts = score()->textStyle(TEXT_STYLE_OTTAVA); switch(val) { case OTTAVA_8VA: setBeginText("8va", ts); setContinueText("(8va)", ts); setEndHookHeight(hook); _pitchShift = 12; break; case OTTAVA_15MA: setBeginText("15ma", ts); setContinueText("(15ma)", ts); setEndHookHeight(hook); _pitchShift = 24; break; case OTTAVA_8VB: setBeginText("8vb", ts); setContinueText("(8vb)", ts); _pitchShift = -12; setEndHookHeight(-hook); break; case OTTAVA_15MB: setBeginText("15mb", ts); setContinueText("(15mb)", ts); _pitchShift = -24; setEndHookHeight(-hook); break; } foreach(SpannerSegment* s, spannerSegments()) { OttavaSegment* os = static_cast<OttavaSegment*>(s); os->clearText(); }
bool Ottava::setProperty(P_ID propertyId, const QVariant& val) { switch (propertyId) { case P_ID::OTTAVA_TYPE: setOttavaType(Type(val.toInt())); break; case P_ID::PLACEMENT: if (val != getProperty(propertyId)) { // reverse hooks setBeginHookHeight(-beginHookHeight()); setEndHookHeight(-endHookHeight()); } TextLine::setProperty(propertyId, val); 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_TICKS: setTicks(val.toInt()); staff()->updateOttava(); break; case P_ID::SPANNER_TICK: setTick(val.toInt()); staff()->updateOttava(); break; default: if (!TextLine::setProperty(propertyId, val)) return false; break; } score()->setLayoutAll(true); return true; }
void Ottava::setOttavaType(Type val) { setEndHook(true); _ottavaType = val; const OttavaDefault* def = &ottavaDefault[int(_ottavaType)]; if (beginTextStyle == PropertyStyle::STYLED) setBeginText(propertyDefault(P_ID::BEGIN_TEXT).toString(), TextStyleType::OTTAVA); if (continueTextStyle == PropertyStyle::STYLED) setContinueText(propertyDefault(P_ID::CONTINUE_TEXT).toString(), TextStyleType::OTTAVA); setEndHookHeight(score()->styleS(StyleIdx::ottavaHook) * def->hookDirection); setPlacement(def->place); _pitchShift = def->shift; }
Volta::Volta(Score* s) : TextLine(s) { _voltaType = VoltaType::OPEN; setBeginText("1.", s->textStyle(TEXT_STYLE_VOLTA)); setBeginTextPlace(PLACE_BELOW); setContinueTextPlace(PLACE_BELOW); setBeginHook(true); Spatium hook(s->styleS(ST_voltaHook)); setBeginHookHeight(hook); setEndHookHeight(hook); setAnchor(ANCHOR_MEASURE); }
Volta::Volta(Score* s) : TextLine(s) { setLineWidth(Spatium(.18)); setBeginText("1.", TEXT_STYLE_VOLTA); setBeginTextPlace(PLACE_BELOW); setContinueTextPlace(PLACE_BELOW); setBeginHook(true); setBeginHookHeight(Spatium(1.9)); setYoff(-4.0); setEndHookHeight(Spatium(1.9)); setAnchor(ANCHOR_MEASURE); }
Volta::Volta(Score* s) : TextLine(s) { setBeginText("1.", TextStyleType::VOLTA); setBeginTextPlace(PlaceText::BELOW); setContinueTextPlace(PlaceText::BELOW); setBeginHook(true); Spatium hook(s->styleS(StyleIdx::voltaHook)); setBeginHookHeight(hook); setEndHookHeight(hook); setAnchor(Anchor::MEASURE); setLineWidth(score()->styleS(StyleIdx::voltaLineWidth)); lineWidthStyle = PropertyStyle::STYLED; }
Volta::Volta(Score* s) : TextLine(s) { _voltaType = VoltaType::OPEN; setBeginText("1.", TEXT_STYLE_VOLTA); setBeginTextPlace(PLACE_BELOW); setContinueTextPlace(PLACE_BELOW); setBeginHook(true); Spatium hook(s->styleS(ST_voltaHook)); setBeginHookHeight(hook); setEndHookHeight(hook); setAnchor(ANCHOR_MEASURE); setLineWidth(score()->styleS(ST_voltaLineWidth)); lineWidthStyle = PropertyStyle::STYLED; }
bool TextLine::setProperty(P_ID propertyId, const QVariant& val) { switch (propertyId) { case P_ID::PLACEMENT: if (val != getProperty(propertyId)) { // reverse hooks setBeginHookHeight(-beginHookHeight()); setEndHookHeight(-endHookHeight()); } TextLineBase::setProperty(propertyId, val); break; default: if (!TextLineBase::setProperty(propertyId, val)) return false; break; } score()->setLayoutAll(); return true; }
TextLine::TextLine(Score* s) : TextLineBase(s) { initElementStyle(&textLineStyle); setPlacement(Placement::ABOVE); setBeginText(""); setContinueText(""); setEndText(""); setBeginTextOffset(QPointF(0,0)); setContinueTextOffset(QPointF(0,0)); setEndTextOffset(QPointF(0,0)); setLineVisible(true); setBeginHookType(HookType::NONE); setEndHookType(HookType::NONE); setBeginHookHeight(Spatium(1.5)); setEndHookHeight(Spatium(1.5)); resetProperty(Pid::BEGIN_TEXT_PLACE); resetProperty(Pid::CONTINUE_TEXT_PLACE); resetProperty(Pid::END_TEXT_PLACE); }