本文整理汇总了C++中MasterScore::addExcerpt方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::addExcerpt方法的具体用法?C++ MasterScore::addExcerpt怎么用?C++ MasterScore::addExcerpt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::addExcerpt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
//.........这里部分代码省略.........
e.skipCurrentElement();
else {
if (isMaster()) {
Excerpt* ex = new Excerpt(static_cast<MasterScore*>(this));
ex->read(e);
excerpts().append(ex);
}
else {
qDebug("Score::read(): part cannot have parts");
e.skipCurrentElement();
}
}
}
else if (e.name() == "Tracklist") {
int strack = e.intAttribute("sTrack", -1);
int dtrack = e.intAttribute("dstTrack", -1);
if (strack != -1 && dtrack != -1)
e.tracks().insert(strack, dtrack);
e.skipCurrentElement();
}
else if (tag == "Score") { // recursion
if (MScore::noExcerpts)
e.skipCurrentElement();
else {
e.tracks().clear(); // ???
MasterScore* m = masterScore();
Score* s = new Score(m, MScore::baseStyle());
Excerpt* ex = new Excerpt(m);
ex->setPartScore(s);
e.setLastMeasure(nullptr);
s->read(e);
ex->setTracks(e.tracks());
m->addExcerpt(ex);
}
}
else if (tag == "name") {
QString n = e.readElementText();
if (!isMaster()) //ignore the name if it's not a child score
excerpt()->setTitle(n);
}
else if (tag == "layoutMode") {
QString s = e.readElementText();
if (s == "line")
_layoutMode = LayoutMode::LINE;
else if (s == "system")
_layoutMode = LayoutMode::SYSTEM;
else
qDebug("layoutMode: %s", qPrintable(s));
}
else
e.unknown();
}
e.reconnectBrokenConnectors();
if (e.error() != QXmlStreamReader::NoError) {
qDebug("%s: xml read error at line %lld col %lld: %s",
qPrintable(e.getDocName()), e.lineNumber(), e.columnNumber(),
e.name().toUtf8().data());
MScore::lastError = QObject::tr("XML read error at line %1, column %2: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.name().toString());
return false;
}
connectTies();
_fileDivision = MScore::division;