Skip to content

Commit

Permalink
Add a mensural option help category. Closes #3240
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Oct 31, 2023
1 parent 2929379 commit 84bf0ce
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
12 changes: 9 additions & 3 deletions include/vrv/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -826,6 +824,14 @@ class Options {
OptionBool m_midiNoCue;
OptionDbl m_midiTempoAdjustment;

/**
* Mensural
*/
OptionGrp m_mensural;

OptionBool m_ligatureAsBracket;
OptionBool m_mensuralToMeasure;

/**
* Deprecated options
*/
Expand Down
22 changes: 14 additions & 8 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 *********/

/*
Expand Down
9 changes: 5 additions & 4 deletions src/toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<vrv::OptionsCategory, std::string> 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<vrv::OptionsCategory, std::string> 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();
Expand Down

0 comments on commit 84bf0ce

Please sign in to comment.