Exemplo n.º 1
0
void Marker::read(XmlReader* r)
      {
      MarkerType mt;
      while (r->readElement()) {
            QString s;
            if (r->readString("label", &s)) {
                  setLabel(s);
                  mt = markerType(s);
                  }
            else if (!Text::readProperties(r))
                  r->unknown();
            }
      switch(mt) {
            case MARKER_SEGNO:
            case MARKER_CODA:
            case MARKER_VARCODA:
            case MARKER_CODETTA:
                  setTextStyle(TEXT_STYLE_REPEAT_LEFT);
                  break;

            case MARKER_FINE:
            case MARKER_TOCODA:
                  setTextStyle(TEXT_STYLE_REPEAT_RIGHT);
                  break;

            case MARKER_USER:
                  setTextStyle(TEXT_STYLE_REPEAT);
                  break;
            }
      setMarkerType(mt);
      }
Exemplo n.º 2
0
void ZLTextView::ViewStyle::applyControl(const ZLTextControlElement &control) {
	if (control.isStart()) {
		const ZLTextStyleDecoration *decoration = ZLTextStyleCollection::instance().decoration(control.textKind());
		if (decoration != 0) {
			setTextStyle(decoration->createDecoratedStyle(myTextStyle));
		}
	} else {
		if (myTextStyle->isDecorated()) {
			setTextStyle(((ZLTextDecoratedStyle&)*myTextStyle).base());
		}
	}
}
Exemplo n.º 3
0
Marker::Marker(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setSubtype(TEXT_REPEAT);
      setTextStyle(TEXT_STYLE_REPEAT);
      }
Exemplo n.º 4
0
TempoText::TempoText(Score* s)
   : Text(s)
      {
      _tempo      = 2.0;
      _followText = false;
      setTextStyle(s->textStyle(TEXT_STYLE_TEMPO));
      }
Exemplo n.º 5
0
void TextProp::setStyle(TextStyleType st, const TextStyle& ts)
      {
      st = TextStyleType(styles->findData(int(st))); // find a combo item with that style idx
      if (int(st) < 0)                    // if none found...
            st = TextStyleType::DEFAULT;  // ...=> first combo item
      styles->setCurrentIndex(int(st));   // set current combo item
      setTextStyle(ts);
      }
Exemplo n.º 6
0
Dynamic::Dynamic(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      _velocity = -1;
      setTextStyle(TEXT_STYLE_DYNAMICS);
      _dynType  = DYNAMIC_PART;
      }
Exemplo n.º 7
0
TempoText::TempoText(Score* s)
   : Text(s)
      {
      _tempo      = 2.0;      // propertyDefault(P_TEMPO).toDouble();
      _followText = false;
      setPlacement(ABOVE);
      setTextStyle(s->textStyle(TEXT_STYLE_TEMPO));
      }
Exemplo n.º 8
0
StaffText::StaffText(Score* s)
   : Text(s)
      {
      setSubtype(TEXT_STAFF);
      setTextStyle(TEXT_STYLE_STAFF);
      _setAeolusStops = false;
      clearAeolusStops();
      }
Exemplo n.º 9
0
void Text::styleChanged()
      {
      if (styled()) {
            if (_styleIndex != TEXT_STYLE_UNKNOWN)
                  setTextStyle(score()->textStyle(_styleIndex));
            setText(getText());     // destroy formatting
            score()->setLayoutAll(true);
            }
      }
Exemplo n.º 10
0
Lyrics::Lyrics(Score* s)
   : Text(s)
      {
      setTextStyle(TEXT_STYLE_LYRIC1);
      _no          = 0;
      _ticks       = 0;
      _syllabic    = SINGLE;
      _verseNumber = 0;
      }
Exemplo n.º 11
0
void Text::setTextStyleType(int st)
      {
      if (st == _styleIndex)
            return;
      _styleIndex = st;
      if (st != TEXT_STYLE_UNKNOWN)
            setTextStyle(score()->textStyle(st));
      if (_doc && !_doc->isEmpty() && !_editMode) {
            SimpleText::setText(_doc->toPlainText());
            delete _doc;
            _doc = 0;
            }
      }
Exemplo n.º 12
0
bool Text::readProperties(XmlReader* r)
      {
      MString8 tag = r->tag();
      QString val;
      int i;
      qreal d;
      Color color;

      if (r->readString("style", &val)) {
            setTextStyle(score()->style().textStyleType(val));
            if (textStyle() != TEXT_STYLE_INVALID)
                  _styled = true;
            }
      else if (r->readInt("spatiumSizeDependent", &i)) {
            setSizeIsSpatiumDependent(i);
            _styled = false;
            }
      else if (r->readInt("frame", &i)) {
            setHasFrame(i);
            _styled = false;
            }
      else if (r->readString("text", &val))
            setText(val);
      else if (tag == "frameWidth") {
            setFrameWidth(val.toDouble());
            setHasFrame(true);
            _styled = false;
            }
      else if (r->readReal("paddingWidth", &d)) {
            setPaddingWidth(d);
            _styled = false;
            }
      else if (r->readColor("frameColor", &color)) {
//            setFrameColor(readColor(e));
            _styled = false;
            }
      else if (r->readInt("frameRound", &i)) {
            setFrameRound(i);
            _styled = false;
            }
      else if (r->readInt("circle", &i)) {
            setCircle(i);
            _styled = false;
            }
      else if (_localStyle.readProperties(r))
            _styled = false;
      else if (!Element::readProperties(r))
            return false;
      return true;
      }
