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

A list of instruments, which may be single- or multi-staff. More...

#include <Instrument.h>

+ Inheritance diagram for musx::dom::InstrumentMap:

Public Member Functions

 InstrumentMap (const DocumentWeakPtr &document, Cmper partId=SCORE_PARTID)
 Constructs an empty instrument map for a score or linked part.
 
const InstrumentInfogetInstrumentForStaff (StaffCmper staffId) const
 Get the instrument info for the given staffId in the given map.
 
- Public Member Functions inherited from musx::dom::DocumentElement
virtual ~DocumentElement () noexcept(false)=default
 Virtual destructor for polymorphic behavior.
 
DocumentPtr getDocument () const
 Gets a reference to the Document.
 
Cmper getPartId () const
 Gets the part id associated with this instance.
 

Additional Inherited Members

- Protected Member Functions inherited from musx::dom::DocumentElement
 DocumentElement (const DocumentWeakPtr &document, Cmper partId)
 Constructs the document element.
 
 DocumentElement (const DocumentElement &)=default
 explicit default copy constructor
 
 DocumentElement (DocumentElement &&) noexcept=default
 explicit default move constructor
 
DocumentElementoperator= (const DocumentElement &)
 no-op copy assignment operator allows subclasses to copy their values.
 
DocumentElementoperator= (DocumentElement &&) noexcept
 no-op move assignment operator allows subclasses to move their values.
 

Detailed Description

A list of instruments, which may be single- or multi-staff.

This is not a Finale data class. It is a normalized, interchange-oriented view of the logical instruments available in a score or linked part.

Constructor & Destructor Documentation

◆ InstrumentMap()

musx::dom::InstrumentMap::InstrumentMap ( const DocumentWeakPtr document,
Cmper  partId = SCORE_PARTID 
)
inlineexplicit

Constructs an empty instrument map for a score or linked part.

Parameters
documentThe document this map describes.
partIdThe score or linked part ID represented by this map.

Member Function Documentation

◆ getInstrumentForStaff()

const InstrumentInfo * musx::dom::InstrumentMap::getInstrumentForStaff ( StaffCmper  staffId) const

Get the instrument info for the given staffId in the given map.

Parameters
staffIdThe staffId to find.
Returns
The InstrumentInfo for the staffId or null if not found.