Skip to content

Commit

Permalink
Fix default settings for MusicXML import
Browse files Browse the repository at this point in the history
  • Loading branch information
cbjeukendrup committed Aug 29, 2023
1 parent f7d059d commit 0e4c1d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Expand Up @@ -43,6 +43,7 @@ void MusicXmlConfiguration::init()
settings()->setDefaultValue(MUSICXML_EXPORT_LAYOUT_KEY, Val(true));
settings()->setDefaultValue(MUSICXML_EXPORT_BREAKS_TYPE_KEY, Val(MusicxmlExportBreaksType::All));
settings()->setDefaultValue(MUSICXML_EXPORT_INVISIBLE_ELEMENTS_KEY, Val(false));
settings()->setDefaultValue(MIGRATION_APPLY_EDWIN_FOR_XML, Val(false));
settings()->setDefaultValue(MIGRATION_NOT_ASK_AGAIN_KEY, Val(false));
}

Expand Down
10 changes: 5 additions & 5 deletions src/importexport/musicxml/musicxmlmodule.cpp
Expand Up @@ -61,11 +61,6 @@ void MusicXmlModule::registerExports()

void MusicXmlModule::resolveImports()
{
//! TODO For some reason, the configuration init should be here,
//! we need to find out if this is not correct... for the correct one,
//! it should be in the onInit module
m_configuration->init();

auto readers = modularity::ioc()->resolve<INotationReadersRegister>(moduleName());
if (readers) {
readers->reg({ "xml", "musicxml", "mxl" }, std::make_shared<MusicXmlReader>());
Expand All @@ -77,3 +72,8 @@ void MusicXmlModule::resolveImports()
writers->reg({ "mxl" }, std::make_shared<MxlWriter>());
}
}

void MusicXmlModule::onInit(const framework::IApplication::RunMode&)
{
m_configuration->init();
}
1 change: 1 addition & 0 deletions src/importexport/musicxml/musicxmlmodule.h
Expand Up @@ -36,6 +36,7 @@ class MusicXmlModule : public modularity::IModuleSetup
void registerResources() override;
void registerExports() override;
void resolveImports() override;
void onInit(const framework::IApplication::RunMode&) override;

private:
std::shared_ptr<MusicXmlConfiguration> m_configuration;
Expand Down

0 comments on commit 0e4c1d9

Please sign in to comment.