Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (const instruments::InstrumentTemplate& instrumentTemplate: instrumentTemplates) {
- Part* part = new Part(score);
- part->setPartName(instrumentTemplate.trackName);
- auto instrument = instrumentFromTemplate(instrumentTemplate);
- part->setInstrument(instrument);
- score()->undo(new Ms::InsertPart(part, staffIndex));
- addStaves(part, instrument, staffIndex);
- }
- void NotationParts::addStaves(Part* part, const Instrument& instrument, int& globalStaffIndex)
- {
- for (int i = 0; i < instrument.staves; i++) {
- Staff* staff = new Staff(score());
- staff->setPart(part);
- initStaff(staff, instrument, Ms::StaffType::preset(StaffType(0)), i);
- if (globalStaffIndex > 0) {
- staff->setBarLineSpan(score()->staff(globalStaffIndex - 1)->barLineSpan());
- }
- score()->undoInsertStaff(staff, i);
- globalStaffIndex++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement