本文整理汇总了C++中MasterScore::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::setName方法的具体用法?C++ MasterScore::setName怎么用?C++ MasterScore::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::setName方法的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: newScore
Score* QmlPlugin::newScore(const QString& /*name*/, const QString& /*part*/, int /*measures*/)
{
#if 0 // TODO
if (msc->currentScore())
msc->currentScore()->endCmd();
MasterScore* score = new MasterScore(MScore::defaultStyle());
score->setName(name);
score->appendPart(part);
score->appendMeasures(measures);
score->doLayout();
int view = msc->appendScore(score);
msc->setCurrentView(0, view);
qApp->processEvents();
// tell QML not to garbage collect this score
QQmlEngine::setObjectOwnership(score, QQmlEngine::CppOwnership);
score->startCmd();
return score;
#endif
return 0;
}