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

Represents a document object that encapsulates the entire EnigmaXML structure. More...

#include <Document.h>

Public Member Functions

HeaderPtrgetHeader ()
 Retrieves the header.
 
const HeaderPtrgetHeader () const
 Retrieves the const header.
 
OptionsPoolPtrgetOptions ()
 Retrieves the options pool.
 
const OptionsPoolPtrgetOptions () const
 Retrieves the const options pool.
 
OthersPoolPtrgetOthers ()
 Retrieves the others pool.
 
const OthersPoolPtrgetOthers () const
 Retrieves the const others pool.
 
DetailsPoolPtrgetDetails ()
 Retrieves the details pool.
 
const DetailsPoolPtrgetDetails () const
 Retrieves the const others pool.
 
EntryPoolPtrgetEntries ()
 Retrieves the entry pool.
 
const EntryPoolPtrgetEntries () const
 Retrieves the entry others pool.
 
TextsPoolPtrgetTexts ()
 Retrieves the texts pool.
 
const TextsPoolPtrgetTexts () const
 Retrieves the const texts pool.
 
MusxInstance< others::PagecalculatePageFromMeasure (Cmper partId, MeasCmper measureId) const
 Searches pages to find the page that contains the measure.
 
MusxInstance< others::StaffSystemcalculateSystemFromMeasure (Cmper partId, MeasCmper measureId) const
 Searches systems to find the page that contains the measure.
 
int getMaxBlankPages () const
 Returns the maximum number of blank pages in any part. This is calculated by factory::DocumentFactory::create.
 
const InstrumentMapgetInstruments () const
 Returns the instrument map for this document. It is computed by the factory.
 
const InstrumentInfogetInstrumentForStaff (StaffCmper staffId) const
 Get the instrument info for the given staffId.
 
InstrumentMap createInstrumentMap (Cmper forPartId) const
 Builds an instrument map for the specified linked part ID.
 
bool calcHasVaryingSystemStaves (Cmper forPartId) const
 Calculate if the current score/part has staves that differ from system to system.
 

Friends

class musx::factory::DocumentFactory
 

Detailed Description

Represents a document object that encapsulates the entire EnigmaXML structure.

Member Function Documentation

◆ calcHasVaryingSystemStaves()

bool musx::dom::Document::calcHasVaryingSystemStaves ( Cmper  forPartId) const

Calculate if the current score/part has staves that differ from system to system.

Parameters
forPartIdThe linked score or part ID to check.

◆ calculatePageFromMeasure()

MusxInstance< others::Page > musx::dom::Document::calculatePageFromMeasure ( Cmper  partId,
MeasCmper  measureId 
) const

Searches pages to find the page that contains the measure.

Parameters
partIdthe linked part to search
measureIdthe measure to find

◆ calculateSystemFromMeasure()

MusxInstance< others::StaffSystem > musx::dom::Document::calculateSystemFromMeasure ( Cmper  partId,
MeasCmper  measureId 
) const

Searches systems to find the page that contains the measure.

Parameters
partIdthe linked part to search
measureIdthe measure to find

◆ createInstrumentMap()

InstrumentMap musx::dom::Document::createInstrumentMap ( Cmper  forPartId) const

Builds an instrument map for the specified linked part ID.

This routine detects instrument groupings in three stages:

  1. Defined multi-staff instruments (via multiStaffInstId).
  2. Visually bracketed staves with matching instrument UUIDs.
  3. Remaining single staves as individual instruments.

This is especially important for supporting legacy .musx files created before multi-staff instruments were defined explicitly.

Parameters
forPartIdThe linked part for which to create the map.

◆ getInstrumentForStaff()

const InstrumentInfo & musx::dom::Document::getInstrumentForStaff ( StaffCmper  staffId) const

Get the instrument info for the given staffId.

Parameters
staffIdThe staffId to find.