|
MUSX Document Model
|
Utility class that represents of a range of musical time. More...
#include <CommonClasses.h>
Inheritance diagram for musx::dom::MusicRange:Public Member Functions | |
| MusicRange (const DocumentWeakPtr &document, MeasCmper startMeasId, util::Fraction startPos, MeasCmper endMeasId, util::Fraction endPos) | |
| Constructs a MusicRange object. | |
| MusicRange (const DocumentWeakPtr &document, MusicPoint startPoint, MusicPoint endPoint) | |
| Constructs a MusicRange object. | |
| bool | contains (MeasCmper measId, util::Fraction position) const |
| Returns true of the given metric location is contained in this MusicRange instance. | |
| bool | contains (const MusicPoint &point) const |
| Returns true if the given metric location is contained in this MusicRange instance. | |
| bool | contains (const EntryInfoPtr &entryInfo) const |
| Returns true if the metric location of the specified entry is contained in this MusicRange instance. | |
| std::optional< MusicPoint > | nextLocation (const std::optional< StaffCmper > &forStaff=std::nullopt) const |
| Returns the next metric location following the music range. | |
Public Member Functions inherited from musx::dom::DocumentElementNoPart | |
| DocumentElementNoPart (const DocumentWeakPtr &document) | |
| Constructs the document element (with no meaningful associated part) | |
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. | |
Public Attributes | |
| MusicPoint | start |
| Starting point in the range. | |
| MusicPoint | end |
| Ending point in the range. | |
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 | |
| DocumentElement & | operator= (const DocumentElement &) |
| no-op copy assignment operator allows subclasses to copy their values. | |
| DocumentElement & | operator= (DocumentElement &&) noexcept |
| no-op move assignment operator allows subclasses to move their values. | |
Utility class that represents of a range of musical time.
This class is used to specify start and end points in a musical range using measures and util::Fraction values.
The class is agnostic as to whether the positions are global- or staff-position values. The consuming code makes this determination.
|
inlineexplicit |
Constructs a MusicRange object.
| document | Shared pointer to the document. |
| startMeasId | The start measure ID. |
| startPos | The start position. (Caller determines whether position is global- or staff-level.) |
| endMeasId | The end measure ID. |
| endPos | The end position. (Caller determines whether position is global- or staff-level.) |
|
inlineexplicit |
Constructs a MusicRange object.
| document | Shared pointer to the document. |
| startPoint | The starting point of the range. |
| endPoint | The ending point of the range. |
| bool musx::dom::MusicRange::contains | ( | const EntryInfoPtr & | entryInfo | ) | const |
Returns true if the metric location of the specified entry is contained in this MusicRange instance.
| entryInfo | The entry to check. |
|
inline |
Returns true if the given metric location is contained in this MusicRange instance.
| point | The metric location to search for. |
|
inline |
Returns true of the given metric location is contained in this MusicRange instance.
| measId | The measure ID to search for. |
| position | The fractional position within the measure to search for. |
| std::optional< MusicPoint > musx::dom::MusicRange::nextLocation | ( | const std::optional< StaffCmper > & | forStaff = std::nullopt | ) | const |
Returns the next metric location following the music range.
| forStaff | If provided, calculates the next metric location using staff-level Edus. |