Exemplo n.º 13
0
void Jump::read(const QDomElement& de)
      {
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            if (tag == "jumpTo")
                  _jumpTo = e.text();
            else if (tag == "playUntil")
                  _playUntil = e.text();
            else if (tag == "continueAt")
                  _continueAt = e.text();
            else if (!Text::readProperties(e))
                  domError(e);
            }
      setTextStyle(score()->textStyle(TEXT_STYLE_REPEAT_RIGHT));
      }
Exemplo n.º 14
0
void Jump::read(XmlReader* r)
      {
      while (r->readElement()) {
            QString s;
            if (r->readString("jumpTo", &_jumpTo))
                  ;
            else if (r->readString("playUntil", &_playUntil))
                  ;
            else if (r->readString("continueAt", &_continueAt))
                  ;
            else if (!Text::readProperties(r))
                  r->unknown();
            }
      setTextStyle(TEXT_STYLE_REPEAT_RIGHT);
      }
Exemplo n.º 15
0
Lyrics::Lyrics(const Lyrics& l)
   : Text(l)
      {
      _no  = l._no;
      setTextStyle((_no % 2) ? TEXT_STYLE_LYRIC2 : TEXT_STYLE_LYRIC1);
      _ticks = l._ticks;
      _syllabic = l._syllabic;
      if (l._verseNumber)
            _verseNumber = new Text(*l._verseNumber);
      else
            _verseNumber = 0;
      QList<Line*> _separator;
      foreach(Line* l, l._separator)
            _separator.append(new Line(*l));
      }
Exemplo n.º 16
0
void Dynamic::read(XmlReader* r)
      {
      int i;
      while (r->readElement()) {
            if (r->readInt("velocity", &_velocity))
                  ;
            else if (r->readInt("dynType", &i))
                  _dynType = DynamicType(i);
            else if (!Text::readProperties(r))
                  r->unknown();
            }
      setSubtype(subtype());
      if (score()->mscVersion() < 118) {
            setTextStyle(TEXT_STYLE_DYNAMICS);
            setStyled(true);
            }
      }
Exemplo n.º 17
0
void FiguredBass::layout()
      {
      if (!styled())
            setTextStyle(TEXT_STYLE_FIGURED_BASS);
      Lyrics::layout();
      qreal lh = lineSpacing() * score()->styleD(ST_figuredBassLineHeight);

      System* sys = measure()->system();
      if (sys == 0) {
            qDebug("lyrics layout: no system!");
            abort();
            }
      const QList<Lyrics*>* ll = &(chordRest()->lyricsList());

      int line = ll->indexOf(this);
      qreal y  = lh * line + point(score()->styleS(ST_figuredBassDistance))
                 + sys->staff(staffIdx())->bbox().height();
      QString s = getText();
      qreal x = symbols[score()->symIdx()][quartheadSym].width(magS()) * .5;
      QFontMetricsF fm(style().font(spatium()));
      for (int i = 0; i < s.size(); ++i) {
            if (s[i].isNumber()) {
                  if (i)
                        x += -fm.width(s.left(i));
                  int startIdx = i;
                  for (; i < s.size(); ++i) {
                        if (!s[i].isNumber())
                              break;
                        }
                  x += -(fm.width(s.mid(startIdx, i - startIdx)) * .5);
                  break;
                  }
            }
      x -= spatium() * .25;  // DEBUG
      setPos(x, y);
      }
Exemplo n.º 18
0
void ZLTextView::ViewStyle::applyControl(const ZLTextForcedControlElement &control) {
	setTextStyle(new ZLTextForcedStyle(myTextStyle, control.entry()));
}
Exemplo n.º 19
0
Fingering::Fingering(Score* s)
  : Text(s)
      {
      setTextStyle(s->textStyle(TEXT_STYLE_FINGERING));
      setFlag(ELEMENT_HAS_TAG, true);
      }
Exemplo n.º 20
0
Marker::Marker(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE | ELEMENT_ON_STAFF);
      setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
      }
Exemplo n.º 21
0
Jump::Jump(Score* s)
   : Text(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
      }
Exemplo n.º 22
0
FiguredBass::FiguredBass(Score* s)
   : Lyrics(s)
      {
      setTextStyle(TEXT_STYLE_FIGURED_BASS);
      }
Exemplo n.º 23
0
void TextProp::styleIndexChanged(int i)
      {
      int idx = styles->itemData(i).toInt();
      setTextStyle(_score->textStyle(TextStyleType(idx)));
      }
Exemplo n.º 24
0
void TextProp::doResetToTextStyle()
      {
      setTextStyle(_score->textStyle(textStyleType()));
      }
Exemplo n.º 25
0
InstrumentChange::InstrumentChange(Score* s)
   : Text(s)
      {
      setTextStyle(s->textStyle(TEXT_STYLE_INSTRUMENT_CHANGE));
      }
Exemplo n.º 26
0
static void setTextStyles(const ColorSettings& settings)
{
	setTextStyle(nppData._scintillaMainHandle, settings);
	setTextStyle(nppData._scintillaSecondHandle, settings);
}
Exemplo n.º 27
0
void ZLTextView::ViewStyle::reset() {
	setTextStyle(ZLTextStyleCollection::instance().baseStylePtr());
}
Exemplo n.º 28
0
ZLTextView::ViewStyle::ViewStyle(shared_ptr<ZLPaintContext> context) : myContext(context) {
	setTextStyle(ZLTextStyleCollection::instance().baseStylePtr());
	myWordHeight = -1;
}