MUSX Document Model
|
Represents an entry containing metadata and notes. More...
#include <Entries.h>
Public Member Functions | |
Entry (const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, EntryNumber entnum, EntryNumber prev, EntryNumber next) | |
Constructor function. | |
EntryNumber | getEntryNumber () const |
Gets the entry number for this entry. | |
std::shared_ptr< Entry > | getNext () const |
Gets the next entry in this list or nullptr if none. | |
std::shared_ptr< Entry > | getPrevious () const |
Gets the previous entry in this list or nullptr if none. | |
std::pair< NoteType, int > | calcNoteInfo () const |
Calculates the NoteType and number of augmentation dots. (See calcNoteInfoFromEdu.) | |
util::Fraction | calcFraction () const |
Calculates the duration as a util::Fraction of a whole note. | |
bool | hasStem () const |
Returns true if the entry's duration has a stem. | |
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 |
Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class. | |
![]() | |
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< Entry > & | xmlMappingArray () |
Required for musx::factory::FieldPopulator. | |
Public Attributes | |
Edu | duration {} |
Duration of the entry, not taking into account tuplets. | |
int | numNotes {} |
Number of notes in the entry. There is an error if this is not the same as notes.size(). | |
bool | isValid {} |
Should always be true but otherwise appears to be used internally by Finale. | |
bool | isNote {} |
If this value is false, the entry is a rest. | |
bool | graceNote {} |
Indicate the entry is a grace note. | |
bool | floatRest {} |
Is floating rest. If false, the first note element gives the staff position of the rest. | |
bool | isHidden {} |
Indicates the entry is hidden, (xml node is <ignore> ) | |
bool | voice2 {} |
This is a V2 note. (xml node <v2> ) | |
bool | articDetail {} |
Indicates there is an articulation on the entry. | |
bool | beam {} |
Signifies the start of a beam or singleton entry. (That is, any beam breaks at this entry.) | |
bool | secBeam {} |
Signifies a secondary beam break occurs on the entry. | |
bool | crossStaff {} |
Signifies that at least one note in the entry has been cross staffed. | |
bool | freezeStem {} |
Freeze stem flag (upStem gives the direction.) | |
bool | upStem {} |
Whether a stem is up or down. (Only reliable when freezeStem is true.) | |
bool | stemDetail {} |
Indicates there are stem modification. | |
bool | smartShapeDetail {} |
Indicates this entry has a smart shape assignment. | |
bool | sorted {} |
Sorted flag. | |
bool | lyricDetail {} |
Indicates there is a lyric assignment on the entry. | |
bool | performanceData {} |
Indicates there is performance data on the entry. | |
bool | freezeBeam {} |
Freeze beam flag (Derived from the presence of <freezeBeam> node.) | |
std::vector< std::shared_ptr< Note > > | notes |
Collection of notes that comprise the entry. These are in order from lowest to highest. | |
Static Public Attributes | |
static constexpr std::string_view | XmlNodeName = "entry" |
The XML node name for this type. | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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 an entry containing metadata and notes.
This class is identified by the XML node name "entry".
|
inlineexplicit |
Constructor function.
The partId and shareMode values should always be 0 and ShareMode::All, but they are required by the factory function.
std::shared_ptr< Entry > musx::dom::Entry::getNext | ( | ) | const |
Gets the next entry in this list or nullptr if none.
Note that the entry list may contain entries that aren't in any frame. These should be ignored.
std::shared_ptr< Entry > musx::dom::Entry::getPrevious | ( | ) | const |
Gets the previous entry in this list or nullptr if none.
Note that the entry list may contain entries that aren't in any frame. These should be ignored.
|
inline |
Returns true if the entry's duration has a stem.
|
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 |
Specifies if the parser should alert (print or throw) when an unknown xml tag is found for this class.
Some classes make it difficult to discover all the possible xml tags that might be used for all its options. An example is others::TextBlock. By overriding this function, a class can allow its members to be discovered as needed without causing error messages or throwing exceptions.
Reimplemented from musx::dom::Base.
Edu musx::dom::Entry::duration {} |
Duration of the entry, not taking into account tuplets.
This is effectively the type of note (quarter, eight, whole etc.) plus the augmentation dots, if any. The most significant bit determines the note type and each set bit to the right is an augmentation dot.
(xml node is <dura>
)