MUSX Document Model
|
A context wrapper for GFrameHold associated with a specific part and location. More...
#include <Details.h>
Public Member Functions | |
GFrameHoldContext (const DocumentPtr &document, Cmper partId, Cmper inst, Cmper meas) | |
Constructs a context-aware GFrameHold wrapper. | |
Cmper | getRequestedPartId () const |
Returns the requested part ID associated with this context. | |
const GFrameHold * | operator-> () const |
Provides const pointer-style access to the underlying GFrameHold. | |
operator bool () const | |
Returns true if the internal GFrameHold is valid. | |
ClefIndex | calcClefIndexAt (Edu position) const |
Returns the clef index in effect for at the specified Edu position. This function does not take into account transposing clefs. Those are addressed in createEntryFrame. | |
ClefIndex | calcClefIndexAt (util::Fraction position) const |
Returns the clef index in effect for at the specified util::Fraction position (as a fraction of whole notes). This function does not take into account transposing clefs. Those are addressed in createEntryFrame. | |
std::shared_ptr< const EntryFrame > | createEntryFrame (LayerIndex layerIndex, bool forWrittenPitch=false) const |
Returns the EntryFrame for all entries in the given layer. | |
bool | iterateEntries (LayerIndex layerIndex, std::function< bool(const EntryInfoPtr &)> iterator) |
iterates the entries for the specified layer in this GFrameHold from left to right | |
bool | iterateEntries (std::function< bool(const EntryInfoPtr &)> iterator) |
iterates the entries for this GFrameHold from left to right for each layer in order | |
A context wrapper for GFrameHold associated with a specific part and location.
This class retrieves the appropriate GFrameHold from a Document using part, instrument, and measure IDs, and enables part-aware operations like iterating over EntryFrame objects.
musx::dom::details::GFrameHoldContext::GFrameHoldContext | ( | const DocumentPtr & | document, |
Cmper | partId, | ||
Cmper | inst, | ||
Cmper | meas | ||
) |
Constructs a context-aware GFrameHold wrapper.
document | Weak pointer to the owning Document. |
partId | The requested part ID. |
inst | The instrument ID for. |
meas | The measure ID for. |
std::shared_ptr< const EntryFrame > musx::dom::details::GFrameHoldContext::createEntryFrame | ( | LayerIndex | layerIndex, |
bool | forWrittenPitch = false |
||
) | const |
Returns the EntryFrame for all entries in the given layer.
layerIndex | The layer index (0..3) to iterate. |
forWrittenPitch | If true, the key and clef for each entry are calculated for written pitch rather than concert pitch. |
|
inline |
Returns the requested part ID associated with this context.
bool musx::dom::details::GFrameHoldContext::iterateEntries | ( | LayerIndex | layerIndex, |
std::function< bool(const EntryInfoPtr &)> | iterator | ||
) |
iterates the entries for the specified layer in this GFrameHold from left to right
layerIndex | The layer index (0..3) to iterate. |
iterator | The callback function for each iteration. |
std::invalid_argument | if the layer index is out of range |
bool musx::dom::details::GFrameHoldContext::iterateEntries | ( | std::function< bool(const EntryInfoPtr &)> | iterator | ) |
iterates the entries for this GFrameHold from left to right for each layer in order
iterator | The callback function for each iteration. |
|
inlineexplicit |
Returns true if the internal GFrameHold is valid.
|
inline |
Provides const pointer-style access to the underlying GFrameHold.