MUSX Document Model
|
Wraps a frame of shared_ptr<const EntryInfo> and an index for per entry access. This class manages ownership of the frame so that any instance of it keeps the frame alive without the need for circular references. More...
#include <Entries.h>
Public Member Functions | |
EntryInfoPtr () | |
Default constructor. | |
EntryInfoPtr (const std::shared_ptr< const EntryFrame > &entryFrame, size_t index=0) | |
Constructor function. | |
const std::shared_ptr< const EntryInfo > | operator-> () const |
Allows -> access to the underlying EntryInfo instance. | |
operator bool () const | |
Provides a boolean conversion based on whether the frame is valid and contains entries. | |
bool | isSameEntry (const EntryInfoPtr &src) const |
Returns whether the input and the current instance refer to the same entry. | |
std::shared_ptr< const EntryFrame > | getFrame () const |
Returns the frame. | |
size_t | getIndexInFrame () const |
Returns the index within the frame. | |
LayerIndex | getLayerIndex () const |
Get the layer index (0..3) of the entry. | |
InstCmper | getStaff () const |
Get the staff cmper. | |
MeasCmper | getMeasure () const |
Get the measure cmper. | |
std::shared_ptr< others::StaffComposite > | createCurrentStaff (const std::optional< InstCmper > &forStaffId=std::nullopt) const |
Creates the current StaffComposite for the entry. | |
std::shared_ptr< KeySignature > | getKeySignature () const |
Get the key signature of the entry. | |
unsigned | calcReverseGraceIndex () const |
Caclulates the grace index counting leftward (used by other standards such as MNX) | |
std::optional< size_t > | calcNextTupletIndex (std::optional< size_t > currentIndex) const |
Returns the next higher tuplet index that this entry starts, or std::nullopt if none. | |
EntryInfoPtr | getNextInFrame () const |
Get the next entry in the frame. | |
EntryInfoPtr | getNextInLayer () const |
Get the next entry in the same layer and staff. This can be in the next measure. | |
EntryInfoPtr | getNextSameV () const |
Get the next entry in the frame in the same voice. | |
EntryInfoPtr | getPreviousInLayer () const |
Get the previous entry in the same layer and staff. This can be in the previous measure. | |
EntryInfoPtr | getPreviousInFrame () const |
Get the previous entry in the frame. | |
EntryInfoPtr | getPreviousSameV () const |
Get the previous entry in the frame in the same voice. | |
EntryInfoPtr | getNextInVoice (int voice) const |
Returns the next entry in the frame in the specified v1/v2 or null if none. | |
EntryInfoPtr | getNextInBeamGroup (bool includeHiddenEntries=false) const |
Gets the next entry in a beamed group or nullptr if the entry is not beamed or is the last in the group. | |
EntryInfoPtr | getPreviousInBeamGroup (bool includeHiddenEntries=false) const |
Gets the previous entry in a beamed group or nullptr if the entry is not beamed or is the first in the group. | |
bool | calcDisplaysAsRest () const |
Calculates if an entry displays as a rest. | |
bool | calcUnbeamed () const |
Returns whether this is an unbeamed entry. | |
bool | calcIsBeamStart () const |
Returns whether this is the start of a primary beam. | |
EntryInfoPtr | findBeamEnd () const |
Finds the end entry of a beamed group. | |
NoteInfoPtr | findEqualPitch (const NoteInfoPtr &src) const |
Finds a note with the same pitch in the current entry. | |
unsigned | calcNumberOfBeams () const |
Calculates the number of beams or flags on the entry. | |
unsigned | calcLowestBeamStart () const |
Returns the lowest beam number starting at this entry, where 1 = 8th note beam, 2 = 16th note beam, etc. | |
unsigned | calcLowestBeamEnd () const |
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam, etc. | |
unsigned | calcLowestBeamStub () const |
Returns the lowest beam stub at this entry, where 2 = 16th note stub, 3 = 32nd note stub, etc. | |
bool | calcBeamStubIsLeft () const |
Calculates if a beam stub on this entry would go left or right. It does not check that an entry actually has a beam stub. Use calcLowestBeamStub to discover if the entry has a beam stub. | |
Wraps a frame of shared_ptr<const EntryInfo> and an index for per entry access. This class manages ownership of the frame so that any instance of it keeps the frame alive without the need for circular references.
|
inline |
Constructor function.
entryFrame | The entry frame. |
index | The index of this instance within the frame. |
bool musx::dom::EntryInfoPtr::calcBeamStubIsLeft | ( | ) | const |
Calculates if a beam stub on this entry would go left or right. It does not check that an entry actually has a beam stub. Use calcLowestBeamStub to discover if the entry has a beam stub.
bool musx::dom::EntryInfoPtr::calcDisplaysAsRest | ( | ) | const |
Calculates if an entry displays as a rest.
unsigned musx::dom::EntryInfoPtr::calcLowestBeamEnd | ( | ) | const |
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam, etc.
unsigned musx::dom::EntryInfoPtr::calcLowestBeamStart | ( | ) | const |
Returns the lowest beam number starting at this entry, where 1 = 8th note beam, 2 = 16th note beam, etc.
unsigned musx::dom::EntryInfoPtr::calcLowestBeamStub | ( | ) | const |
Returns the lowest beam stub at this entry, where 2 = 16th note stub, 3 = 32nd note stub, etc.
bool musx::dom::EntryInfoPtr::calcUnbeamed | ( | ) | const |
Returns whether this is an unbeamed entry.
std::shared_ptr< others::StaffComposite > musx::dom::EntryInfoPtr::createCurrentStaff | ( | const std::optional< InstCmper > & | forStaffId = std::nullopt | ) | const |
Creates the current StaffComposite for the entry.
forStaffId | Specifies optional staff ID. If supplied, it overrides the entry's staff ID. (Usefule when notes are cross-staffed.) |
EntryInfoPtr musx::dom::EntryInfoPtr::findBeamEnd | ( | ) | const |
Finds the end entry of a beamed group.
NoteInfoPtr musx::dom::EntryInfoPtr::findEqualPitch | ( | const NoteInfoPtr & | src | ) | const |
Finds a note with the same pitch in the current entry.
src | the pitch to search for |
EntryInfoPtr musx::dom::EntryInfoPtr::getNextInLayer | ( | ) | const |
Get the next entry in the same layer and staff. This can be in the next measure.
EntryInfoPtr musx::dom::EntryInfoPtr::getNextInVoice | ( | int | voice | ) | const |
Returns the next entry in the frame in the specified v1/v2 or null if none.
Unlike getNextSameV, this returns the next v2 entry in any v2 launch sequence.
voice | 1 or 2 |
EntryInfoPtr musx::dom::EntryInfoPtr::getNextSameV | ( | ) | const |
Get the next entry in the frame in the same voice.
For V2, it returns null after the current V2 launch sequence.
EntryInfoPtr musx::dom::EntryInfoPtr::getPreviousInLayer | ( | ) | const |
Get the previous entry in the same layer and staff. This can be in the previous measure.
EntryInfoPtr musx::dom::EntryInfoPtr::getPreviousSameV | ( | ) | const |
Get the previous entry in the frame in the same voice.
For V2, it returns null when it hits the v2Launch note for the current V2 launch sequence.
bool musx::dom::EntryInfoPtr::isSameEntry | ( | const EntryInfoPtr & | src | ) | const |
Returns whether the input and the current instance refer to the same entry.