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

Assigns a TextExpressionDef or ShapeExpressionDef to a measure. More...

#include <Others.h>

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

Public Types

enum class  ChannelSwitchTarget {
  Current , ToLayer1 , ToLayer2 , ToLayer3 ,
  ToLayer4 , ToChord , ToExpression
}
 The values for "On Playback Affect". The target channels are specified in the Score Manager dropdown for staves. More...
 
enum class  PlaybackStart { BeginningOfMeasure , AlignmentPoint , PositionInMeasure }
 The choice where to start playback. More...
 
enum class  ShowStaffList { ScoreAndPart , ScoreOnly , PartOnly }
 Where to show the assignment (when there is no staff list.) 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

 MeasureExprAssign (const DocumentWeakPtr &document, Cmper ID, ShareMode shareMode, Cmper cmper, Inci inci)
 Constructor function.
 
MusxInstance< TextExpressionDefgetTextExpression () const
 Gets the assigned text expression.
 
MusxInstance< ShapeExpressionDefgetShapeExpression () const
 Gets the assigned shape expression.
 
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.
 
- Public Member Functions inherited from musx::dom::OthersBase
 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< IncigetInci () 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.
 
- 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.
 
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 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< MeasureExprAssign > & xmlMappingArray ()
 Required for musx::factory::FieldPopulator.
 

Public Attributes

Cmper textExprId {}
 The Cmper of a text expression (xml node is <textExprID>)
 
Cmper shapeExprId {}
 The Cmper of a shape expression (xml node is <shapeExprID>)
 
Evpu horzEvpuOff {}
 Horizontal Evpu offset from the default position.
 
Edu eduPosition {}
 Horizontal Edu position (xml node is <horzEduOff>)
 
Evpu vertEvpuOff {}
 Vertical Evpu offset from the default position (xml node is <vertOff>)
 
StaffCmper staffAssign {}
 The staff to which this expression is assigned, or -1 if it is assigned to top staff and -2 if assigned to bottom staff.
 
int layer {}
 The 1-based layer number (1..4) to which this expression is assigned. (0 = all layers.)
 
ChannelSwitchTarget channelSwitch {}
 "On Playback Affect" value.
 
bool dontScaleWithEntry {}
 Inverse of "Scale Expression with Attached Note".
 
PlaybackStart playbackStart {}
 Where to start playback.
 
ShowStaffList showStaffList {}
 "Show On Score and Part(s)|Score Only|Part(s) Only".
 
bool createdByHp {}
 This assignment was created by Finale's smart playback engine.
 
bool hidden {}
 True if the expression is hidden.
 
int staffGroup {}
 Assignment is part of a group of assignments associated with a staff list and should be modified as a group.
 
Cmper staffList {}
 
int graceNoteIndex {}
 1-based index from leftmost grace note. 0 = main note.
 
int rehearsalMarkOffset {}
 Restarts the rehearsal mark sequence at this 1-based sequence value. If this is zero, the sequence continues normally.
 

Static Public Attributes

static constexpr std::string_view XmlNodeName = "measExprAssign"
 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.
 
OthersBaseoperator= (const OthersBase &other)
 Assignment operator delegates to base, preserving OthersBase state.
 
OthersBaseoperator= (OthersBase &&other) noexcept
 Assignment operator delegates to base, preserving OthersBase state.
 
- 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

Assigns a TextExpressionDef or ShapeExpressionDef to a measure.

Only one of textExprId or shapeExprId is non-zero.

The Cmper for a MeasureExprAssign is the Cmper of the Measure to which it is attached.

Member Enumeration Documentation

◆ ChannelSwitchTarget

The values for "On Playback Affect". The target channels are specified in the Score Manager dropdown for staves.

Enumerator
Current 

Current channel. (Default value may not appear in xml.)

ToLayer1 

Switch to layer 1 channel. (xml value is "toL1")

ToLayer2 

Switch to layer 2 channel. (xml value is "toL2")

ToLayer3 

Switch to layer 3 channel. (xml value is "toL3")

ToLayer4 

Switch to layer 4 channel. (xml value is "toL4")

ToChord 

Switch to chord channel. (xml value is "toChord")

ToExpression 

Switch to expression channel. (xml value is "toDyn")

◆ PlaybackStart

The choice where to start playback.

Enumerator
BeginningOfMeasure 

Start playback at beginning of measure. (Default value may not appear in xml.)

AlignmentPoint 

Start playback at alignment point as determined by the associated TextExpressionDef or ShapeExpressionDef. (xml value is "attach")

PositionInMeasure 

Start playback at the Edu position of the assignment. (xml value is "measPos")

◆ ShowStaffList

Where to show the assignment (when there is no staff list.)

Enumerator
ScoreAndPart 

Score and Part(s). (Default value may not appear in xml.)

ScoreOnly 

Score Only.

PartOnly 

Part(s) Only.

Member Function Documentation

◆ getShapeExpression()

MusxInstance< ShapeExpressionDef > musx::dom::others::MeasureExprAssign::getShapeExpression ( ) const

Gets the assigned shape expression.

Returns
The shape expression or nullptr if this assignment is for a text expression or shapeExprId not found.

◆ getTextExpression()

MusxInstance< TextExpressionDef > musx::dom::others::MeasureExprAssign::getTextExpression ( ) const

Gets the assigned text expression.

Returns
The text expression or nullptr if this assignment is for a shape expression or textExprId not found.

◆ integrityCheck()

void musx::dom::others::MeasureExprAssign::integrityCheck ( const std::shared_ptr< Base > &  ptrToThis)
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.

Parameters
ptrToThisThis instance in a shared_ptr. (Avoids need for shared_from_this.)
Exceptions
musx::dom::integrity_errorif there is a problem.

Reimplemented from musx::dom::Base.

Member Data Documentation

◆ staffList

Cmper musx::dom::others::MeasureExprAssign::staffList {}

The cmper of the marking category staff list that is controlling this assignment (if any). There will be a separate MeasureExprAssign instance for every staff in the staff list.