MUSX Document Model
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
musx::dom::others::MeasureNumberRegion Class Reference

Represents the Measure Number Region with detailed font and enclosure settings for score and part data. More...

#include <Others.h>

+ Inheritance diagram for musx::dom::others::MeasureNumberRegion:

Classes

class  ScorePartData
 Measure number data that can differ in score or part. More...
 

Public Types

enum class  AlignJustify { Left , Right , Center }
 Alignment and justification options for measure numbers. More...
 
enum class  TimePrecision { WholeSeconds , Tenths , Hundredths , Thousandths }
 Precision for time display. 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

 MeasureNumberRegion (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
 Constructor function.
 
bool calcIncludesMeasure (MeasCmper measureId) const
 Calculates whether the input measure is covered by this measure number region.
 
int getStartNumber () const
 Returns the starting measure number for this region.
 
int calcDisplayNumberFor (MeasCmper measureId) const
 Returns the visible number for a measure id with respect to the region.
 
- Public Member Functions inherited from musx::dom::OthersBase
Cmper getCmper () const
 Gets the cmper key value.
 
std::optional< IncigetInci () const
 Gets the optional array index (inci).
 
- 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 void integrityCheck ()
 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.
 
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 std::shared_ptr< MeasureNumberRegionfindMeasure (const DocumentPtr &document, MeasCmper measureId)
 Finds the measure number region containing a measure.
 
static const xml::XmlElementArray< MeasureNumberRegion > & xmlMappingArray ()
 Required for musx::factory::FieldPopulator.
 

Public Attributes

std::shared_ptr< ScorePartDatascoreData
 Score-wide measure number data.
 
std::shared_ptr< ScorePartDatapartData
 Part-specific measure number data.
 
MeasCmper startMeas {}
 Starting measure number for the region.
 
MeasCmper endMeas {}
 Ending measure number for the region (non-inclusive).
 
char32_t startChar {}
 UTF-32 code for the first character in the sequence. (Frequently '0', 'a', or 'A')
 
int base {}
 The base used for measure number calculations. (Frequently 10 for numeric or 26 for alpha)
 
int numberOffset {}
 This value is 1 less than the "Starting Number" field in the Finale UI. (xml node is <offset>)
 
std::string prefix
 Text prefix for measure numbers (encoded UTF-8).
 
std::string suffix
 Text suffix for measure numbers (encoded UTF-8).
 
bool countFromOne {}
 Start counting from 1 rather than 0, e.g., "1, 2, 3, 4" numbering style (in conjuction with base 10)
 
bool noZero
 Indicates the base has no zero value: true for alpha sequences and false for numeric sequences.
 
bool doubleUp {}
 Indicates "a, b, c...aa, bb, cc" number style: the symbols are repeated when they exceed the base.
 
bool time {}
 Display real time sequences rather than numbers or letters.
 
bool includeHours {}
 Display hours (when showing real time measure numbers)
 
bool smpteFrames {}
 SMPTE frames (when showing real time measure numbers). This option supercedes timePrecision.
 
bool useScoreInfoForPart {}
 Use score-wide settings for parts.
 
int region {}
 The region ID. This 1-based value is set by Finale and never changes, whereas the Cmper may change when Finale sorts the regions.
 
TimePrecision timePrecision {}
 Precision for real-time sequences.
 
bool hideScroll {}
 Indicates if numbers are hidden in Scroll View and Studio View.
 
bool hidePage {}
 Indicates if numbers are hidden in Page View.
 

Static Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from musx::dom::OthersBase
 OthersBase (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper, std::optional< Inci > inci=std::nullopt)
 Constructs an OthersBase object.
 
- 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

Represents the Measure Number Region with detailed font and enclosure settings for score and part data.

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

Member Enumeration Documentation

◆ AlignJustify

Alignment and justification options for measure numbers.

Enumerator
Left 

Left alignment or justification (the default value.)

Right 

Right alignment.

Center 

Center alignment.

◆ TimePrecision

Precision for time display.

Enumerator
WholeSeconds 

the default value

Member Function Documentation

◆ calcDisplayNumberFor()

int musx::dom::others::MeasureNumberRegion::calcDisplayNumberFor ( MeasCmper  measureId) const

Returns the visible number for a measure id with respect to the region.

Exceptions
std::logic_errorif measureId is not contained in the region

◆ calcIncludesMeasure()

bool musx::dom::others::MeasureNumberRegion::calcIncludesMeasure ( MeasCmper  measureId) const
inline

Calculates whether the input measure is covered by this measure number region.

Parameters
measureIdThe measure id to check.

◆ findMeasure()

std::shared_ptr< others::MeasureNumberRegion > musx::dom::others::MeasureNumberRegion::findMeasure ( const DocumentPtr document,
MeasCmper  measureId 
)
static

Finds the measure number region containing a measure.

Parameters
documentThe document to search
measureIdThe measure Id to search for
Returns
The first MeasureNumberRegion instance that contains the measureId, or nullptr if not found.