From 84bf0cebdda66b30b9ddee22396dc342fc55c446 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Tue, 31 Oct 2023 14:14:40 +0100 Subject: [PATCH] Add a mensural option help category. Closes #3240 --- include/vrv/options.h | 12 +++++++++--- src/options.cpp | 22 ++++++++++++++-------- src/toolkit.cpp | 9 +++++---- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/include/vrv/options.h b/include/vrv/options.h index 7e4a351d223..ad4c87eb7ae 100644 --- a/include/vrv/options.h +++ b/include/vrv/options.h @@ -86,7 +86,7 @@ enum option_SMUFLTEXTFONT { SMUFLTEXTFONT_embedded = 0, SMUFLTEXTFONT_linked, SM // Option //---------------------------------------------------------------------------- -enum class OptionsCategory { None, Base, General, Layout, Margins, Midi, Selectors, Full }; +enum class OptionsCategory { None, Base, General, Layout, Mensural, Margins, Midi, Selectors, Full }; /** * This class is a base class of each styling parameter @@ -626,8 +626,6 @@ class Options { OptionBool m_incip; OptionBool m_justifyVertically; OptionBool m_landscape; - OptionBool m_ligatureAsBracket; - OptionBool m_mensuralToMeasure; OptionDbl m_minLastJustification; OptionBool m_mmOutput; OptionBool m_moveScoreDefinitionToStaff; @@ -826,6 +824,14 @@ class Options { OptionBool m_midiNoCue; OptionDbl m_midiTempoAdjustment; + /** + * Mensural + */ + OptionGrp m_mensural; + + OptionBool m_ligatureAsBracket; + OptionBool m_mensuralToMeasure; + /** * Deprecated options */ diff --git a/src/options.cpp b/src/options.cpp index 3ff2b8508df..4c4955769cd 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1047,14 +1047,6 @@ Options::Options() m_landscape.Init(false); this->Register(&m_landscape, "landscape", &m_general); - m_ligatureAsBracket.SetInfo("Ligature as bracket", "Render ligatures as bracket instead of original notation"); - m_ligatureAsBracket.Init(false); - this->Register(&m_ligatureAsBracket, "ligatureAsBracket", &m_general); - - m_mensuralToMeasure.SetInfo("Mensural to measure", "Convert mensural sections to measure-based MEI"); - m_mensuralToMeasure.Init(false); - this->Register(&m_mensuralToMeasure, "mensuralToMeasure", &m_general); - m_minLastJustification.SetInfo("Minimum last-system-justification width", "The last system is only justified if the unjustified width is greater than this percent"); m_minLastJustification.Init(0.8, 0.0, 1.0); @@ -1806,6 +1798,20 @@ Options::Options() m_midiTempoAdjustment.Init(1.0, 0.2, 4.0); this->Register(&m_midiTempoAdjustment, "midiTempoAdjustment", &m_midi); + /********* General *********/ + + m_mensural.SetLabel("Mensural notation options", "6-mensural"); + m_mensural.SetCategory(OptionsCategory::Mensural); + m_grps.push_back(&m_mensural); + + m_ligatureAsBracket.SetInfo("Ligature as bracket", "Render ligatures as bracket instead of original notation"); + m_ligatureAsBracket.Init(false); + this->Register(&m_ligatureAsBracket, "ligatureAsBracket", &m_mensural); + + m_mensuralToMeasure.SetInfo("Mensural to measure", "Convert mensural sections to measure-based MEI"); + m_mensuralToMeasure.Init(false); + this->Register(&m_mensuralToMeasure, "mensuralToMeasure", &m_mensural); + /********* Deprecated options *********/ /* diff --git a/src/toolkit.cpp b/src/toolkit.cpp index d320b89fa2f..cb8fe6e8ada 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -1189,10 +1189,11 @@ void Toolkit::PrintOptionUsageOutput(const vrv::Option *option, std::ostream &ou void Toolkit::PrintOptionUsage(const std::string &category, std::ostream &output) const { // map of all categories and expected string arguments for them - const std::map categories = { { vrv::OptionsCategory::Base, "base" }, - { vrv::OptionsCategory::General, "general" }, { vrv::OptionsCategory::Layout, "layout" }, - { vrv::OptionsCategory::Margins, "margins" }, { vrv::OptionsCategory::Midi, "midi" }, - { vrv::OptionsCategory::Selectors, "selectors" }, { vrv::OptionsCategory::Full, "full" } }; + const std::map categories + = { { vrv::OptionsCategory::Base, "base" }, { vrv::OptionsCategory::General, "general" }, + { vrv::OptionsCategory::Layout, "layout" }, { vrv::OptionsCategory::Margins, "margins" }, + { vrv::OptionsCategory::Mensural, "mensural" }, { vrv::OptionsCategory::Midi, "midi" }, + { vrv::OptionsCategory::Selectors, "selectors" }, { vrv::OptionsCategory::Full, "full" } }; output.precision(2); // display_version();