MUSX Document Model
|
Represents the attributes of a measure. More...
#include <Others.h>
Public Types | |
enum class | PositioningType { Manual , TimeSignature , BeatChart , TimeSigPlusPositioning , BeatChartPlusPositioning } |
Positioning (music spacing) type for the measure. More... | |
enum class | BarlineType { None , OptionsDefault , Normal , Double , Final , Solid , Dashed , Tick , Custom } |
Barline type for left and right barlines. More... | |
enum class | ShowKeySigMode { IfNeeded , Always , Never } |
How and whether to show a Key Signature in this measure. More... | |
enum class | ShowTimeSigMode { IfNeeded , Always , Never } |
How and whether to show a Time Signature in this measure. More... | |
![]() | |
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 | |
Measure (const DocumentWeakPtr &document, Cmper measureId, ShareMode shareMode, Cmper cmper) | |
Constructor function. | |
bool | calcShouldShowFullNames () const |
Calculates if a measure should show full names vs. abbreviated names. | |
int | calcDisplayNumber () const |
Calculates the visible number of the measure, based on the first MeasureNumberRegion that contains it. | |
std::shared_ptr< KeySignature > | createKeySignature (const std::optional< InstCmper > &forStaff=std::nullopt) const |
Creates and returns a shared pointer to an instance of the KeySignature for this measure and staff. | |
std::shared_ptr< TimeSignature > | createTimeSignature (const std::optional< InstCmper > &forStaff=std::nullopt) const |
Create a shared pointer to an instance of the TimeSignature for this measure and staff. | |
std::shared_ptr< TimeSignature > | createDisplayTimeSignature (const std::optional< InstCmper > &forStaff=std::nullopt) const |
Create a shared pointer to an instance of the display TimeSignature for this measure and staff. | |
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. | |
bool | requireAllFields () const override |
![]() | |
Cmper | getCmper () const |
Gets the cmper key value. | |
std::optional< Inci > | getInci () const |
Gets the optional array index (inci ). | |
![]() | |
virtual | ~Base () noexcept(false)=default |
Virtual destructor for polymorphic behavior. | |
DocumentPtr | getDocument () const |
Gets a reference to the Document. | |
Cmper | getPartId () const |
Gets the partId for this instance (or 0 for score) | |
std::shared_ptr< others::PartDefinition > | getPartDefinition () const |
Gets the others::PartDefinition corresponding to getPartId. | |
ShareMode | getShareMode () const |
Gets the sharing mode for this instance. | |
const SharedNodes & | getUnlinkedNodes () 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. | |
Static Public Member Functions | |
static const xml::XmlElementArray< Measure > & | xmlMappingArray () |
Required for musx::factory::FieldPopulator. | |
Public Attributes | |
Evpu | width {} |
"Ideal" measure width in Evpu. Page layout determines actual width. | |
std::shared_ptr< KeySignature > | globalKeySig |
the key global signature on this measure. Guaranteed to be non-null. (xml node is <keySig> ) | |
Cmper | beats {} |
Number of beats in the measure or the Cmper to a timesigUpper composite numerator list. | |
Cmper | divBeat {} |
Divisions per beat (Edu) or the Cmper to a timesigLower composite denominator list. | |
Cmper | dispBeats {} |
Displayed beats in the measure or the Cmper to a timesigUpper composite numerator list. | |
Cmper | dispDivbeat {} |
Displayed divisions per beat (Edu) or the Cmper to a timesigLower composite denominator list. | |
Evpu | frontSpaceExtra {} |
Extra space at front of bar. | |
Evpu | backSpaceExtra {} |
Extra space at end of bar. | |
bool | breakWordExt {} |
Barline ends word extensions on lyrics. | |
bool | hideCaution {} |
"Hide Cautionary Clefs, Key, and Time Signature" | |
bool | hasSmartShape {} |
Indicates if the measure has a smart shape. | |
bool | showFullNames {} |
"Show Full Staff & Group Names" | |
bool | allowSplitPoints {} |
"Allow Horizontal Split Points" (xml node is <posSplit> ) | |
bool | groupBarlineOverride {} |
Override the barline specified by a details::StaffGroup (if any) | |
Cmper | customBarShape {} |
Cmper of Shape Designer ShapeDef for custom right barline. | |
Cmper | customLeftBarShape {} |
Cmper of Shape Designer ShapeDef for custom left barline. | |
ShowKeySigMode | showKey {} |
Show mode for key signatures. | |
ShowTimeSigMode | showTime {} |
Show mode for time signatures. | |
PositioningType | positioningMode {} |
Positioning type for the measure. (xml node is <posMode> ) | |
bool | beginNewSystem {} |
"Begin a New Staff System" (xml node is <lineBreak> ) | |
bool | breakMmRest {} |
"Break a Multimeasure Rests" (xml node is <breakRest> ) | |
bool | noMeasNum {} |
Inverse of "Include in Measure Numbering". | |
BarlineType | barlineType {} |
Barline type. (xml node is <barline> ) | |
bool | evenlyAcrossMeasure {} |
"Position Evenly Across Measure" (xml node is <indivPosDef> ) | |
bool | hasExpression {} |
Indicates if the measure has an expression assigned. See MeasureExprAssign. (xml node is <hasExpr> ) | |
bool | forwardRepeatBar {} |
Indicates a forward repeat bar on this measure. (xml node is <forRepBar> ) | |
bool | backwardsRepeatBar {} |
Indicates a forward repeat bar on this measure. (xml node is <bacRepBar> ) | |
bool | hasEnding {} |
Indicates the presence of a repeat ending. (xml node is <barEnding> ) | |
bool | hasTextRepeat {} |
Indicates the presence of one or more text repeat assigments. (xml node is <txtRepeats> ) | |
bool | hasChord {} |
Indicates the presence of one or more chords. | |
bool | compositeNumerator {} |
Indicates a composite numerator for the time signature. (xml node is <altNumTsig> ) | |
bool | compositeDenominator {} |
Indicates a composite denominator for the time signature. (xml node is <altDenTsig> ) | |
bool | abbrvTime {} |
bool | useDisplayTimesig {} |
Indicates whether to use the display time signature. | |
BarlineType | leftBarlineType {} |
Left barline type. (xml node is <leftBarline> ) | |
bool | compositeDispNumerator {} |
Indicates a composite numerator for the display time signature. (xml node is <displayAltNumTsig> ) | |
bool | compositeDispDenominator {} |
Indicates a composite denominator for the display time signature. (xml node is <displayAltDenTsig> ) | |
Static Public Attributes | |
static constexpr std::string_view | XmlNodeName = "measSpec" |
The XML node name for this type. | |
Additional Inherited Members | |
![]() | |
OthersBase (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper, std::optional< Inci > inci=std::nullopt) | |
Constructs an OthersBase object. | |
![]() | |
Base (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode) | |
Constructs the base class and enforces the static constexpr XmlNodeName. | |
Base & | operator= (const Base &) |
assignment constructor: m_unlinkedNodes is intentionally omitted | |
Represents the attributes of a measure.
This class is identified by the XML node name "measSpec".
|
strong |
Barline type for left and right barlines.
Enumerator | |
---|---|
None | No barline. (This is the default value for the enum.) |
OptionsDefault | Left barlines only: use value from options::BarlineOptions (xml values is "default") |
Normal | Normal barline. |
Double | Double barline. |
Final | Final barline. |
Solid | Solid (thick) barline. |
Dashed | Dashed barline (xml value is "dash") |
Tick | Right barlines only: tick barline (xml value is "partial") |
Custom | Custom barline (created with Shape Designer) |
|
strong |
Positioning (music spacing) type for the measure.
|
strong |
|
strong |
int musx::dom::others::Measure::calcDisplayNumber | ( | ) | const |
Calculates the visible number of the measure, based on the first MeasureNumberRegion that contains it.
Depending on the display options of the found MeasureNumberRegion, the number may or may not appear in the score. And if it does, it may not appear as a number.
std::shared_ptr< TimeSignature > musx::dom::others::Measure::createDisplayTimeSignature | ( | const std::optional< InstCmper > & | forStaff = std::nullopt | ) | const |
Create a shared pointer to an instance of the display TimeSignature for this measure and staff.
forStaff | If present, specifies the specific staff for which to create the time signature. |
std::shared_ptr< KeySignature > musx::dom::others::Measure::createKeySignature | ( | const std::optional< InstCmper > & | forStaff = std::nullopt | ) | const |
Creates and returns a shared pointer to an instance of the KeySignature for this measure and staff.
forStaff | If present, specifies the specific staff for which to create the key signature. |
std::shared_ptr< TimeSignature > musx::dom::others::Measure::createTimeSignature | ( | const std::optional< InstCmper > & | forStaff = std::nullopt | ) | const |
Create a shared pointer to an instance of the TimeSignature for this measure and staff.
forStaff | If present, specifies the specific staff for which to create the time signature. |
|
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.
musx::dom::integrity_error | if there is a problem. |
Reimplemented from musx::dom::Base.
|
inlineoverridevirtual |
Reimplemented from musx::dom::Base.
bool musx::dom::others::Measure::abbrvTime {} |
Indicates abbreviated time signature (e.g., Common or Cut time.) Applies to the display time signature only. The actual time signature's abbreviation is controlled by the values in options::TimeSignatureOptions.