本文整理汇总了C++中MasterScore::scoreList方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::scoreList方法的具体用法?C++ MasterScore::scoreList怎么用?C++ MasterScore::scoreList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::scoreList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readCreatedScore
MasterScore* MTest::readCreatedScore(const QString& name)
{
MasterScore* score = new MasterScore(mscore->baseStyle());
QFileInfo fi(name);
score->setName(fi.completeBaseName());
QString csl = fi.suffix().toLower();
ScoreLoad sl;
Score::FileError rv;
if (csl == "cap") {
rv = importCapella(score, name);
score->setMetaTag("originalFormat", csl);
}
else if (csl == "capx") {
rv = importCapXml(score, name);
score->setMetaTag("originalFormat", csl);
}
else if (csl == "ove")
rv = importOve(score, name);
else if (csl == "sgu")
rv = importBB(score, name);
else if (csl == "mscz" || csl == "mscx")
rv = score->loadMsc(name, false);
else if (csl == "mxl")
rv = importCompressedMusicXml(score, name);
#ifdef OMR
else if (csl == "pdf")
rv = importPdf(score, name);
#endif
else if (csl == "xml" || csl == "musicxml")
rv = importMusicXml(score, name);
else if (csl == "gp3" || csl == "gp4" || csl == "gp5" || csl == "gpx")
rv = importGTP(score, name);
else
rv = Score::FileError::FILE_UNKNOWN_TYPE;
if (rv != Score::FileError::FILE_NO_ERROR) {
QWARN(qPrintable(QString("readScore: cannot load <%1> type <%2>\n").arg(name).arg(csl)));
delete score;
score = 0;
}
else {
for (Score* s : score->scoreList())
s->doLayout();
}
return score;
}
示例2: editInstrList
//.........这里部分代码省略.........
PartListItem* pli = (PartListItem*)pl->topLevelItem(idx);
if (pli->op == ListItemOp::I_DELETE)
continue;
QTreeWidgetItem* ci = 0;
for (int cidx = 0; (ci = pli->child(cidx)); ++cidx) {
StaffListItem* sli = (StaffListItem*) ci;
if (sli->op() == ListItemOp::I_DELETE)
continue;
dst.push_back(sli->staff());
}
}
QList<int> dl;
int idx2 = 0;
bool sort = false;
for (Staff* staff : dst) {
int idx = masterScore->staves().indexOf(staff);
if (idx == -1)
qDebug("staff in dialog(%p) not found in score", staff);
else
dl.push_back(idx);
if (idx != idx2)
sort = true;
++idx2;
}
if (sort)
masterScore->undo(new SortStaves(masterScore, dl));
//
// check for valid barLineSpan and bracketSpan
// in all staves
//
for (Score* s : masterScore->scoreList()) {
int n = s->nstaves();
int curSpan = 0;
for (int j = 0; j < n; ++j) {
Staff* staff = s->staff(j);
int span = staff->barLineSpan();
int setSpan = -1;
// determine if we need to update barline span
if (curSpan == 0) {
// no current span; this staff must start a new one
if (span == 0) {
// no span; this staff must have been within a span
// update it to a span of 1
setSpan = j;
}
else if (span > (n - j)) {
// span too big; staves must have been removed
// reduce span to last staff
setSpan = n - j;
}
else if (span > 1 && staff->barLineTo() > 0) {
// TODO: check if span is still valid
// (true if the last staff is the same as it was before this edit)
// the code here fixes https://musescore.org/en/node/41786
// but by forcing an update,
// we lose custom modifications to staff barLineTo
// at least this happens only for span > 1, and not for Mensurstrich (barLineTo<=0)
setSpan = span; // force update to pick up new barLineTo value
}
else {
// this staff starts a span
curSpan = span;