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

Represents a vector of EntryInfo instances for a given frame, along with computed information. More...

#include <Entries.h>

+ Inheritance diagram for musx::dom::EntryFrame:

Classes

struct  TupletInfo
 class to track tuplets in the frame More...
 

Public Member Functions

 EntryFrame (const details::GFrameHoldContext &gfhold, LayerIndex layerIndex, util::Fraction timeStretch)
 Constructor function.
 
DocumentPtr getDocument () const
 Get the document for the entry frame.
 
Cmper getRequestedPartId () const
 Get the requested part ID for the entry frame.
 
InstCmper getStaff () const
 Get the staff for the entry.
 
MeasCmper getMeasure () const
 Get the measure for the entry frame.
 
LayerIndex getLayerIndex () const
 Get the layer index (0..3) of the entry frame.
 
util::Fraction getTimeStretch () const
 Get the time stretch in this frame. Rather than accessing this value directly, consider using EntryInfoPtr::calcGlobalElapsedDuration or EntryInfoPtr::calcGlobalActualDuration instead.
 
const std::vector< std::shared_ptr< const EntryInfo > > & getEntries () const
 Get the entry list.
 
EntryInfoPtr getFirstInVoice (int voice) const
 Returns the first entry in the specified v1/v2 or null if none.
 
EntryInfoPtr getLastInVoice (int voice) const
 Returns the last entry in the specified v1/v2 or null if none.
 
void addEntry (const std::shared_ptr< const EntryInfo > &entry)
 Add an entry to the list.
 
std::shared_ptr< const EntryFramegetNext () const
 Gets the entry frame for the next measure with the same staff and layer.
 
std::shared_ptr< const EntryFramegetPrevious () const
 Gets the entry frame for the previous measure with the same staff and layer.
 
std::shared_ptr< others::StaffCompositecreateCurrentStaff (Edu eduPosition, const std::optional< InstCmper > &forStaffId=std::nullopt) const
 Creates a current StaffComposite for the entry frame.
 
std::shared_ptr< others::MeasuregetMeasureInstance () const
 Get the measure instance.
 
bool calcIsCueFrame () const
 Calculates if this entry frame is part of a cue.
 

Public Attributes

std::vector< TupletInfotupletInfo
 A list of the tuplets in the frame and their calculated starting and ending information.
 
std::shared_ptr< KeySignaturekeySignature
 this can be different than the measure key sig if the staff has independent key signatures
 

Detailed Description

Represents a vector of EntryInfo instances for a given frame, along with computed information.

Its pointers are owned by EntryInfoPtr

Constructor & Destructor Documentation

◆ EntryFrame()

musx::dom::EntryFrame::EntryFrame ( const details::GFrameHoldContext gfhold,
LayerIndex  layerIndex,
util::Fraction  timeStretch 
)
inlineexplicit

Constructor function.

Parameters
gfholdThe details::GFrameHoldContext instance creating this EntryFrame
layerIndexThe LayerIndex (0..3) of the entry frame
timeStretchThe ratio of global Edu to staff edu.

Member Function Documentation

◆ calcIsCueFrame()

bool musx::dom::EntryFrame::calcIsCueFrame ( ) const

Calculates if this entry frame is part of a cue.

Todo:
Revisit this algorithm if needed. The current algorithm is chosen to be mostly accurate while being fast to compute when there is no cue.
Returns
true if all entries in the frame are either cue entries or hidden.

◆ createCurrentStaff()

std::shared_ptr< others::StaffComposite > musx::dom::EntryFrame::createCurrentStaff ( Edu  eduPosition,
const std::optional< InstCmper > &  forStaffId = std::nullopt 
) const

Creates a current StaffComposite for the entry frame.

Parameters
eduPositionThe Edu position for which to create the staff.
forStaffIdSpecifies optional staff ID. If supplied, it overrides the entry's staff ID. (Useful when notes are cross-staffed.)

◆ getFirstInVoice()

EntryInfoPtr musx::dom::EntryFrame::getFirstInVoice ( int  voice) const

Returns the first entry in the specified v1/v2 or null if none.

Parameters
voice1 or 2

◆ getLastInVoice()

EntryInfoPtr musx::dom::EntryFrame::getLastInVoice ( int  voice) const

Returns the last entry in the specified v1/v2 or null if none.

Parameters
voice1 or 2

◆ getNext()

std::shared_ptr< const EntryFrame > musx::dom::EntryFrame::getNext ( ) const

Gets the entry frame for the next measure with the same staff and layer.

Returns
Frame or nullpter if the next measure has no matching frame.

◆ getPrevious()

std::shared_ptr< const EntryFrame > musx::dom::EntryFrame::getPrevious ( ) const

Gets the entry frame for the previous measure with the same staff and layer.

Returns
Frame or nullpter if the previous measure has no matching frame,

Member Data Documentation

◆ tupletInfo

std::vector<TupletInfo> musx::dom::EntryFrame::tupletInfo

A list of the tuplets in the frame and their calculated starting and ending information.

Note
Tuplets that start on grace notes are omitted from this list. Finale does not display them, and it is not possible to calculate their endpoints correctly in the general case. (Which is probably why Finale does not display them.)