|
MUSX Document Model
|
Represents a document object that encapsulates the entire EnigmaXML structure. More...
#include <Document.h>
Public Member Functions | |
| HeaderPtr & | getHeader () |
| Retrieves the header. | |
| const HeaderPtr & | getHeader () const |
| Retrieves the const header. | |
| OptionsPoolPtr & | getOptions () |
| Retrieves the options pool. | |
| const OptionsPoolPtr & | getOptions () const |
| Retrieves the const options pool. | |
| OthersPoolPtr & | getOthers () |
| Retrieves the others pool. | |
| const OthersPoolPtr & | getOthers () const |
| Retrieves the const others pool. | |
| DetailsPoolPtr & | getDetails () |
| Retrieves the details pool. | |
| const DetailsPoolPtr & | getDetails () const |
| Retrieves the const others pool. | |
| EntryPoolPtr & | getEntries () |
| Retrieves the entry pool. | |
| const EntryPoolPtr & | getEntries () const |
| Retrieves the entry others pool. | |
| TextsPoolPtr & | getTexts () |
| Retrieves the texts pool. | |
| const TextsPoolPtr & | getTexts () const |
| Retrieves the const texts pool. | |
| PartVoicingPolicy | getPartVoicingPolicy () const |
| Retrieves the document's part voicing policy. | |
| constexpr Cmper | calcScrollViewCmper (Cmper partId) const noexcept |
Returns the Scroll View Cmper for the given partId. | |
| MusxInstanceList< others::StaffUsed > | getScrollViewStaves (Cmper partId) const |
Returns the Scroll View staves for the given partId. | |
| MusxInstanceList< others::StaffUsed > | getStudioViewStaves (Cmper partId) const |
Returns the Studio View staves for the given partId. Normally this is only one staff and is invariant between parts. | |
| std::optional< KnownShapeDefType > | getCachedShapeRecognition (Cmper shapeCmper) const |
| Retrieves a cached shape recognition result, if available. | |
| void | setCachedShapeRecognition (Cmper shapeCmper, KnownShapeDefType type) const |
| Stores a shape recognition result in the cache. | |
| MusxInstance< others::Page > | calcPageFromMeasure (Cmper partId, MeasCmper measureId) const |
| Searches pages to find the page that contains the measure. | |
| MusxInstance< others::StaffSystem > | calcSystemFromMeasure (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 InstrumentMap & | getInstruments () const |
| Returns the instrument map for this document. It is computed by the factory. | |
| const InstrumentInfo & | getInstrumentForStaff (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. | |
| MusicRange | calcEntireDocument () const |
| Calcuate a MusicRange instance for the entire document. | |
| std::vector< MeasCmper > | calcJumpFromMeasures (Cmper partId, MeasCmper currentMeasure) const |
Calculates the measures from which playback jumped into currentMeasure. | |
| bool | iterateEntries (Cmper partId, std::function< bool(const EntryInfoPtr &)> iterator) const |
| Iterate all entries in the document by staff and then measure. This function wraps MusxInstanceList<others::StaffUsed>::iterateEntries. | |
Friends | |
| class | musx::factory::DocumentFactory |
Represents a document object that encapsulates the entire EnigmaXML structure.
| bool musx::dom::Document::calcHasVaryingSystemStaves | ( | Cmper | forPartId | ) | const |
Calculate if the current score/part has staves that differ from system to system.
| forPartId | The linked score or part ID to check. |
| std::vector< MeasCmper > musx::dom::Document::calcJumpFromMeasures | ( | Cmper | partId, |
| MeasCmper | currentMeasure | ||
| ) | const |
Calculates the measures from which playback jumped into currentMeasure.
This function inspects repeat endings and text repeats to detect jumps that land on the specified measure. The result is the measure immediately preceding the jump origin, when determinable. It is intended for jump-aware tie continuation logic.
| partId | The linked part to inspect (use SCORE_PARTID for score). |
| currentMeasure | The measure that playback has jumped into. |
| MusxInstance< others::Page > musx::dom::Document::calcPageFromMeasure | ( | Cmper | partId, |
| MeasCmper | measureId | ||
| ) | const |
Searches pages to find the page that contains the measure.
| partId | the linked part to search |
| measureId | the measure to find |
|
inlineconstexprnoexcept |
Returns the Scroll View Cmper for the given partId.
| partId | The linked part to check. |
| MusxInstance< others::StaffSystem > musx::dom::Document::calcSystemFromMeasure | ( | Cmper | partId, |
| MeasCmper | measureId | ||
| ) | const |
Searches systems to find the page that contains the measure.
| partId | the linked part to search |
| measureId | the measure to find |
| 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:
This is especially important for supporting legacy .musx files created before multi-staff instruments were defined explicitly.
| forPartId | The linked part for which to create the map. |
| const InstrumentInfo & musx::dom::Document::getInstrumentForStaff | ( | StaffCmper | staffId | ) | const |
Get the instrument info for the given staffId.
| staffId | The staffId to find. |
| MusxInstanceList< others::StaffUsed > musx::dom::Document::getScrollViewStaves | ( | Cmper | partId | ) | const |
Returns the Scroll View staves for the given partId.
| partId | The linked part to check. |
| MusxInstanceList< others::StaffUsed > musx::dom::Document::getStudioViewStaves | ( | Cmper | partId | ) | const |
Returns the Studio View staves for the given partId. Normally this is only one staff and is invariant between parts.
| partId | The linked part to check. |
| bool musx::dom::Document::iterateEntries | ( | Cmper | partId, |
| std::function< bool(const EntryInfoPtr &)> | iterator | ||
| ) | const |
Iterate all entries in the document by staff and then measure. This function wraps MusxInstanceList<others::StaffUsed>::iterateEntries.
| partId | The linked part id to iterate. (Use SCORE_PARTID to iterate the score.) |
| iterator | The callback function. |
iterator returned false and exited early.