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

Contains the syllable information for a single syllable. (See texts::LyricsTextBase) More...

#include <CommonClasses.h>

+ Inheritance diagram for musx::dom::LyricsSyllableInfo:

Classes

class  ElisionRun
 One text run produced by splitting a syllable's text at an embedded Finale elision marker. See LyricsSyllableInfo::calcElisionRuns. More...
 

Public Member Functions

bool iterateStyles (util::EnigmaString::TextChunkCallback callback) const
 Parse this syllable into chunks with EnigmaStyles for that chunk. In the most common case, the callback is called exactly once. However, this design allows for detecting uncommon cases of style changes within a syllable.
 
std::vector< ElisionRuncalcElisionRuns () const
 Splits syllable at embedded Finale elision markers, redistributing hasHyphenBefore and hasHyphenAfter onto the first and last run respectively. A syllable with no markers returns a single run spanning the whole syllable.
 

Public Attributes

std::string syllable
 the syllable text with no hyphenation or font information.
 
bool hasHyphenBefore
 indicates the syllable is preceded by a hyphen.
 
bool hasHyphenAfter
 indicates the syllable if followed by a hyphen.
 
int strippedUnderscores
 indicates the number of trailing underscores stripped (because smart word extensions convert them to word extensions).
 

Friends

class texts::LyricsTextBase
 

Detailed Description

Contains the syllable information for a single syllable. (See texts::LyricsTextBase)

Member Function Documentation

◆ calcElisionRuns()

std::vector< LyricsSyllableInfo::ElisionRun > musx::dom::LyricsSyllableInfo::calcElisionRuns ( ) const

Splits syllable at embedded Finale elision markers, redistributing hasHyphenBefore and hasHyphenAfter onto the first and last run respectively. A syllable with no markers returns a single run spanning the whole syllable.

Returns
At least one run.

◆ iterateStyles()

bool musx::dom::LyricsSyllableInfo::iterateStyles ( util::EnigmaString::TextChunkCallback  callback) const

Parse this syllable into chunks with EnigmaStyles for that chunk. In the most common case, the callback is called exactly once. However, this design allows for detecting uncommon cases of style changes within a syllable.

Parameters
callbackThe callback for each chunk of the syllable with a different style.
Returns
True if the syllable was fully parsed. False if parsing was aborted by the callback function.