Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/notation/imasternotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IMasterNotation
virtual muse::Ret setupNewScore(engraving::MasterScore* score, const ScoreCreateOptions& options) = 0;
virtual void applyOptions(engraving::MasterScore* score, const ScoreCreateOptions& options, bool createdFromTemplate = false) = 0;
virtual engraving::MasterScore* masterScore() const = 0;
virtual void setMasterScore(engraving::MasterScore* masterScore) = 0;
virtual void setMasterScore(engraving::MasterScore* masterScore, bool disablePlayback = false) = 0;

virtual INotationPtr notation() = 0;

Expand Down
11 changes: 7 additions & 4 deletions src/notation/internal/masternotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ INotationPtr MasterNotation::notation()
return shared_from_this();
}

void MasterNotation::initAfterSettingScore(const MasterScore* score)
void MasterNotation::initAfterSettingScore(const MasterScore* score, bool disablePlayback)
{
IF_ASSERT_FAILED(score) {
return;
Expand All @@ -146,11 +146,14 @@ void MasterNotation::initAfterSettingScore(const MasterScore* score)
}
});

m_notationPlayback->init();
if (!disablePlayback) {
m_notationPlayback->init();
}

initExcerptNotations(score->excerpts());
}

void MasterNotation::setMasterScore(mu::engraving::MasterScore* score)
void MasterNotation::setMasterScore(mu::engraving::MasterScore* score, bool disablePlayback)
{
if (masterScore() == score) {
return;
Expand All @@ -162,7 +165,7 @@ void MasterNotation::setMasterScore(mu::engraving::MasterScore* score)

score->updateSwing();

initAfterSettingScore(score);
initAfterSettingScore(score, disablePlayback);
}

mu::engraving::MasterScore* MasterNotation::masterScore() const
Expand Down
4 changes: 2 additions & 2 deletions src/notation/internal/masternotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MasterNotation : public IMasterNotation, public Notation, public std::enab
muse::Ret setupNewScore(engraving::MasterScore* score, const ScoreCreateOptions& options) override;
void applyOptions(engraving::MasterScore* score, const ScoreCreateOptions& options, bool createdFromTemplate = false) override;
engraving::MasterScore* masterScore() const override;
void setMasterScore(engraving::MasterScore* masterScore) override;
void setMasterScore(engraving::MasterScore* masterScore, bool disablePlayback = false) override;

INotationPtr notation() override;
int mscVersion() const override;
Expand Down Expand Up @@ -78,7 +78,7 @@ class MasterNotation : public IMasterNotation, public Notation, public std::enab
friend class project::NotationProject;
explicit MasterNotation(project::INotationProject* project, const muse::modularity::ContextPtr& iocCtx);

void initAfterSettingScore(const engraving::MasterScore* score);
void initAfterSettingScore(const engraving::MasterScore* score, bool disablePlayback = false);

void initExcerptNotations(const std::vector<engraving::Excerpt*>& excerpts);
void addExcerptsToMasterScore(const std::vector<engraving::Excerpt*>& excerpts);
Expand Down
4 changes: 2 additions & 2 deletions src/project/internal/notationproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Ret NotationProject::doLoad(const muse::io::path_t& path, const OpenParams& open
}

// Set current if all success
m_masterNotation->setMasterScore(masterScore);
m_masterNotation->setMasterScore(masterScore, openParams.disablePlayback);

// Load view settings & solo-mute states (needs to be done after notations are created)
m_masterNotation->notation()->viewState()->read(reader);
Expand Down Expand Up @@ -333,7 +333,7 @@ Ret NotationProject::doImport(const muse::io::path_t& path, const OpenParams& op
}

// Set current if all success
m_masterNotation->setMasterScore(score);
m_masterNotation->setMasterScore(score, openParams.disablePlayback);
setPath(path);
setNeedSave(false);
score->setMetaTag(u"originalFormat", QString::fromStdString(suffix));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,16 @@ void TemplatePaintView::onViewSizeChanged()

void TemplatePaintView::onNotationSetup()
{
TRACEFUNC;

resetNotation();

m_notationProject = notationCreator()->newProject(iocContext());

Ret ret = m_notationProject->load(m_templatePath);
OpenParams params;
params.disablePlayback = true;

Ret ret = m_notationProject->load(m_templatePath, params);
if (!ret) {
LOGE() << ret.toString();
return;
Expand Down
Loading