diff --git a/src/converter/internal/compat/backendapi.cpp b/src/converter/internal/compat/backendapi.cpp index a1c8dcab0db74..94148d92b0504 100644 --- a/src/converter/internal/compat/backendapi.cpp +++ b/src/converter/internal/compat/backendapi.cpp @@ -536,10 +536,10 @@ Ret BackendApi::doExportScoreParts(const IMasterNotationPtr masterNotation, QIOD ExcerptNotationList excerpts = allExcerpts(masterNotation); for (IExcerptNotationPtr excerpt : excerpts) { - mu::engraving::Score* part = excerpt->notation()->elements()->msScore(); - std::map partMetaTags = part->metaTags(); + mu::engraving::Score* partScore = excerpt->notation()->elements()->msScore(); + std::map partMetaTags = partScore->metaTags(); - QJsonValue partTitle(part->name()); + QJsonValue partTitle(partScore->name()); partsTitles << partTitle; QVariantMap meta; @@ -547,14 +547,14 @@ Ret BackendApi::doExportScoreParts(const IMasterNotationPtr masterNotation, QIOD meta[key] = partMetaTags[key].toQString(); } - meta["open"] = part->isOpen(); - meta["id"] = QString::fromStdString(part->eid().toStdString()); + meta["open"] = partScore->isOpen(); + meta["id"] = QString::fromStdString(partScore->eid().toStdString()); QJsonValue partMetaObj = QJsonObject::fromVariantMap(meta); partsMetaList << partMetaObj; - std::string fileName = io::escapeFileName(part->name().toStdString()).toStdString() + ".mscz"; - QJsonValue partObj(QString::fromLatin1(scorePartJson(part, fileName).val)); + std::string fileName = io::escapeFileName(partScore->name().toStdString()).toStdString() + ".mscz"; + QJsonValue partObj(QString::fromLatin1(scorePartJson(partScore, fileName).val)); partsObjList << partObj; } diff --git a/src/engraving/dom/score.cpp b/src/engraving/dom/score.cpp index eaf7bf389c17f..b2c734a858688 100644 --- a/src/engraving/dom/score.cpp +++ b/src/engraving/dom/score.cpp @@ -156,7 +156,7 @@ Score::Score(const modularity::ContextPtr& iocCtx) } Score::validScores.insert(this); - m_masterScore = 0; + m_masterScore = nullptr; m_engravingFont = engravingFonts()->fontByName("Leland"); @@ -180,6 +180,11 @@ Score::Score(MasterScore* parent, bool forcePartStyle /* = true */) { Score::validScores.insert(this); m_masterScore = parent; + + if (m_masterScore) { + setEID(m_masterScore->getEID()->newEID(type())); + } + if (DefaultStyle::defaultStyleForParts()) { m_style = *DefaultStyle::defaultStyleForParts(); } else { diff --git a/src/engraving/rw/read410/read410.cpp b/src/engraving/rw/read410/read410.cpp index a40226e6b41c5..8ea3f4eac540c 100644 --- a/src/engraving/rw/read410/read410.cpp +++ b/src/engraving/rw/read410/read410.cpp @@ -123,7 +123,10 @@ bool Read410::readScore410(Score* score, XmlReader& e, ReadContext& ctx) while (e.readNextStartElement()) { ctx.setTrack(muse::nidx); const AsciiStringView tag(e.name()); - if (tag == "Staff") { + if (tag == "eid") { + AsciiStringView s = e.readAsciiText(); + score->setEID(EID::fromStdString(s)); + } else if (tag == "Staff") { StaffRead::readStaff(score, e, ctx); } else if (tag == "Omr") { e.skipCurrentElement(); diff --git a/src/engraving/rw/write/writer.cpp b/src/engraving/rw/write/writer.cpp index a55f801c68fcb..f1a1e3f79b4aa 100644 --- a/src/engraving/rw/write/writer.cpp +++ b/src/engraving/rw/write/writer.cpp @@ -114,6 +114,12 @@ void Writer::write(Score* score, XmlWriter& xml, WriteContext& ctx, bool selecti xml.startElement(score); + if (!MScore::testMode && !score->isPaletteScore()) { + if (score->eid().isValid()) { + xml.tag("eid", score->eid().toUint64()); + } + } + if (Excerpt* e = score->excerpt()) { if (!e->name().empty()) { xml.tag("name", e->name());