Esempio n. 1
0
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;
      }
Esempio n. 2
0
void Volta::layout()
      {
      setLineWidth(score()->styleS(ST_voltaLineWidth));
      Spatium hook(score()->styleS(ST_voltaHook));
      setBeginHookHeight(hook);
      setEndHookHeight(hook);
      TextLine::layout();
      }
Esempio n. 3
0
Pedal::Pedal(Score* s)
   : TextLine(s)
      {
      setBeginSymbol(pedalPedSym);
      setBeginSymbolOffset(QPointF(0.0, -.2));

      setEndHook(true);
      setBeginHookHeight(Spatium(-1.2));
      setEndHookHeight(Spatium(-1.2));
      }
Esempio n. 4
0
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;
      }
Esempio n. 5
0
Ottava::Ottava(Score* s)
   : TextLineBase(s, ElementFlag::ON_STAFF | ElementFlag::MOVABLE)
      {
      _ottavaType = OttavaType::OTTAVA_8VA;
      setBeginTextPlace(PlaceText::LEFT);
      setContinueTextPlace(PlaceText::LEFT);
      setEndHookType(HookType::HOOK_90);
      setLineVisible(true);
      setBeginHookHeight(Spatium(.0));
      setEndText("");

      initElementStyle(&ottavaStyle);
      }
Esempio n. 6
0
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;
      }
Esempio n. 7
0
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);
}
Esempio n. 8
0
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);
      }
Esempio n. 9
0
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;
      }
Esempio n. 10
0
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;
      }
Esempio n. 11
0
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;
      }
Esempio n. 12
0
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);
      }