MUSX Document Model
Loading...
Searching...
No Matches
musx::dom::options::LyricOptions Class Reference

Options controlling lyric rendering in the musx file. More...

#include <Options.h>

+ Inheritance diagram for musx::dom::options::LyricOptions:

Classes

struct  SyllablePosStyle
 Syllable position style. More...
 
struct  WordExtConnectStyle
 Word extension connection style. More...
 

Public Types

enum class  SmartHyphenStart { Always , Sometimes , Never }
 When to start hyphenation. More...
 
enum class  AutoNumberingAlign { None , Align }
 Autonumbering type. More...
 
enum class  AlignJustify { Left , Center , Right }
 Horizontal and vertical alignment/justification values.
 
enum class  WordExtConnectIndex {
  LyricRightBottom , HeadRightLyrBaseline , SystemLeft , SystemRight ,
  DotRightLyrBaseline , DurationLyrBaseline
}
 Word extension connection points.
 
enum class  WordExtConnectStyleType {
  DefaultStart , DefaultEnd , SystemStart , SystemEnd ,
  DottedEnd , DurationEnd , OneEntryEnd , ZeroLengthEnd ,
  ZeroOffset
}
 Word extension connection style categories.
 
enum class  SyllablePosStyleType { Default , WordExt , First , SystemStart }
 Lyric syllable position style types. More...
 
- Public Types inherited from musx::dom::Base
enum class  ShareMode { All , Partial , None }
 Describes how this instance is shared between part and score. More...
 
using SharedNodes = std::set< std::string >
 The container type for shared nodes.
 

Public Member Functions

 LyricOptions (const DocumentWeakPtr &document, Cmper partId=0, ShareMode shareMode=ShareMode::All)
 Constructor.
 
void integrityCheck () override
 Allows a class to determine if it has been properly contructed by the factory and fix issues that it can, such as creating default instances of contained classes.
 
- Public Member Functions inherited from musx::dom::Base
virtual ~Base () noexcept(false)=default
 Virtual destructor for polymorphic behavior.
 
DocumentPtr getDocument () const
 Gets a reference to the Document.
 
virtual Cmper getPartId () const
 Gets the partId for this instance (or SCORE_PARTID for score)
 
ShareMode getShareMode () const
 Gets the sharing mode for this instance.
 
const SharedNodesgetUnlinkedNodes () const
 Gets the unlinked nodes for this instance. (Only populated for ShareMode::Partial)
 
void addUnlinkedNode (const std::string &nodeName)
 Adds a shared node for this instance.
 
virtual bool requireAllFields () const
 Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class.
 

Static Public Member Functions

static const xml::XmlElementArray< LyricOptions > & xmlMappingArray ()
 Required for musx::factory::FieldPopulator.
 

Public Attributes

char32_t hyphenChar {}
 "Hyphen Character"
 
Evpu maxHyphenSeparation {}
 "Maximum Space Between Hyphens"
 
Evpu wordExtVertOffset {}
 "Word Extension Vertical Offset from Baseline"
 
Evpu wordExtHorzOffset {}
 "Word Extension Horizontal Offset from Syllable"
 
bool useSmartWordExtensions {}
 "Use Smart Word Extensions"
 
bool useAltHyphenFont {}
 "Use Alternate Hyphen Font"
 
std::shared_ptr< FontInfoaltHyphenFont
 "Alternate Hyphen Font"
 
bool useSmartHyphens {}
 "Use Smart Hyphens"
 
SmartHyphenStart smartHyphenStart {}
 "Smart Hyphen Start"
 
bool wordExtNeedUnderscore {}
 "Only Create on Lyrics With Underscores"
 
Evpu wordExtMinLength {}
 "Word Extension Minimum Length"
 
bool wordExtOffsetToNotehead {}
 "Notehead Alignment: Align to Notehead" (if false: "Stretch to Note Duration")
 
bool lyricUseEdgePunctuation {}
 reverse of "Ignore SyllableEdgePunctuation"
 
std::string lyricPunctuationToIgnore
 If this string is omitted in the xml, the default value is populated in integrityCheck.
 
AutoNumberingAlign lyricAutoNumType {}
 "Automatic Lyric Numbers"
 
Efix wordExtLineWidth {}
 "Word Extension Line Width"
 
std::unordered_map< SyllablePosStyleType, std::shared_ptr< SyllablePosStyle > > syllablePosStyles
 Syllable positioning styles.
 
std::unordered_map< WordExtConnectStyleType, std::shared_ptr< WordExtConnectStyle > > wordExtConnectStyles
 Word extension connection styles.
 

Static Public Attributes

static constexpr std::string_view XmlNodeName = "lyricOptions"
 The XML node name for this type.
 

Additional Inherited Members

- Protected Member Functions inherited from musx::dom::OptionsBase
 OptionsBase (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode)
 Constructs the OptionsBase and validates XmlNodeName in the derived class.
 
- Protected Member Functions inherited from musx::dom::Base
 Base (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode)
 Constructs the base class.
 
 Base (const Base &)=default
 explicit default copy constructor
 
 Base (Base &&) noexcept=default
 explicit default move constructor
 
Baseoperator= (const Base &)
 no-op copy assignment operator allows subclasses to copy their values.
 
Baseoperator= (Base &&) noexcept
 no-op move assignment operator allows subclasses to move their values.
 

Detailed Description

Options controlling lyric rendering in the musx file.

This class is identified by the XML node name "lyricOptions".

Member Enumeration Documentation

◆ AutoNumberingAlign

Autonumbering type.

Enumerator
None 

"Keep with First Syllable in Lyric" (default value)

Align 

"Group Under the Same Note"

◆ SmartHyphenStart

When to start hyphenation.

Enumerator
Always 

"Always" (default value)

Sometimes 

"Only when the first syllable is attached to the second note or later"

Never 

"Never"

◆ SyllablePosStyleType

Lyric syllable position style types.

Enumerator
Default 

"Others:" (always on, even though the on member may be false)

WordExt 

"Syllables with Word Extensions"

First 

"First Syllable in Lyric"

SystemStart 

"Syllable at Start of System"

Member Function Documentation

◆ integrityCheck()

void musx::dom::options::LyricOptions::integrityCheck ( )
inlineoverridevirtual

Allows a class to determine if it has been properly contructed by the factory and fix issues that it can, such as creating default instances of contained classes.

The default implementation should always be called inside an overridden implementation.

Exceptions
musx::dom::integrity_errorif there is a problem.

Reimplemented from musx::dom::Base.