예제 #1
0
파일: key.cpp 프로젝트: SSMN/MuseScore
void KeyList::read(QDomElement e, Score* cs)
      {
      for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
            QString tag(e.tagName());
            if (tag == "key") {
                  KeySigEvent ke;
                  int tick = e.attribute("tick", "0").toInt();
                  if (e.hasAttribute("custom"))
                        ke.setCustomType(e.attribute("custom").toInt());
                  else
                        ke.setAccidentalType(e.attribute("idx").toInt());
                  (*this)[cs->fileDivision(tick)] = ke;
                  }
            else
                  domError(e);
            }
      }
예제 #2
0
파일: key.cpp 프로젝트: akinsgre/MuseScore
void KeyList::read(XmlReader& e, Score* cs)
      {
      while (e.readNextStartElement()) {
            if (e.name() == "key") {
                  KeySigEvent ke;
                  int tick = e.intAttribute("tick", 0);
                  if (e.hasAttribute("custom"))
                        ke.setCustomType(e.intAttribute("custom"));
                  else
                        ke.setAccidentalType(e.intAttribute("idx"));
                  (*this)[cs->fileDivision(tick)] = ke;
                  e.readNext();
                  }
            else
                  e.unknown();
            }
      }