Exemple #1
0
void StaffTypeTablature::init()
      {
      // set reasonable defaults for type-specific members */
      setDurationFontName(_durationFonts[0].displayName);
      setDurationFontSize(15.0);
      setDurationFontUserY(0.0);
      setFretFontName(_fretFonts[0].displayName);
      setFretFontSize(10.0);
      setFretFontUserY(0.0);
      setGenDurations(false);
      setGenTimesig(false);
      setLineDistance(Spatium(TAB_DEFAULT_LINE_SP));
      setLines(6);
      setLinesThrough(false);
      setMinimStyle(TAB_MINIM_NONE);
      setOnLines(true);
      setShowRests(false);
      setStemsDown(true);
      setStemsThrough(true);
      setUpsideDown(false);
      setUseNumbers(true);
      // internal
      _durationMetricsValid = _fretMetricsValid = false;
      _durationBoxH = _durationBoxY = _durationYOffset = _fretBoxH = _fretBoxY = _fretYOffset = _refDPI = 0.0;
      }
Exemple #2
0
void StaffTypeTablature::read(const QDomElement& de)
      {
      for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            const QString& tag(e.tagName());
            const QString& val(e.text());

            if (tag == "durations")
                  setGenDurations(val.toInt() != 0);
            else if (tag == "durationFontName")
                  setDurationFontName(e.text());
            else if (tag == "durationFontSize")
                  setDurationFontSize(val.toDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(val.toDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.text());
            else if (tag == "fretFontSize")
                  setFretFontSize(val.toDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(val.toDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(val.toInt() != 0);
            else if (tag == "minimStyle")
                  setMinimStyle( (TablatureMinimStyle) val.toInt() );
            else if (tag == "onLines")
                  setOnLines(val.toInt() != 0);
            else if (tag == "showRests")
                  setShowRests(val.toInt() != 0);
            else if (tag == "stemsDown")
                  setStemsDown(val.toInt() != 0);
            else if (tag == "stemsThrough")
                  setStemsThrough(val.toInt() != 0);
            else if (tag == "upsideDown")
                  setUpsideDown(val.toInt() != 0);
            else if (tag == "useNumbers")
                  setUseNumbers(val.toInt() != 0);
            else
                  if(!StaffType::readProperties(e))
                        domError(e);
            }
      }
Exemple #3
0
void StaffTypeTablature::read(XmlReader& e)
      {
      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());

            if (tag == "durations")
                  setGenDurations(e.readInt() != 0);
            else if (tag == "durationFontName")
                  setDurationFontName(e.readElementText());
            else if (tag == "durationFontSize")
                  setDurationFontSize(e.readDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(e.readDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.readElementText());
            else if (tag == "fretFontSize")
                  setFretFontSize(e.readDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(e.readDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(e.readInt() != 0);
            else if (tag == "minimStyle")
                  setMinimStyle( (TablatureMinimStyle) e.readInt() );
            else if (tag == "onLines")
                  setOnLines(e.readInt() != 0);
            else if (tag == "showRests")
                  setShowRests(e.readInt() != 0);
            else if (tag == "stemsDown")
                  setStemsDown(e.readInt() != 0);
            else if (tag == "stemsThrough")
                  setStemsThrough(e.readInt() != 0);
            else if (tag == "upsideDown")
                  setUpsideDown(e.readInt() != 0);
            else if (tag == "useNumbers")
                  setUseNumbers(e.readInt() != 0);
            else
                  if (!StaffType::readProperties(e))
                        e.unknown();
            }
      }
Exemple #4
0
void StaffType::read(XmlReader& e)
      {
      QString group = e.attribute("group", fileGroupNames[(int)StaffGroup::STANDARD]);
      if (group == fileGroupNames[(int)StaffGroup::TAB])
            _group = StaffGroup::TAB;
      else if (group == fileGroupNames[(int)StaffGroup::PERCUSSION])
            _group = StaffGroup::PERCUSSION;
      else if (group == fileGroupNames[(int)StaffGroup::STANDARD])
            _group = StaffGroup::STANDARD;
      else {
            qDebug("StaffType::read: unknown group: %s", qPrintable(group));
            _group = StaffGroup::STANDARD;
            }

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "name")
                  setXmlName(e.readElementText());
            else if (tag == "lines")
                  setLines(e.readInt());
            else if (tag == "lineDistance")
                  setLineDistance(Spatium(e.readDouble()));
            else if (tag == "clef")
                  setGenClef(e.readInt());
            else if (tag == "slashStyle")
                  setSlashStyle(e.readInt());
            else if (tag == "barlines")
                  setShowBarlines(e.readInt());
            else if (tag == "timesig")
                  setGenTimesig(e.readInt());
            else if (tag == "keysig")
                  _genKeysig = e.readInt();
            else if (tag == "ledgerlines")
                  _showLedgerLines = e.readInt();
            else if (tag == "durations")
                  setGenDurations(e.readBool());
            else if (tag == "durationFontName")
                  setDurationFontName(e.readElementText());
            else if (tag == "durationFontSize")
                  setDurationFontSize(e.readDouble());
            else if (tag == "durationFontY")
                  setDurationFontUserY(e.readDouble());
            else if (tag == "fretFontName")
                  setFretFontName(e.readElementText());
            else if (tag == "fretFontSize")
                  setFretFontSize(e.readDouble());
            else if (tag == "fretFontY")
                  setFretFontUserY(e.readDouble());
            else if (tag == "linesThrough")
                  setLinesThrough(e.readBool());
            else if (tag == "minimStyle")
                  setMinimStyle( (TablatureMinimStyle) e.readInt() );
            else if (tag == "onLines")
                  setOnLines(e.readBool());
            else if (tag == "showRests")
                  setShowRests(e.readBool());
            else if (tag == "stemsDown")
                  setStemsDown(e.readBool());
            else if (tag == "stemsThrough")
                  setStemsThrough(e.readBool());
            else if (tag == "upsideDown")
                  setUpsideDown(e.readBool());
            else if (tag == "useNumbers")
                  setUseNumbers(e.readBool());
            else
                  e.unknown();
            }
      }