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. | |
MusxInstance< KeySignature > | createKeySignature (const std::optional< StaffCmper > &forStaff=std::nullopt) const |
Creates and returns a shared pointer to an instance of the KeySignature for this measure and staff. | |
MusxInstance< TimeSignature > | createTimeSignature (const std::optional< StaffCmper > &forStaff=std::nullopt) const |
Create a shared pointer to an instance of the TimeSignature for this measure and staff. | |
MusxInstance< TimeSignature > | createDisplayTimeSignature (const std::optional< StaffCmper > &forStaff=std::nullopt) const |
Create a shared pointer to an instance of the display TimeSignature for this measure and staff. | |
util::Fraction | calcDuration (const std::optional< StaffCmper > &forStaff=std::nullopt) const |
Calculates the duration of the measure according to the time signature. | |
util::Fraction | calcTimeStretch (StaffCmper forStaff) const |
Calculates the time stretch. This is the value by which independent time edus are multiplied to get global edus. | |
void | integrityCheck (const std::shared_ptr< Base > &ptrToThis) 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. | |
![]() | |
OthersBase (const OthersBase &)=default | |
explicit default copy constructor | |
OthersBase (OthersBase &&) noexcept=default | |
explicit default move constructor | |
Cmper | getCmper () const |
Gets the cmper key value. | |
std::optional< Inci > | getInci () const |
Gets the optional array index (inci ). | |
Cmper | getRequestedPartId () const |
If this instance was retrieved from an object pool, it contains the part ID that was used to retrieve it. If this value is different than getSourcePartId, then this instance is a copy of the pool instance. | |
![]() | |
virtual | ~Base () noexcept(false)=default |
Virtual destructor for polymorphic behavior. | |
DocumentPtr | getDocument () const |
Gets a reference to the Document. | |
Cmper | getSourcePartId () const |
Gets the source partId for this instance. If an instance is fully shared with the score, the source is SCORE_PARTID. If an instance is partially shared or non shared, the source is the ID of the part that sourced it. | |
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. | |
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< 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 global key 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. | |
Cmper | customBarShape {} |
Cmper of Shape Designer ShapeDef for custom right barline. | |
Cmper | customLeftBarShape {} |
Cmper of Shape Designer ShapeDef for custom left barline. | |
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 | groupBarlineOverride {} |
Override the barline specified by a details::StaffGroup (if any) | |
bool | showFullNames {} |
"Show Full Staff & Group Names" | |
bool | hasMeasNumbIndivPos {} |
Has individual measure numbering positioning. (xml node is <mnSepPlace> ) | |
bool | allowSplitPoints {} |
"Allow Horizontal Split Points" See SplitMeasure. (xml node is <posSplit> ) | |
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> ) | |
ShowKeySigMode | showKey {} |
Show mode for key signatures. | |
ShowTimeSigMode | showTime {} |
Show mode for time signatures. | |
bool | evenlyAcrossMeasure {} |
"Position Evenly Across Measure" (xml node is <indivPosDef> ) | |
PositioningType | positioningMode {} |
Positioning type for the measure. (xml node is <posMode> ) | |
bool | beginNewSystem {} |
"Begin a New Staff System" (xml node is <lineBreak> ) | |
bool | hasExpression {} |
Indicates if the measure has an expression assigned. See MeasureExprAssign. (xml node is <hasExpr> ) | |
bool | breakMmRest {} |
"Break a Multimeasure Rests" (xml node is <breakRest> ) | |
bool | noMeasNum {} |
Inverse of "Include in Measure Numbering". | |
bool | hasOssia {} |
Indicates if the measure has an ossia assigned. (xml node is <arbitMusic> ) | |
bool | hasTextBlock {} |
Indicates if the measure has a measure-assigned text block. See details::MeasureTextAssign. | |
BarlineType | barlineType {} |
Barline type. (xml node is <barline> ) | |
bool | forwardRepeatBar {} |
Indicates a forward repeat bar on this measure. (xml node is <forRepBar> ) | |
bool | backwardsRepeatBar {} |
Indicates a backwards 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 | abbrvTime {} |
bool | useDisplayTimesig {} |
Indicates whether to use the display time signature. | |
bool | hasChord {} |
Indicates the presence of one or more chords. | |
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> ) | |
bool | pageBreak {} |
If true, begin new page here. (Behavior is weird if the measure is not the first of its system.) | |
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. | |
OthersBase & | operator= (const OthersBase &other) |
Assignment operator delegates to base, preserving OthersBase state. | |
OthersBase & | operator= (OthersBase &&other) noexcept |
Assignment operator delegates to base, preserving OthersBase state. | |
![]() | |
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 | |
Base & | operator= (const Base &) |
no-op copy assignment operator allows subclasses to copy their values. | |
Base & | operator= (Base &&) noexcept |
no-op move assignment operator allows subclasses to move their values. | |
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.
util::Fraction musx::dom::others::Measure::calcDuration | ( | const std::optional< StaffCmper > & | forStaff = std::nullopt | ) | const |
Calculates the duration of the measure according to the time signature.
forStaff | If present, specifies the specific staff for which to create duration. |
|
inline |
Calculates the time stretch. This is the value by which independent time edus are multiplied to get global edus.
forStaff | The staff for which to calculate the time stretch. |
MusxInstance< TimeSignature > musx::dom::others::Measure::createDisplayTimeSignature | ( | const std::optional< StaffCmper > & | 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. |
MusxInstance< KeySignature > musx::dom::others::Measure::createKeySignature | ( | const std::optional< StaffCmper > & | 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. |
MusxInstance< TimeSignature > musx::dom::others::Measure::createTimeSignature | ( | const std::optional< StaffCmper > & | 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.
ptrToThis | This instance in a shared_ptr. (Avoids need for shared_from_this.) |
musx::dom::integrity_error | if there is a problem. |
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.