diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 857e3ec783..1fd25acdc1 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -59,6 +59,11 @@ class Doc : public Object { */ void Reset() override; + /** + * + */ + void ResetToLoading(); + /** * Clear the selection pages. */ diff --git a/src/doc.cpp b/src/doc.cpp index 5242122ad0..e13a03b315 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -147,6 +147,15 @@ void Doc::Reset() m_back.reset(); } +void Doc::ResetToLoading() +{ + if (m_currentScoreDefDone) { + ScoreDefUnsetCurrentFunctor scoreDefUnsetCurrent; + this->Process(scoreDefUnsetCurrent); + m_currentScoreDefDone = false; + } +} + void Doc::ClearSelectionPages() { if (m_selectionPreceding) { diff --git a/src/iocmme.cpp b/src/iocmme.cpp index 97de53d063..15f9ea0d44 100644 --- a/src/iocmme.cpp +++ b/src/iocmme.cpp @@ -187,8 +187,8 @@ void CmmeInput::PostProcessProport() for (Object *object : proports) { Proport *proport = vrv_cast(object); assert(proport); - // Not a potential tempo change, or already processed - if (proport->GetType() != "cmme_tempo_change?") continue; + // Not a potential reset, or already processed + if (proport->GetType() != "reset?") continue; // Default type for tempo changes std::string propType = "cmme_tempo_change"; proport->SetType(propType); @@ -233,6 +233,8 @@ void CmmeInput::PostProcessProport() } } + m_doc->ResetToLoading(); + m_doc->ResetDataPage(); } @@ -923,8 +925,8 @@ void CmmeInput::CreateMensuration(pugi::xml_node mensurationNode) if (denVal != VRV_UNSET) { proport->SetNumbase(denVal); } - // Mark them as potential tempo changes - proport->SetType("cmme_tempo_change?"); + // Mark them as potential tempo changes (i.e., reset) + proport->SetType("reset?"); m_currentContainer->AddChild(proport); m_activeTempoChange = true; } diff --git a/src/proport.cpp b/src/proport.cpp index 1929eb0257..f24d55d7ed 100644 --- a/src/proport.cpp +++ b/src/proport.cpp @@ -49,9 +49,12 @@ int Proport::GetCumulatedNumbase() const void Proport::Cumulate(const Proport *proport) { - // Unset values are not cumulated + // Reset type proportion - do not cumulate if (this->GetType() == "reset") return; + // Potential reset (tempo change) in CMME - do not cumulate + if (this->GetType() == "reset?") return; + // Unset values are not cumulated if (proport->HasNum() && this->HasNum()) { m_cumulatedNum = this->GetNum() * proport->GetCumulatedNum(); }