本文整理汇总了C++中MasterScore::adjustKeySigs方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::adjustKeySigs方法的具体用法?C++ MasterScore::adjustKeySigs怎么用?C++ MasterScore::adjustKeySigs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::adjustKeySigs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: editInstrList
//.........这里部分代码省略.........
else if (pli->op == ListItemOp::ADD) {
const InstrumentTemplate* t = ((PartListItem*)item)->it;
part = new Part(masterScore);
part->initFromInstrTemplate(t);
masterScore->undo(new InsertPart(part, staffIdx));
pli->part = part;
QList<Staff*> linked;
for (int cidx = 0; pli->child(cidx); ++cidx) {
StaffListItem* sli = static_cast<StaffListItem*>(pli->child(cidx));
Staff* staff = new Staff(masterScore);
staff->setPart(part);
sli->setStaff(staff);
staff->init(t, sli->staffType(), cidx);
staff->setDefaultClefType(sli->defaultClefType());
if (staffIdx > 0)
staff->setBarLineSpan(masterScore->staff(staffIdx - 1)->barLineSpan());
masterScore->undoInsertStaff(staff, cidx);
++staffIdx;
Staff* linkedStaff = part->staves()->front();
if (sli->linked() && linkedStaff != staff) {
Excerpt::cloneStaff(linkedStaff, staff);
linked.append(staff);
}
}
//insert keysigs
int sidx = masterScore->staffIdx(part);
int eidx = sidx + part->nstaves();
if (firstStaff)
masterScore->adjustKeySigs(sidx, eidx, tmpKeymap);
}
else {
part = pli->part;
if (part->show() != pli->visible())
part->undoChangeProperty(Pid::VISIBLE, pli->visible());
for (int cidx = 0; pli->child(cidx); ++cidx) {
StaffListItem* sli = static_cast<StaffListItem*>(pli->child(cidx));
if (sli->op() == ListItemOp::I_DELETE) {
Staff* staff = sli->staff();
int sidx = staff->idx();
masterScore->cmdRemoveStaff(sidx);
}
else if (sli->op() == ListItemOp::ADD) {
Staff* staff = new Staff(masterScore);
staff->setPart(part);
staff->initFromStaffType(sli->staffType());
sli->setStaff(staff);
staff->setDefaultClefType(sli->defaultClefType());
if (staffIdx > 0)
staff->setBarLineSpan(masterScore->staff(staffIdx - 1)->barLineSpan());
KeySigEvent ke;
if (part->staves()->empty())
ke.setKey(Key::C);
else
ke = part->staff(0)->keySigEvent(Fraction(0,1));
staff->setKey(Fraction(0,1), ke);
Staff* linkedStaff = 0;
if (sli->linked()) {
if (rstaff > 0)