MUSX Document Model
Loading...
Searching...
No Matches
Entries.h
1/*
2 * Copyright (C) 2025, Robert Patterson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22#pragma once
23
24#include <functional>
25#include <map>
26#include <tuple>
27#include <utility>
28#include <vector>
29
30#include "musx/util/Fraction.h"
31#include "BaseClasses.h"
32#include "CommonClasses.h"
33 // do not add other dom class dependencies. Use Implementations.h for implementations that need total class access.
34
35namespace music_theory {
36enum class NoteName : int;
37class Transposer;
38} // namespace music_theory
39
40namespace musx {
41namespace utils {
42enum class PseudoTieMode;
43} // namespace utils
44
45namespace dom {
46
47namespace others {
48class Frame;
49class PartVoicing;
50class PercussionNoteInfo;
51class SmartShape;
52class Staff;
53class StaffComposite;
54class StaffUsed;
55} // namespace others
56
57namespace details {
58class TupletDef;
59class GFrameHold;
60
69{
70public:
81 GFrameHoldContext(const DocumentPtr& document, Cmper partId, Cmper staffId, Cmper measureId, util::Fraction timeOffset = 0);
82
90 GFrameHoldContext(const MusxInstance<GFrameHold>& gfHold, util::Fraction timeOffset = 0);
91
97 [[nodiscard]]
98 Cmper getRequestedPartId() const { return m_requestedPartId; }
99
105 [[nodiscard]]
106 MusxInstance<others::PartVoicing> getPartVoicing() const { return m_partVoicing; }
107
113 [[nodiscard]]
115 { return m_honorPartVoicing ? m_partVoicing : nullptr; }
116
122 const GFrameHold* operator->() const { return m_hold.get(); }
123
129 explicit operator bool() const noexcept { return static_cast<bool>(m_hold); }
130
134 [[nodiscard]]
135 ClefIndex calcClefIndexAt(Edu position) const;
136
140 [[nodiscard]]
142 { return calcClefIndexAt(position.calcEduDuration()); }
143
149 [[nodiscard]]
150 std::shared_ptr<const EntryFrame> createEntryFrame(LayerIndex layerIndex) const;
151
159 bool iterateEntries(LayerIndex layerIndex, std::function<bool(const EntryInfoPtr&)> iterator) const;
160
166 bool iterateEntries(std::function<bool(const EntryInfoPtr&)> iterator) const;
167
171 [[nodiscard]]
172 std::map<LayerIndex, int> calcVoices(bool excludeHidden = false) const;
173
182 [[nodiscard]]
183 EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact = true, std::optional<LayerIndex> matchLayer = std::nullopt,
184 MatchVoice matchVoice = MatchVoice::Default, util::Fraction atGraceNoteDuration = 0) const;
185
194 [[nodiscard]]
195 EntryInfoPtr calcNearestEntryAtGraceIndex(util::Fraction position, unsigned graceNoteIndex, bool findExact = true,
196 std::optional<LayerIndex> matchLayer = std::nullopt, MatchVoice matchVoice = MatchVoice::Default) const;
197
204 util::Fraction snapLocationToEntryOrKeep(util::Fraction location, bool findExact = true) const;
205
211 [[nodiscard]]
213
218 [[nodiscard]]
219 bool calcVoicingIncludesLayer(LayerIndex layerIndex) const;
220
222 [[nodiscard]]
224 { return !m_honorPartVoicing || calcVoicingIncludesLayer(layerIndex); }
225
228 [[nodiscard]]
229 util::Fraction getTimeOffset() const { return m_timeOffset; }
230
231private:
232 EntryInfoPtr calcNearestEntryMatching(util::Fraction position, bool findExact, std::optional<LayerIndex> matchLayer,
233 MatchVoice matchVoice, const std::function<bool(const EntryInfoPtr&)>& matchesEntry) const;
234
236 Cmper m_requestedPartId{};
237 util::Fraction m_timeOffset;
239 bool m_honorPartVoicing{};
240};
241
242} // namespace details
243
254
260unsigned calcNumberOfBeamsInEdu(Edu duration);
261
268class Note : public EnigmaBase
269{
270public:
272 explicit Note(const DocumentWeakPtr& document, NoteNumber noteId)
273 : EnigmaBase(document, 0, ShareMode::All), m_noteId(noteId)
274 {
275 }
276
278 static constexpr NoteNumber RESTID = 31;
279
283 {
285 int octave{};
288
290 bool operator==(const NoteProperties& other) const
291 {
292 return noteName == other.noteName && octave == other.octave
293 && alteration == other.alteration && staffPosition == other.staffPosition;
294 }
295
297 bool operator!=(const NoteProperties& other) const
298 { return !(*this == other); }
299 };
300
301 int harmLev{};
302 int harmAlt{};
303 bool isValid{};
304 bool tieStart{};
305 bool tieEnd{};
306 bool crossStaff{};
311 bool upSplitStem{};
313 bool showAcci{};
314 bool parenAcci{};
315 bool noPlayback{};
316 bool noSpacing{};
317 bool freezeAcci{};
319
322 [[nodiscard]]
323 NoteNumber getNoteId() const { return m_noteId; }
324
335 [[nodiscard]]
336 std::pair<int, int> calcDefaultEnharmonic(const MusxInstance<KeySignature>& key) const;
337
363 [[nodiscard]]
365 const MusxInstance<others::PercussionNoteInfo>& percNoteInfo, const MusxInstance<others::Staff>& staff = nullptr, bool respellEnharmonic = false) const;
366
368
369private:
370 NoteNumber m_noteId{};
371};
372
379class Entry : public EnigmaBase
380{
381public:
386 explicit Entry(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, EntryNumber entnum, EntryNumber prev, EntryNumber next)
387 : EnigmaBase(document, partId, shareMode), m_entnum(entnum), m_prev(prev), m_next(next)
388 {
389 }
390
400 int numNotes{};
402 bool isValid{};
403 bool isNote{};
404 bool v2Launch{};
405 bool voice2{};
406 bool createdByHP{};
408 bool graceNote{};
409 bool noteDetail{};
410 bool articDetail{};
411 bool lyricDetail{};
412 bool tupletStart{};
413 bool splitRest{};
415 bool floatRest{};
416 bool isHidden{};
417 bool beamExt{};
418 bool flipTie{};
419 bool dotTieAlt{};
420 bool beam{};
421 bool secBeam{};
423 bool stemDetail{};
424 bool crossStaff{};
427 bool doubleStem{};
428 bool splitStem{};
430 bool upStemScore{};
431 bool checkAccis{};
432 bool dummy{};
435 bool noLeger{};
436 bool sorted{};
437 bool slashGrace{};
440 bool flatBeam{};
441 bool noPlayback{};
442 bool noSpacing{};
443 bool freezeBeam{};
444
446 std::vector<std::shared_ptr<Note>> notes;
447
454 {
458 size_t entryIndex{};
459
461 bool found() const { return staffId != 0 && measureId != 0; }
463 void clear() { *this = {}; }
465
467 [[nodiscard]]
468 EntryNumber getEntryNumber() const { return m_entnum; }
469
473 [[nodiscard]]
475
479 [[nodiscard]]
481
485 [[nodiscard]]
487
491 [[nodiscard]]
493
496 [[nodiscard]]
497 bool hasStem() const { return duration < Edu(NoteType::Whole); }
498
503 [[nodiscard]]
505 { return !isNote && !isHidden && duration == Edu(NoteType::Whole); }
506
507 void integrityCheck(const std::shared_ptr<EnigmaBase>& ptrToThis) override
508 {
509 this->EnigmaBase::integrityCheck(ptrToThis);
510 if (size_t(numNotes) != notes.size()) {
511 MUSX_INTEGRITY_ERROR("Entry " + std::to_string(m_entnum) + " has an incorrect number of notes.");
512 }
513 // Finale allows both zero-note non-floating rests and even
514 // zero-note non-rests, so there is no check against zero notes here.
515 }
516
519 static void calcLocations(const DocumentPtr& document);
520
521 constexpr static std::string_view XmlNodeName = "entry";
523
524private:
525 EntryNumber m_entnum{};
526 EntryNumber m_prev{};
527 EntryNumber m_next{};
528};
529
530class EntryInfo;
531class EntryFrame;
532class NoteInfoPtr;
533
541
550
555{
556public:
560 {
561 Normal,
562 IncludeAll,
568 };
569
570 class InterpretedIterator;
571
573 EntryInfoPtr() : m_entryFrame(nullptr), m_indexInFrame(0) {}
574
580 explicit EntryInfoPtr(const std::shared_ptr<const EntryFrame>& entryFrame, size_t index = 0)
581 : m_entryFrame(entryFrame), m_indexInFrame(index) {}
582
593 [[nodiscard]]
594 static EntryInfoPtr fromEntryNumber(const DocumentPtr& document, Cmper partId, EntryNumber entryNumber, util::Fraction timeOffset = 0);
595
597 const std::shared_ptr<const EntryInfo> operator->() const;
598
600 operator bool() const noexcept;
601
603 [[nodiscard]] int getVoice() const;
604
607 [[nodiscard]] bool isSameEntry(const EntryInfoPtr& src) const;
608
617 [[nodiscard]] bool calcIsSamePitchContent(const EntryInfoPtr& src, bool compareConcert = true) const;
618
631 [[nodiscard]]
632 bool calcIsSamePitchContentAndDuration(const EntryInfoPtr& src, bool compareConcert = true, bool requireSameVoice = true, bool requireSameGraceElapsedDura = false) const;
633
646 [[nodiscard]]
647 bool calcContainsPitchContent(const EntryInfoPtr& src, bool compareConcert = true) const;
648
652 [[nodiscard]]
653 NoteInfoPtr findNoteId(NoteNumber noteId) const;
654
656 [[nodiscard]] std::shared_ptr<const EntryFrame> getFrame() const { return m_entryFrame; }
657
659 [[nodiscard]] size_t getIndexInFrame() const { return m_indexInFrame; }
660
662 [[nodiscard]] LayerIndex getLayerIndex() const;
663
665 [[nodiscard]] StaffCmper getStaff() const;
666
669 [[nodiscard]] MusxInstance<others::StaffComposite> createCurrentStaff(const std::optional<StaffCmper>& forStaffId = std::nullopt) const;
670
672 [[nodiscard]] MeasCmper getMeasure() const;
673
675 [[nodiscard]] MusxInstance<KeySignature> getKeySignature() const;
676
683 [[nodiscard]]
684 music_theory::Pitch calcPitchFromStaffPosition(int staffPosition, StaffPositionPitchOptions options = {}) const;
685
687 [[nodiscard]] MusxInstance<details::EntryPartFieldDetail> getPartFieldData() const;
688
691 [[nodiscard]] Evpu calcManuaOffset() const;
692
694 [[nodiscard]] unsigned calcReverseGraceIndex() const;
695
699 [[nodiscard]] util::Fraction calcGraceElapsedDuration() const;
700
702 [[nodiscard]] std::optional<size_t> calcNextTupletIndex(std::optional<size_t> currentIndex = 0) const;
703
705 [[nodiscard]] EntryInfoPtr getNextInFrame() const;
706
710 [[nodiscard]] EntryInfoPtr getNextInLayer(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
711
715 [[nodiscard]] EntryInfoPtr getNextSameV() const;
716
719 [[nodiscard]] EntryInfoPtr getNextSameVNoGrace() const;
720
724 [[nodiscard]] EntryInfoPtr getPreviousInLayer(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
725
727 [[nodiscard]] EntryInfoPtr getPreviousInFrame() const;
728
732 [[nodiscard]] EntryInfoPtr getPreviousSameV() const;
733
736 [[nodiscard]] EntryInfoPtr getPreviousSameVNoGrace() const;
737
743 [[nodiscard]] EntryInfoPtr getNextInVoice(int voice) const;
744
750 [[nodiscard]] EntryInfoPtr getPreviousInVoice(int voice) const;
751
754 [[nodiscard]] InterpretedIterator asInterpretedIterator(bool remapBeamOverBarlineEntries = true) const;
755
757 [[nodiscard]]
759 { return iterateBeamGroup<&EntryInfoPtr::nextPotentialInBeam, &EntryInfoPtr::previousPotentialInBeam>(beamIterationMode); }
760
762 [[nodiscard]]
764 { return iterateBeamGroup<&EntryInfoPtr::previousPotentialInBeam, &EntryInfoPtr::nextPotentialInBeam>(beamIterationMode); }
765
770
775
779 [[nodiscard]] bool calcDisplaysAsRest() const;
780
784 [[nodiscard]] std::pair<int, int> calcTopBottomStaffPositions() const;
785
789 [[nodiscard]] bool calcIsZeroNote() const;
790
797 [[nodiscard]] int calcZeroNotePosition() const;
798
804 [[nodiscard]] std::pair<Evpu, Evpu> calcTopBottomExtent() const;
805
811 [[nodiscard]] std::pair<bool, bool> calcEntryStemSettings() const;
812
816 [[nodiscard]] bool calcUpStemDefault() const;
817
822 [[nodiscard]] StemDirection calcStemDirectionForced() const;
823
838 [[nodiscard]] bool calcUpStem() const
839 {
840 if (m_upStem.has_value()) {
841 return m_upStem.value();
842 }
843 m_upStem = calcUpStemImpl();
844 return m_upStem.value();
845 }
846
850 [[nodiscard]] bool calcGraceNoteSlash(const MusxInstance<options::GraceNoteOptions> graceOptions = nullptr) const;
851
854 [[nodiscard]] bool calcUnbeamed() const;
855
857 [[nodiscard]] bool calcIsBeamStart(BeamIterationMode beamIterationMode = BeamIterationMode::Normal) const;
858
861 [[nodiscard]] bool calcCreatesSingletonBeamLeft() const;
862
865 [[nodiscard]] bool calcCreatesSingletonBeamRight() const;
866
871 [[nodiscard]] bool calcIsSingletonBeamExtraEntry() const;
872
878 [[nodiscard]] EntryInfoPtr findSingletonBeamExtraEntry() const;
879
888
897
902 [[nodiscard]] bool calcIsFeatheredBeamStart(Evpu& outLeftY, Evpu& outRightY) const;
903
908 [[nodiscard]] EntryInfoPtr findBeamStartOrCurrent() const;
909
912 [[nodiscard]] EntryInfoPtr findBeamEnd() const;
913
915 [[nodiscard]] unsigned calcNumberOfBeams() const;
916
920 [[nodiscard]] unsigned calcLowestBeamStart(bool considerBeamOverBarlines = false) const;
921
924 [[nodiscard]] unsigned calcLowestBeamEnd() const;
925
929 [[nodiscard]] unsigned calcLowestBeamEndAcrossBarlines() const;
930
933 [[nodiscard]] unsigned calcLowestBeamStub() const;
934
940 [[nodiscard]] bool calcBeamStubIsLeft() const;
941
943 [[nodiscard]] util::Fraction calcGlobalElapsedDuration() const;
944
946 [[nodiscard]] util::Fraction calcGlobalActualDuration() const;
947
953 [[nodiscard]]
954 bool calcIsImmediatelyFollowedBy(const EntryInfoPtr& nextEntry) const;
955
957 [[nodiscard]] bool calcCanBeBeamed() const;
958
960 [[nodiscard]] bool calcBeamMustStartHere() const;
961
964 [[nodiscard]] int calcEntrySize() const;
965
968 [[nodiscard]] bool calcIsFullMeasureRest() const;
969
973 [[nodiscard]] bool calcIsBeamedRestWorkaroundHiddenRest() const;
974
978 [[nodiscard]] bool calcIsBeamedRestWorkaroundVisibleRest() const;
979
982 [[nodiscard]] std::vector<size_t> findTupletInfo() const;
983
987 [[nodiscard]] bool calcIfLayerSettingsApply() const;
988
999
1003 [[nodiscard]] std::optional<StaffCmper> calcCrossedStaffForAll() const;
1004
1006 [[nodiscard]] bool calcIsSingletonGrace() const;
1007
1009 [[nodiscard]] bool calcHasGraceNote() const;
1010
1016 [[nodiscard]] int calcIsAuxiliaryPitchMarker() const;
1017
1028 [[nodiscard]] bool calcIsTrillToGraceEntry() const;
1029
1037 [[nodiscard]] bool calcIsGlissToGraceEntry() const;
1038
1044
1051
1057 [[nodiscard]] EntryInfoPtr findMainEntryForGraceNote(bool ignoreRests = false) const;
1058
1075 bool iterateStartingSmartShapes(std::function<bool(const MusxInstance<others::SmartShape>&)> callback, bool findExact = false) const;
1076
1078 bool operator<(const EntryInfoPtr& other) const
1079 {
1080 if (m_entryFrame != other.m_entryFrame)
1081 return m_entryFrame < other.m_entryFrame;
1082 return m_indexInFrame < other.m_indexInFrame;
1083 }
1084
1085private:
1086 [[nodiscard]] unsigned calcVisibleBeams() const;
1087
1088 [[nodiscard]] bool calcUpStemImpl() const;
1089
1090 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1091 [[nodiscard]] std::optional<unsigned> iterateFindRestsInSecondaryBeam(const EntryInfoPtr nextOrPrevInBeam) const;
1092
1093 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1094 [[nodiscard]] EntryInfoPtr iteratePotentialEntryInBeam() const;
1095
1096 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1097 [[nodiscard]] bool iterateNotesExistLeftOrRight() const;
1098
1099 [[nodiscard]] EntryInfoPtr nextPotentialInBeam(BeamIterationMode beamIterationMode) const;
1100
1101 [[nodiscard]] EntryInfoPtr previousPotentialInBeam(BeamIterationMode beamIterationMode) const;
1102
1103 using BeamIteratorFn = EntryInfoPtr (EntryInfoPtr::*)(BeamIterationMode) const;
1104 template<BeamIteratorFn Iterator, BeamIteratorFn ReverseIterator>
1105 [[nodiscard]] EntryInfoPtr iterateBeamGroup(BeamIterationMode beamIterationMode) const;
1106
1110 [[nodiscard]] EntryInfoPtr findLeftBeamAnchorForBeamOverBarline() const;
1111
1115 [[nodiscard]] EntryInfoPtr findRightBeamAnchorForBeamOverBarline() const;
1116
1117 std::shared_ptr<const EntryFrame> m_entryFrame;
1118 size_t m_indexInFrame{};
1119
1121 mutable MusxInstance<others::StaffComposite> m_cachedStaff;
1122
1124 mutable std::optional<bool> m_upStem;
1125};
1126
1141// the the caller should use for calculating elapsed time.
1173{
1174 EntryInfoPtr m_entry;
1175 bool m_effectiveHidden{};
1176 // --------
1177 // internal
1178 // --------
1179 EntryInfoPtr m_iteratedEntry;
1180 bool m_useIteratedForBackLaunch{};
1181 bool m_remapBeamOverBarlineEntries{};
1182
1183 [[nodiscard]] const EntryInfoPtr& getIteratedEntry() const noexcept
1184 { return m_iteratedEntry ? m_iteratedEntry : m_entry; }
1185
1186 [[nodiscard]] const EntryInfoPtr& getForwardLaunchEntry() const noexcept
1187 { return getIteratedEntry(); }
1188
1189 [[nodiscard]] const EntryInfoPtr& getBackwardLaunchEntry() const noexcept
1190 { return m_useIteratedForBackLaunch ? getIteratedEntry() : m_entry; }
1191
1195 InterpretedIterator(EntryInfoPtr entry, bool remapBeamOverBarlineEntries);
1196
1197 friend class EntryFrame;
1198 friend class EntryInfoPtr;
1199
1200public:
1203
1206 [[nodiscard]] const EntryInfoPtr& getEntryInfo() const noexcept { return m_entry; }
1207
1211 [[nodiscard]] bool getEffectiveHidden() const noexcept { return m_effectiveHidden; }
1212
1216 [[nodiscard]] util::Fraction getEffectiveActualDuration(bool global = false) const;
1217
1221 [[nodiscard]] util::Fraction getEffectiveElapsedDuration(bool global = false) const;
1222
1226
1229 [[nodiscard]] bool calcIsPastLogicalEndOfFrame() const;
1230
1238 [[nodiscard]] InterpretedIterator getNext() const;
1239
1247 [[nodiscard]] InterpretedIterator getPrevious() const;
1248
1252 explicit operator bool() const noexcept
1253 {
1254 return static_cast<bool>(m_entry);
1255 }
1256};
1257
1264class EntryFrame : public std::enable_shared_from_this<EntryFrame>
1265{
1266public:
1274 explicit EntryFrame(const details::GFrameHoldContext& gfhold, LayerIndex layerIndex, util::Fraction timeStretch, const MusxInstance<others::StaffComposite>& startStaff) :
1275 m_context(gfhold),
1276 m_layerIndex(layerIndex),
1277 m_timeStretch(timeStretch),
1278 m_startStaff(startStaff)
1279 {
1280 }
1281
1284 {
1286 size_t startIndex;
1287 size_t endIndex;
1290 bool voice2;
1291
1293 TupletInfo(const std::weak_ptr<const EntryFrame>& parent, const MusxInstance<details::TupletDef>& tup, size_t index, util::Fraction start, bool forVoice2)
1294 : tuplet(tup), startIndex(index), endIndex((std::numeric_limits<size_t>::max)()),
1295 startDura(start), endDura(-1), voice2(forVoice2), m_parent(parent)
1296 {}
1297
1299 [[nodiscard]]
1300 size_t numEntries() const
1301 {
1302 MUSX_ASSERT_IF(startIndex > endIndex) {
1303 throw std::logic_error("TupletInfo has invalid start and end indices.");
1304 }
1305 return endIndex - startIndex + 1;
1306 }
1307
1310 [[nodiscard]]
1311 bool includesEntry(const EntryInfoPtr& entryInfo) const
1312 {
1313 const size_t x = entryInfo.getIndexInFrame();
1314 return (x >= startIndex && x <= endIndex);
1315 }
1316
1328 [[nodiscard]]
1329 bool calcIsTremolo() const;
1330
1347 [[nodiscard]]
1348 bool calcCreatesSingletonBeamRight() const { return calcCreatesSingleton(false); }
1349
1359 [[nodiscard]]
1360 bool calcCreatesSingletonBeamLeft() const { return calcCreatesSingleton(true); }
1361
1372 // - the independent display time signature matches the tuplet's total display duration
1373 [[nodiscard]]
1374 bool calcCreatesTimeStretch() const;
1375
1376 private:
1377 [[nodiscard]]
1378 bool calcCreatesSingleton(bool left) const;
1379
1380 [[nodiscard]]
1381 const std::shared_ptr<const EntryFrame> getParent() const
1382 {
1383 auto result = m_parent.lock();
1384 MUSX_ASSERT_IF(!result) {
1385 throw std::logic_error("Unable to obtain lock on parent entry frame.");
1386 }
1387 return result;
1388 }
1389
1390 const std::weak_ptr<const EntryFrame> m_parent;
1391 };
1392
1399 std::vector<TupletInfo> tupletInfo;
1404
1406 [[nodiscard]]
1407 DocumentPtr getDocument() const;
1408
1410 [[nodiscard]]
1411 const details::GFrameHoldContext& getContext() const { return m_context; }
1412
1414 [[nodiscard]]
1415 Cmper getRequestedPartId() const { return m_context.getRequestedPartId(); }
1416
1418 [[nodiscard]]
1419 StaffCmper getStaff() const;
1420
1422 [[nodiscard]]
1423 MeasCmper getMeasure() const;
1424
1426 [[nodiscard]]
1427 LayerIndex getLayerIndex() const { return m_layerIndex; }
1428
1430 [[nodiscard]]
1432
1435 [[nodiscard]]
1436 util::Fraction getTimeStretch() const { return m_timeStretch; }
1437
1439 [[nodiscard]]
1440 const std::vector<std::shared_ptr<const EntryInfo>>& getEntries() const
1441 { return m_entries; }
1442
1446 [[nodiscard]]
1447 EntryInfoPtr getFirstInVoice(int voice) const;
1448
1452 [[nodiscard]]
1453 EntryInfoPtr getLastInVoice(int voice) const;
1454
1507 [[nodiscard]]
1508 EntryInfoPtr::InterpretedIterator getFirstInterpretedIterator(int voice, bool remapBeamOverBarlineEntries = true) const;
1509
1511 void addEntry(const std::shared_ptr<const EntryInfo>& entry)
1512 { m_entries.emplace_back(entry); }
1513
1517 [[nodiscard]]
1518 std::shared_ptr<const EntryFrame> getNext(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
1519
1523 [[nodiscard]]
1524 std::shared_ptr<const EntryFrame> getPrevious(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
1525
1527 [[nodiscard]]
1530
1534 [[nodiscard]]
1535 MusxInstance<others::StaffComposite> createCurrentStaff(Edu eduPosition, const std::optional<StaffCmper>& forStaffId = std::nullopt) const;
1536
1538 [[nodiscard]]
1540
1546 [[nodiscard]]
1547 bool calcAreAllEntriesHiddenInFrame() const;
1548
1556 [[nodiscard]]
1557 EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact = true, MatchVoice matchVoice = MatchVoice::Default,
1558 util::Fraction atGraceNoteDuration = 0) const;
1559
1564 bool iterateEntries(std::function<bool(const EntryInfoPtr&)> iterator) const;
1565
1566private:
1568 LayerIndex m_layerIndex;
1569 util::Fraction m_timeStretch;
1570
1571 std::vector<std::shared_ptr<const EntryInfo>> m_entries;
1572
1575
1577 mutable MusxInstance<others::LayerAttributes> m_cachedLayerAttributes;
1578};
1579
1580namespace details {
1581class GFrameHold;
1582} // namespace details
1583
1593{
1598 explicit EntryInfo(const MusxInstance<Entry>& entry)
1599 : m_entry(entry) {}
1600
1601#ifndef DOXYGEN_SHOULD_IGNORE_THIS
1603#endif
1604
1605public:
1612 unsigned graceIndex{};
1616
1619 [[nodiscard]]
1621 {
1622 auto retval = m_entry.lock();
1623 if (!retval) {
1624 throw std::logic_error("Entry pointer is no longer valid");
1625 }
1626 return retval;
1627 }
1628
1630 [[nodiscard]]
1633
1634private:
1636};
1637
1640{
1641public:
1643 NoteInfoPtr() : m_entry(), m_noteIndex(0) {}
1644
1648 NoteInfoPtr(const EntryInfoPtr& entryInfo, size_t noteIndex)
1649 : m_entry(entryInfo), m_noteIndex(noteIndex)
1650 {}
1651
1653 explicit operator bool() const noexcept
1654 { return m_entry && m_noteIndex < m_entry->getEntry()->notes.size(); }
1655
1658 [[nodiscard]]
1659 bool isSameNote(const NoteInfoPtr& src) const
1660 { return m_entry.isSameEntry(src.m_entry) && m_noteIndex == src.m_noteIndex; }
1661
1665 [[nodiscard]]
1666 NoteInfoPtr findEqualPitch(const EntryInfoPtr& entry) const;
1667
1669 [[nodiscard]]
1671 {
1672 MUSX_ASSERT_IF(m_noteIndex >= m_entry->getEntry()->notes.size()) {
1673 throw std::logic_error("Note index is too large for notes array.");
1674 }
1675 return m_entry->getEntry()->notes[m_noteIndex];
1676 }
1677
1679 [[nodiscard]]
1681 { return m_entry; }
1682
1684 [[nodiscard]]
1685 size_t getNoteIndex() const
1686 { return m_noteIndex; }
1687
1697 [[nodiscard]]
1699
1702 [[nodiscard]]
1703 MusxInstance<others::PercussionNoteInfo> calcPercussionNoteInfo() const;
1704
1708 {
1711 enum class Source
1712 {
1713 Default,
1716 ShapeNotes
1717 };
1718
1721 char32_t character{};
1722 int percent{100};
1726 };
1727
1743 [[nodiscard]]
1744 NoteheadInfo calcNoteheadInfo() const;
1745
1750 [[nodiscard]]
1751 bool calcHasTieStart() const;
1752
1757 [[nodiscard]]
1758 bool calcHasTieEnd() const;
1759
1765 [[nodiscard]]
1766 NoteInfoPtr calcTieTo() const;
1767
1774 [[nodiscard]]
1775 NoteInfoPtr calcTieFrom(bool requireTie = true) const;
1776
1782 [[nodiscard]]
1783 CurveContourDirection calcFreezeTieDirection(bool forTieEnd = false) const;
1785
1791 [[nodiscard]]
1792 CurveContourDirection calcEffectiveTieDirection(bool forTieEnd = false) const;
1800 [[nodiscard]] bool calcHasOuterTie(bool forTieEnd = false) const;
1801
1809 [[nodiscard]] bool calcHasInnerTie(bool forTieEnd = false) const;
1810
1812 [[nodiscard]]
1813 StaffCmper calcStaff() const;
1814
1817 [[nodiscard]]
1818 std::unique_ptr<music_theory::Transposer> createTransposer() const;
1819
1822 [[nodiscard]]
1824 {
1825 if (m_noteIndex >= m_entry->getEntry()->notes.size()) {
1826 return NoteInfoPtr();
1827 }
1828 return NoteInfoPtr(m_entry, m_noteIndex + 1);
1829 }
1830
1833 [[nodiscard]]
1835 {
1836 if (m_noteIndex <= 0) {
1837 return NoteInfoPtr();
1838 }
1839 return NoteInfoPtr(m_entry, m_noteIndex - 1);
1840 }
1841
1843 [[nodiscard]]
1844 bool calcIsEnharmonicRespell() const;
1845
1855 [[nodiscard]]
1856 std::pair<int, int> calcDefaultEnharmonic() const
1857 { return (*this)->calcDefaultEnharmonic(m_entry.getKeySignature()); }
1858
1861 [[nodiscard]]
1863
1873 [[nodiscard]]
1875
1878 [[nodiscard]]
1879 bool calcIsIncludedInVoicing() const;
1880
1883 [[nodiscard]]
1884 bool calcIsTop() const;
1885
1888 [[nodiscard]]
1889 bool calcIsBottom() const;
1890
1913
1923
1927 {
1928 bool matched{};
1930 std::vector<TieStandInSource> sources{};
1931
1933 explicit operator bool() const noexcept { return matched; }
1934 };
1935
1939 [[nodiscard]]
1940 std::optional<ArpeggiatedTieInfo> calcArpeggiatedTieInfo() const;
1941
1944 [[nodiscard]]
1945 PseudoTieInfo calcPseudoLvTieInfo() const;
1946
1949 [[nodiscard]]
1950 PseudoTieInfo calcPseudoTieEndInfo() const;
1951
1958 [[nodiscard]]
1959 std::vector<std::pair<NoteInfoPtr, CurveContourDirection>> calcJumpTieContinuationsFrom() const;
1960
1961private:
1962 enum class TieFromSearchAction {
1963 Continue,
1964 Accept,
1965 Stop,
1966 };
1967
1968 static NoteInfoPtr findTieFromCandidate(const NoteInfoPtr& note, Cmper previousMeasure,
1969 const std::function<TieFromSearchAction(const NoteInfoPtr&, bool)>& decide);
1970
1972 [[nodiscard]]
1973 PseudoTieInfo calcPseudoTieInfoInternal(utils::PseudoTieMode mode) const;
1974
1976 [[nodiscard]]
1977 bool selectPseudoTieDirectionAndMatch(PseudoTieInfo* info,
1978 std::vector<CurveContourDirection>& directions,
1979 const std::vector<size_t>* eligibleNoteIndices = nullptr) const;
1980
1984 [[nodiscard]]
1985 bool isSamePitch(const NoteInfoPtr& src) const;
1986
1990 [[nodiscard]]
1991 bool isSamePitchValues(const NoteInfoPtr& src) const;
1992
1995 [[nodiscard]]
1996 NoteInfoPtr calcTieToWithNextMeasure(Cmper nextMeasure) const;
1997
2001 [[nodiscard]]
2002 NoteInfoPtr calcTieFromWithPreviousMeasure(Cmper previousMeasure, bool requireTie) const;
2003
2004 EntryInfoPtr m_entry;
2005 size_t m_noteIndex;
2006
2008 mutable std::optional<CurveContourDirection> m_tieDirection{};
2009};
2010
2011} // namespace dom
2012} // namespace entries
Wraps a reference to an existing object or owns a temporary value if needed.
Definition MusxInstance.h:194
Base for DOM classes that are represented in EnigmaData.
Definition BaseClasses.h:88
ShareMode
Describes how this instance is shared between part and score.
Definition BaseClasses.h:95
virtual void integrityCheck(const std::shared_ptr< EnigmaBase > &ptrToThis)
Performs a final consistency check after population.
Definition BaseClasses.h:116
Represents a vector of EntryInfo instances for a given frame, along with computed information.
Definition Entries.h:1265
util::Fraction getTimeStretch() const
Get the time stretch in this frame. Rather than accessing this value directly, consider using EntryIn...
Definition Entries.h:1436
util::Fraction maxElapsedStaffDuration
Definition Entries.h:1402
EntryFrame(const details::GFrameHoldContext &gfhold, LayerIndex layerIndex, util::Fraction timeStretch, const MusxInstance< others::StaffComposite > &startStaff)
Constructor function.
Definition Entries.h:1274
util::Fraction measureStaffDuration
The duration of the measure in staff duration units.
Definition Entries.h:1401
EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact=true, MatchVoice matchVoice=MatchVoice::Default, util::Fraction atGraceNoteDuration=0) const
Calculates the nearest non-grace-note entry at the given position.
Definition Entries.cpp:328
EntryInfoPtr getLastInVoice(int voice) const
Returns the last entry in the specified v1/v2 or null if none.
Definition Entries.cpp:259
MusxInstance< others::StaffComposite > getStartStaffInstance() const
Gets the staff at eduPosition 0 without needing to create it again.
Definition Entries.h:1528
bool calcAreAllEntriesHiddenInFrame() const
Calculates if this all notes in the frame are hidden. This routine only checks that entries are indiv...
Definition Entries.cpp:317
MeasCmper getMeasure() const
Get the measure for the entry frame.
Definition Entries.cpp:233
MusxInstance< others::Measure > getMeasureInstance() const
Get the measure instance.
Definition Entries.cpp:312
void addEntry(const std::shared_ptr< const EntryInfo > &entry)
Add an entry to the list.
Definition Entries.h:1511
const std::vector< std::shared_ptr< const EntryInfo > > & getEntries() const
Get the entry list.
Definition Entries.h:1440
EntryInfoPtr getFirstInVoice(int voice) const
Returns the first entry in the specified v1/v2 or null if none.
Definition Entries.cpp:243
StaffCmper getStaff() const
Get the staff for the entry.
Definition Entries.cpp:231
Cmper getRequestedPartId() const
Get the requested part ID for the entry frame.
Definition Entries.h:1415
std::shared_ptr< const EntryFrame > getNext(std::optional< MeasCmper > targetMeasure=std::nullopt) const
Gets the entry frame for the next measure with the same staff and layer.
Definition Entries.cpp:282
MusxInstance< others::StaffComposite > createCurrentStaff(Edu eduPosition, const std::optional< StaffCmper > &forStaffId=std::nullopt) const
Creates a current StaffComposite for the entry frame.
Definition Entries.cpp:303
MusxInstance< KeySignature > keySignature
This can be different than the measure key sig if the staff has independent key signatures.
Definition Entries.h:1400
MusxInstance< others::LayerAttributes > getLayerAttributes() const
Get the LayerAttributes for this entry frame.
Definition Entries.cpp:235
const details::GFrameHoldContext & getContext() const
Get the frame context for this frame.
Definition Entries.h:1411
LayerIndex getLayerIndex() const
Get the layer index (0..3) of the entry frame.
Definition Entries.h:1427
bool iterateEntries(std::function< bool(const EntryInfoPtr &)> iterator) const
Iterates the entries for the specified layer in this EntryFrame from left to right.
Definition Entries.cpp:335
DocumentPtr getDocument() const
Get the document for the entry frame.
Definition Entries.cpp:229
std::shared_ptr< const EntryFrame > getPrevious(std::optional< MeasCmper > targetMeasure=std::nullopt) const
Gets the entry frame for the previous measure with the same staff and layer.
Definition Entries.cpp:291
std::vector< TupletInfo > tupletInfo
A list of the tuplets in the frame and their calculated starting and ending information.
Definition Entries.h:1399
EntryInfoPtr::InterpretedIterator getFirstInterpretedIterator(int voice, bool remapBeamOverBarlineEntries=true) const
Returns a workaround-aware iterator at the first entry in the specified voice.
Definition Entries.cpp:269
Iterator-style wrapper for workaround-aware voice traversal.
Definition Entries.h:1173
const EntryInfoPtr & getEntryInfo() const noexcept
Returns the entry at the current iterator position.
Definition Entries.h:1206
bool calcIsPastLogicalEndOfFrame() const
Returns true is this entry is past the logical end of the frame, as defined by the length of the meas...
Definition Entries.cpp:2453
InterpretedIterator getNext() const
Returns an iterator advanced to the next usable entry in this voice.
Definition Entries.cpp:2488
util::Fraction getEffectiveMeasureStaffDuration() const
Return the effective measure staff duration of the entry. Calling code using InterpretedIterator shou...
Definition Entries.cpp:2448
InterpretedIterator getPrevious() const
Returns an iterator advanced to the previous usable entry in this voice.
Definition Entries.cpp:2500
bool getEffectiveHidden() const noexcept
Returns whether the entry should be treated as hidden.
Definition Entries.h:1211
InterpretedIterator()=default
Default constructor allows null return values by caller.
util::Fraction getEffectiveActualDuration(bool global=false) const
Return the effective actual duration of the entry. Calling code using InterpretedIterator should use ...
Definition Entries.cpp:2432
util::Fraction getEffectiveElapsedDuration(bool global=false) const
Return the effective elapsed duration of the entry. Calling code using InterpretedIterator should use...
Definition Entries.cpp:2440
Wraps a frame of shared_ptr<const EntryInfo> and an index for per entry access. This class manages ow...
Definition Entries.h:555
bool calcUpStemDefault() const
Calculates if the entry is upstem by default, without considering voices, layers, staff options,...
Definition Entries.cpp:1142
EntryInfoPtr getNextInFrame() const
Get the next entry in the frame.
Definition Entries.cpp:853
bool calcHasGraceNote() const
Return true if this entry is a main note with one or more grace notes.
Definition Entries.cpp:2298
music_theory::Pitch calcPitchFromStaffPosition(int staffPosition, StaffPositionPitchOptions options={}) const
Calculates the pitch at a staff position using the entry's effective key and clef.
Definition Entries.cpp:748
EntryInfoPtr getPreviousInBeamGroupAcrossBars(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Gets the previous entry in a beamed group or nullptr if the entry is not beamed or is the first in th...
Definition Entries.cpp:1001
bool calcIsBeamStart(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Returns whether this is the start of a primary beam.
Definition Entries.cpp:1326
bool calcBeamMustStartHere() const
Determines if a beam must start on this entry.
Definition Entries.cpp:1321
EntryInfoPtr(const std::shared_ptr< const EntryFrame > &entryFrame, size_t index=0)
Constructor function.
Definition Entries.h:580
int calcZeroNotePosition() const
Calculates the staff position for a zero-note entry. (See calcIsZeroNote.)
Definition Entries.cpp:1041
EntryInfoPtr getNextSameV() const
Get the next entry in the frame in the same voice.
Definition Entries.cpp:861
bool calcCanBeBeamed() const
Determines if this entry can be beamed.
Definition Entries.cpp:1308
EntryInfoPtr findMainEntryForGraceNote(bool ignoreRests=false) const
Finds the main entry for a grace note, taking into account hidden entries for beams over barlines.
Definition Entries.cpp:1596
size_t getIndexInFrame() const
Returns the index within the frame.
Definition Entries.h:659
util::Fraction calcGlobalElapsedDuration() const
Calculates the elapsed duration in global edu, removing any time stretch due to independent time sign...
Definition Entries.cpp:1951
std::pair< bool, bool > calcEntryStemSettings() const
Returns the Entry stem settings for the current requested part. This function encapsulates handling o...
Definition Entries.cpp:779
EntryInfoPtr calcBeamContinuesLeftOverBarline() const
Determines if this entry continues a beam across a barline from the previous measure.
Definition Entries.cpp:1631
EntryInfoPtr getNextInBeamGroup(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Gets the next entry in a beamed group or nullptr if the entry is not beamed or is the last in the gro...
Definition Entries.h:758
bool calcIfLayerSettingsApply() const
Calculates whether the conditions are met for the layer attributes dependent on others::LayerAttribut...
Definition Entries.cpp:2200
EntryInfoPtr getPreviousInVoice(int voice) const
Returns the previous entry in the frame in the specified v1/v2 or null if none.
Definition Entries.cpp:969
bool iterateStartingSmartShapes(std::function< bool(const MusxInstance< others::SmartShape > &)> callback, bool findExact=false) const
Iterates all smart shapes whose start anchor resolves to this entry.
Definition Entries.cpp:2370
unsigned calcReverseGraceIndex() const
Caclulates the grace index counting leftward (used by other standards such as MNX)
Definition Entries.cpp:796
static EntryInfoPtr fromEntryNumber(const DocumentPtr &document, Cmper partId, EntryNumber entryNumber, util::Fraction timeOffset=0)
Returns an EntryInfoPtr for the entry specified by entryNumber.
Definition Entries.cpp:554
EntryInfoPtr getPreviousSameVNoGrace() const
Get the previous entry in the frame in the same voice, skipping grace notes.
Definition Entries.cpp:950
MusxInstance< details::EntryPartFieldDetail > getPartFieldData() const
Gets the applicable part data for the entry, or nullptr if none.
Definition Entries.cpp:756
BeamIterationMode
Controls which entries are included when iterating over beams.
Definition Entries.h:560
@ Normal
Skip hidden entries. This is how Finale displays beams.
@ IncludeAll
Include all entries, even if they are hidden.
bool calcContainsPitchContent(const EntryInfoPtr &src, bool compareConcert=true) const
Returns whether src represent the same notated value.
Definition Entries.cpp:608
bool calcIsSingletonBeamExtraEntry() const
Determines if this entry is the extra entry of a singleton beam workaround, which the interpreted ite...
Definition Entries.cpp:1349
bool calcIsImmediatelyFollowedBy(const EntryInfoPtr &nextEntry) const
Returns true if nextEntry starts immediately after (or at) the end of this entry in time.
Definition Entries.cpp:889
Evpu calcManuaOffset() const
Returns the manual offset of the entry for the current requested part. This function encapsulates han...
Definition Entries.cpp:771
EntryInfoPtr getNextInLayer(std::optional< MeasCmper > targetMeasure=std::nullopt) const
Get the next entry in the same layer and staff. This can be in the next measure.
Definition Entries.cpp:842
unsigned calcLowestBeamStart(bool considerBeamOverBarlines=false) const
Returns the lowest beam number starting at this entry, where 1 = 8th note beam, 2 = 16th note beam,...
Definition Entries.cpp:1806
bool isSameEntry(const EntryInfoPtr &src) const
Returns whether the input and the current instance refer to the same entry.
Definition Entries.cpp:595
EntryInfoPtr findHiddenSourceForBeamOverBarline() const
Find the hidden source entry for a mid-system beam created by the Beam Over Barline plugin....
Definition Entries.cpp:1469
unsigned calcLowestBeamStub() const
Returns the lowest beam stub at this entry, where 2 = 16th note stub, 3 = 32nd note stub,...
Definition Entries.cpp:1892
bool calcIsBeamedRestWorkaroundVisibleRest() const
A common workaround in Finale is to hide a rest in v1 and supply it in v2. Typically it is used when ...
Definition Entries.cpp:2166
bool calcIsSamePitchContent(const EntryInfoPtr &src, bool compareConcert=true) const
Returns whether this entry and src contain the same pitch content or rest value.
Definition Entries.cpp:662
bool calcGraceNoteSlash(const MusxInstance< options::GraceNoteOptions > graceOptions=nullptr) const
Calculates if the current entry is a grace note with a slash.
Definition Entries.cpp:1277
util::Fraction calcGraceElapsedDuration() const
Calculates a grace note's symbolic starting duration as a negative offset from the main note....
Definition Entries.cpp:808
bool calcIsZeroNote() const
Calculates if the entry is a zero-note entry, i.e., its staff position does not come from note data.
Definition Entries.cpp:1035
unsigned calcLowestBeamEnd() const
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam,...
Definition Entries.cpp:1848
LayerIndex getLayerIndex() const
Get the layer index (0..3) of the entry.
Definition Entries.cpp:740
bool calcIsSingletonGrace() const
Return true if this entry is a grace note and the only grace in the sequence at this location.
Definition Entries.cpp:2286
unsigned calcLowestBeamEndAcrossBarlines() const
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam,...
Definition Entries.cpp:1871
StemDirection calcStemDirectionForced() const
Returns the forced stem direction if any.
Definition Entries.cpp:1236
unsigned calcNumberOfBeams() const
Calculates the number of beams or flags on the entry.
Definition Entries.cpp:1755
EntryInfoPtr getNextInBeamGroupAcrossBars(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Gets the next entry in a beamed group, or nullptr if the entry is not beamed or is the last in the gr...
Definition Entries.cpp:985
EntryInfoPtr getPreviousInFrame() const
Get the previous entry in the frame.
Definition Entries.cpp:927
std::shared_ptr< const EntryFrame > getFrame() const
Returns the frame.
Definition Entries.h:656
bool calcUpStem() const
Determines the effective stem direction of the entry, taking into account voices, layers,...
Definition Entries.h:838
bool calcIsBeamedRestWorkaroundHiddenRest() const
A common workaround in Finale is to hide a rest in v1 and supply it in v2. Typically it is used when ...
Definition Entries.cpp:2146
int getVoice() const
Gets the voice as integer value 1 or 2.
Definition Entries.cpp:603
bool calcIsSamePitchContentAndDuration(const EntryInfoPtr &src, bool compareConcert=true, bool requireSameVoice=true, bool requireSameGraceElapsedDura=false) const
Returns whether this entry and src represent the same notated value.
Definition Entries.cpp:701
EntryInfoPtr findBeamStartOrCurrent() const
Finds the first entry of a beamed group or returns the current entry if it is not beams.
Definition Entries.cpp:1720
bool calcDisplaysAsRest() const
Calculates if an entry displays as a rest.
Definition Entries.cpp:1017
MusxInstance< KeySignature > getKeySignature() const
Get the key signature of the entry.
Definition Entries.cpp:746
EntryInfoPtr getPreviousInBeamGroup(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Gets the previous entry in a beamed group or nullptr if the entry is not beamed or is the first in th...
Definition Entries.h:763
InterpretedIterator asInterpretedIterator(bool remapBeamOverBarlineEntries=true) const
Returns this EntryInfoPtr in a InterpretedIterator instance.
Definition Entries.cpp:979
bool calcCreatesSingletonBeamLeft() const
Determines if this entry contains a tuplet that creates a singleton beam left. See EntryFrame::Tuplet...
Definition Entries.cpp:1338
bool operator<(const EntryInfoPtr &other) const
Explicit operator< for std::map.
Definition Entries.h:1078
EntryInfoPtr getPreviousInLayer(std::optional< MeasCmper > targetMeasure=std::nullopt) const
Get the previous entry in the same layer and staff. This can be in the previous measure.
Definition Entries.cpp:916
std::optional< size_t > calcNextTupletIndex(std::optional< size_t > currentIndex=0) const
Returns the next higher tuplet index that this entry starts, or std::nullopt if none.
Definition Entries.cpp:821
std::pair< int, int > calcTopBottomStaffPositions() const
Calculates the top and bottom staff positions of the entry, taking into account percussion notes....
Definition Entries.cpp:1084
EntryInfoPtr findSingletonBeamExtraEntry() const
Finds the extra entry of a singleton beam workaround that this (kept) entry stands in for.
Definition Entries.cpp:1360
StaffCmper getStaff() const
Get the staff cmper.
Definition Entries.cpp:742
EntryInfoPtr findBeamEnd() const
Finds the end entry of a beamed group.
Definition Entries.cpp:1737
int calcEntrySize() const
Returns the entry size as a percentage, taking into account the beaming.
Definition Entries.cpp:2108
EntryInfoPtr getPreviousSameV() const
Get the previous entry in the frame in the same voice.
Definition Entries.cpp:935
int calcCrossStaffDirectionForAll(DeferredReference< MusxInstanceList< others::StaffUsed > > staffList={}) const
Calculates if this entry has cross-staffed notes all in a single direction.
Definition Entries.cpp:2241
MusxInstance< others::StaffComposite > createCurrentStaff(const std::optional< StaffCmper > &forStaffId=std::nullopt) const
Creates the current StaffComposite for the entry.
Definition Entries.cpp:788
EntryInfoPtr findDisplayEntryForBeamOverBarline() const
Find the display entry for a hidden source entry. The display entry is one or more bars previous to t...
Definition Entries.cpp:1544
bool calcIsTrillToGraceEntry() const
Calculates if this entry is a trill-to entry as created by the Parenthesize Trill-To Notes plugin.
Definition Entries.cpp:2320
int calcIsAuxiliaryPitchMarker() const
Return true if this entry is an auxiliary pitch marker (specifically, a trill-to or gliss-to pitch ma...
Definition Entries.cpp:2309
EntryInfoPtr getNextInVoice(int voice) const
Returns the next entry in the frame in the specified v1/v2 or null if none.
Definition Entries.cpp:959
EntryInfoPtr calcBeamContinuesRightOverBarline() const
Determines if this entry continues a beam across a barline to the next measure.
Definition Entries.cpp:1675
std::optional< StaffCmper > calcCrossedStaffForAll() const
Calculates all the notes in this entry are crossed to the same staff.
Definition Entries.cpp:2265
const std::shared_ptr< const EntryInfo > operator->() const
Allows -> access to the underlying EntryInfo instance.
Definition Entries.cpp:579
bool calcUnbeamed() const
Returns whether this is an unbeamed entry.
Definition Entries.cpp:1299
NoteInfoPtr findNoteId(NoteNumber noteId) const
Returns a NoteInfoPtr for the note specified by noteId within this entry.
Definition Entries.cpp:729
EntryInfoPtr()
Default constructor.
Definition Entries.h:573
bool calcCreatesSingletonBeamRight() const
Determines if this entry contains a tuplet that creates a singleton beam right. See EntryFrame::Tuple...
Definition Entries.cpp:1371
bool calcBeamStubIsLeft() const
Calculates if a beam stub on this entry would go left or right. It does not check that an entry actua...
Definition Entries.cpp:1902
bool calcIsGlissToGraceEntry() const
Calculates if this entry is a gliss-to entry as created by the Parenthesize Trill-To Notes plugin.
Definition Entries.cpp:2343
std::pair< Evpu, Evpu > calcTopBottomExtent() const
Calculates the top and bottom EVPU extent of the entry's approximate visual footprint.
Definition Entries.cpp:1112
bool calcIsFullMeasureRest() const
Returns whether this is a full measure rest.
Definition Entries.cpp:2122
util::Fraction calcGlobalActualDuration() const
Calculates the actual duration in global edu, removing any time stretch due to independent time signa...
Definition Entries.cpp:1956
MeasCmper getMeasure() const
Get the measure cmper.
Definition Entries.cpp:744
EntryInfoPtr getNextSameVNoGrace() const
Get the next entry in the frame in the same voice, skipping grace notes.
Definition Entries.cpp:879
std::vector< size_t > findTupletInfo() const
Finds the tuplet info for tuplets that include this entry.
Definition Entries.cpp:2186
bool calcIsFeatheredBeamStart(Evpu &outLeftY, Evpu &outRightY) const
Calculates if the entry starts a feathered beam and returns information about it if so.
Definition Entries.cpp:2073
Information an entry along with the entry.
Definition Entries.h:1593
unsigned graceIndex
Definition Entries.h:1612
ClefIndex clefIndex
the clef index in effect for the entry.
Definition Entries.h:1614
util::Fraction calcNextElapsedDuration() const
Calculates the next duration position after this entry.
Definition Entries.h:1631
util::Fraction cumulativeRatio
Definition Entries.h:1610
util::Fraction elapsedDuration
Definition Entries.h:1606
ClefIndex clefIndexConcert
the concert clef index in effect for the entry.
Definition Entries.h:1615
util::Fraction actualDuration
Definition Entries.h:1608
MusxInstance< Entry > getEntry() const
Get the entry.
Definition Entries.h:1620
Represents an entry containing metadata and notes.
Definition Entries.h:380
bool splitStem
Definition Entries.h:428
Entry(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, EntryNumber entnum, EntryNumber prev, EntryNumber next)
Constructor function.
Definition Entries.h:386
EntryNumber getEntryNumber() const
Gets the entry number for this entry.
Definition Entries.h:468
bool articDetail
Indicates there is an articulation on the entry.
Definition Entries.h:410
bool upStemScore
Whether a stem is up or down as set in the score. (Only reliable when freezeStemScore is true....
Definition Entries.h:430
bool isNote
If this value is false, the entry is a rest.
Definition Entries.h:403
bool noLeger
Hide ledger lines.
Definition Entries.h:435
MusxInstance< Entry > getNext() const
Gets the next entry in this list or nullptr if none.
Definition Entries.cpp:151
bool noPlayback
Indicates that the entry should not be played back.
Definition Entries.h:441
bool voice2
This is a V2 note. (xml node <v2>)
Definition Entries.h:405
bool splitRest
Indicates that rests in different layers are not combined on this entry.
Definition Entries.h:413
bool beamExt
Indicates that there is a beam extension on the entry.
Definition Entries.h:417
bool createdByHP
Indicates the entry was created by Finale's smart playback engine.
Definition Entries.h:406
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Entries.h:521
MusxInstance< Entry > getPrevious() const
Gets the previous entry in this list or nullptr if none.
Definition Entries.cpp:161
bool secBeam
Signifies a secondary beam break occurs on the entry.
Definition Entries.h:421
bool stemDetail
Indicates there are stem modifications.
Definition Entries.h:423
bool slashGrace
Definition Entries.h:437
bool isValid
Should always be true but otherwise appears to be used internally by Finale.
Definition Entries.h:402
bool playDisabledByHP
Used by Finale's smart playback engine.
Definition Entries.h:407
bool flipTie
Indicates the existence of a flipped tie, either in Speedy Entry or Layer Attributes.
Definition Entries.h:418
bool flatBeam
Forces any beam that starts on this entry to be flat by default.
Definition Entries.h:440
std::vector< std::shared_ptr< Note > > notes
Collection of notes that comprise the entry. These are in order from lowest to highest.
Definition Entries.h:446
bool dummy
Definition Entries.h:432
Evpu hOffsetScore
Manual offset created with the Note Position Tool in the score. (xml node is <posi>....
Definition Entries.h:401
bool checkAccis
Used by Finale to convert pre-2014 .mus files. May never be saved in .musx.
Definition Entries.h:431
bool noteDetail
Indicates there is a note detail or EntrySize record for the entry.
Definition Entries.h:409
util::Fraction calcFraction() const
Calculates the duration as a util::Fraction of a whole note.
Definition Entries.h:492
static const xml::XmlElementArray< Entry > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool hasStem() const
Returns true if the entry's duration has a stem.
Definition Entries.h:497
bool crossStaff
Signifies that at least one note in the entry has been cross staffed.
Definition Entries.h:424
bool floatRest
Is floating rest. If false, the first note element gives the staff position of the rest.
Definition Entries.h:415
bool smartShapeDetail
Indicates this entry has a smart shape assignment.
Definition Entries.h:434
Edu duration
Duration of the entry, not taking into account tuplets.
Definition Entries.h:399
bool isHidden
Indicates the entry is hidden, (xml node is <ignore>)
Definition Entries.h:416
void integrityCheck(const std::shared_ptr< EnigmaBase > &ptrToThis) override
Performs a final consistency check after population.
Definition Entries.h:507
bool tupletStart
Indicates that a tuplet start on the entry.
Definition Entries.h:412
bool lyricDetail
Indicates there is a lyric assignment on the entry.
Definition Entries.h:411
int numNotes
Number of notes in the entry. There is an error if this is not the same as notes.size().
Definition Entries.h:400
bool sorted
Sorted flag.
Definition Entries.h:436
bool reverseDownStem
Indicates that a stem normally down is reversed.
Definition Entries.h:426
bool reverseUpStem
Indicates that a stem normally up is reversed.
Definition Entries.h:425
bool v2Launch
Indicates if this entry (which is voice1) launches a voice2 sequence. (xml node is <controller>)
Definition Entries.h:404
bool doubleStem
Creates a double stem on the entry. (Appears to be exclusive with splitStem.)
Definition Entries.h:427
bool isPossibleFullMeasureRest() const
Returns true if the entry could be a full-measure rest.
Definition Entries.h:504
bool beam
Signifies the start of a beam or singleton entry. (That is, any beam breaks at this entry....
Definition Entries.h:420
bool freezeStemScore
Freeze stem flag in the score. (upStemScore gives the direction.)
Definition Entries.h:422
bool performanceData
Indicates there is performance data on the entry.
Definition Entries.h:414
bool noSpacing
Indicates that the entry should be ignored when calculating music spacing.
Definition Entries.h:442
bool dotTieAlt
Indicates dot or tie alterations are present.
Definition Entries.h:419
bool freezeBeam
Freeze beam flag (Derived from the presence of <freezeBeam> node.)
Definition Entries.h:443
struct musx::dom::Entry::EntryLocation location
The location of this entry.
bool graceNote
Indicate the entry is a grace note.
Definition Entries.h:408
Duration calcDurationInfo() const
Calculates the NoteType and number of augmentation dots. (See calcDurationInfoFromEdu....
Definition Entries.h:486
static void calcLocations(const DocumentPtr &document)
Calculates the locations for all entries in the document. This function is normally only called by th...
Definition Entries.cpp:206
KeyContext
Indicates whether to compute key signature values in concert or written pitch.
Definition CommonClasses.h:273
Provides optional per-type extension methods for MusxInstanceList.
Definition MusxInstance.h:118
Wraps an EntryInfo instance and a note index.
Definition Entries.h:1640
CurveContourDirection calcFreezeTieDirection(bool forTieEnd=false) const
Calculates the user-frozen tie direction for this note, if any.
Definition Entries.cpp:3088
size_t getNoteIndex() const
Gets the note index for this note.
Definition Entries.h:1685
NoteheadInfo calcNoteheadInfo() const
Resolves the effective font and character used to render this note's notehead, along with any size or...
Definition Entries.cpp:3190
EntryInfoPtr getEntryInfo() const
Gets the entry info for this note.
Definition Entries.h:1680
MusxInstance< others::PercussionNoteInfo > calcPercussionNoteInfo() const
Calculates the percussion note info for this note, if any.
Definition Entries.cpp:3169
MusxInstance< Note > operator->() const
Allows -> access to the underlying Note instance.
Definition Entries.h:1670
bool calcHasInnerTie(bool forTieEnd=false) const
Determines whether this note has an inner tie at the specified endpoint.
Definition Entries.cpp:3116
std::vector< std::pair< NoteInfoPtr, CurveContourDirection > > calcJumpTieContinuationsFrom() const
Calculates the notes in prior measures that continue a "jump" tie into this note.
Definition Entries.cpp:3576
bool isSameNote(const NoteInfoPtr &src) const
Returns whether the input and the current instance refer to the same note.
Definition Entries.h:1659
StaffCmper calcStaff() const
Calculates the staff number, taking into account cross staffing.
Definition Entries.cpp:3126
Note::NoteProperties calcNoteProperties(NotePropertiesOptions options={}) const
Calculates the note name, octave number, actual alteration, and staff position. The staff position ta...
Definition Entries.cpp:3141
bool calcIsBottom() const
Return true if this is the bottom note in the entry.
Definition Entries.cpp:3375
CurveContourDirection calcEffectiveTieDirection(bool forTieEnd=false) const
Determines whether this note has an outer tie at the specified endpoint.
Definition Entries.cpp:3098
NoteInfoPtr getPrevious() const
Gets the next note in a chord on the same entry.
Definition Entries.h:1834
bool calcHasTieStart() const
Returns whether a tie starts on this note, taking the singleton beam workaround into account.
Definition Entries.cpp:3052
bool calcIsEnharmonicRespellInAnyPart() const
Calculates if any linked part has this note enharmonically respelled.
Definition Entries.cpp:3278
NoteInfoPtr calcTieFrom(bool requireTie=true) const
Calculates the note that this note could tie from.
Definition Entries.cpp:3083
PseudoTieInfo calcPseudoTieEndInfo() const
Calculates whether this note has a stand-in tie-end and returns tie metadata. For a match,...
Definition Entries.cpp:3424
bool calcIsIncludedInVoicing() const
Returns true if this note is included in the part voicing. This function returns the correct value ev...
Definition Entries.cpp:3349
bool calcHasOuterTie(bool forTieEnd=false) const
Determines whether this note has an outer tie at the specified endpoint.
Definition Entries.cpp:3106
bool calcIsEnharmonicRespell() const
Returns if this note is enharmonically respelled in the current part view.
Definition Entries.cpp:3267
std::pair< int, int > calcDefaultEnharmonic() const
Calculates the default enharmonic equivalent of this note. This is the value that Finale uses when de...
Definition Entries.h:1856
int calcCrossStaffDirection(DeferredReference< MusxInstanceList< others::StaffUsed > > staffList={}) const
Calculates if this note is cross-staffed and if so, which direction.
Definition Entries.cpp:3326
PseudoTieInfo calcPseudoLvTieInfo() const
Calculates whether this note has a stand-in laissez-vibrer tie and returns tie metadata....
Definition Entries.cpp:3419
NoteInfoPtr(const EntryInfoPtr &entryInfo, size_t noteIndex)
Constructor.
Definition Entries.h:1648
std::optional< ArpeggiatedTieInfo > calcArpeggiatedTieInfo() const
If this note has a smart shape acting as an arpeggio tie, returns tie metadata. If this note is part ...
Definition Entries.cpp:3393
NoteInfoPtr calcTieTo() const
Calculates the note that this note could tie to. Check the return value's calcHasTieEnd to see if the...
Definition Entries.cpp:3078
bool calcHasTieEnd() const
Returns whether a tie ends on this note, taking the singleton beam workaround into account.
Definition Entries.cpp:3065
bool calcIsTop() const
Return true if this is the top note in the entry.
Definition Entries.cpp:3357
NoteInfoPtr findEqualPitch(const EntryInfoPtr &entry) const
Finds a note with the same pitch in the supplied entry.
Definition Entries.cpp:2908
NoteInfoPtr getNext() const
Gets the next note in a chord on the same entry.
Definition Entries.h:1823
NoteInfoPtr()
Default constructor.
Definition Entries.h:1643
std::unique_ptr< music_theory::Transposer > createTransposer() const
Creates a transposer for this Note instance.
Definition Entries.cpp:3262
Represents a single note element in an entry.
Definition Entries.h:269
bool upStemSecond
When the entry is upstem, it is drawn on the "wrong" side of the stem.
Definition Entries.h:307
bool isValid
Should always be true but otherwise appears to be used internally by Finale.
Definition Entries.h:303
bool playDisabledByHP
Used by Finale's smart playback engine.
Definition Entries.h:318
static constexpr NoteNumber RESTID
Non floating rests have a note with this noteId that defines their staff positions.
Definition Entries.h:278
int harmAlt
Chromatic alteration relative to the key signature. Never has a magnitude greater than +/-7.
Definition Entries.h:302
bool upSplitStem
Definition Entries.h:311
NoteNumber getNoteId() const
Gets the note id for this note. This value does not change, even if the notes in a chord are rearrang...
Definition Entries.h:323
bool tieEnd
Indicates a tie ends on this note.
Definition Entries.h:305
Note(const DocumentWeakPtr &document, NoteNumber noteId)
Constructor function.
Definition Entries.h:272
bool tieStart
Indicates a tie starts on this note.
Definition Entries.h:304
bool crossStaff
Signifies that the note has a details::CrossStaff note detail.
Definition Entries.h:306
std::pair< int, int > calcDefaultEnharmonic(const MusxInstance< KeySignature > &key) const
Calculates the default enharmonic equivalent of this note. This is the value that Finale uses when de...
Definition Entries.cpp:2843
int harmLev
Diatonic displacement relative to middle C or to the tonic in the middle C octave (if the key signatu...
Definition Entries.h:301
static const xml::XmlElementArray< Note > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
bool downStemSecond
When the entry is downstem, it is drawn on the "wrong" side of the stem.
Definition Entries.h:309
bool noPlayback
Indicates that this note should not be played back.
Definition Entries.h:315
bool parenAcci
True if the accidental has parentheses.
Definition Entries.h:314
bool noSpacing
Indicates that this note should ignored when calculating spacing.
Definition Entries.h:316
bool showAcci
True if the note has an accidental. (Dynamically changed by Finale unless freezeAcci is set....
Definition Entries.h:313
bool freezeAcci
True if the accidental should be forced on or off (based on showAcci.)
Definition Entries.h:317
NoteProperties calcNoteProperties(const MusxInstance< KeySignature > &key, KeySignature::KeyContext ctx, ClefIndex clefIndex, const MusxInstance< others::PercussionNoteInfo > &percNoteInfo, const MusxInstance< others::Staff > &staff=nullptr, bool respellEnharmonic=false) const
Calculates the note name, octave number, actual alteration, and staff position. This function does no...
Definition Entries.cpp:2871
A context wrapper for GFrameHold associated with a specific part and location.
Definition Entries.h:69
EntryInfoPtr calcNearestEntryAtGraceIndex(util::Fraction position, unsigned graceNoteIndex, bool findExact=true, std::optional< LayerIndex > matchLayer=std::nullopt, MatchVoice matchVoice=MatchVoice::Default) const
Calculates the nearest entry at the given position and graceNoteIndex.
Definition Entries.cpp:2766
const GFrameHold * operator->() const
Provides const pointer-style access to the underlying GFrameHold.
Definition Entries.h:122
MusxInstance< others::PartVoicing > getPolicyPartVoicing() const
Returns the part voicing for the requested part, based on the document's PartVoicingPolicy.
Definition Entries.h:114
MusxInstance< others::PartVoicing > getPartVoicing() const
Returns the part voicing for the requested part.
Definition Entries.h:106
std::map< LayerIndex, int > calcVoices(bool excludeHidden=false) const
Calculates the number of voices used by the GFrameHold instance.
Definition Entries.cpp:2703
std::shared_ptr< const EntryFrame > createEntryFrame(LayerIndex layerIndex) const
Returns the EntryFrame for all entries in the given layer.
Definition Entries.cpp:2566
util::Fraction getTimeOffset() const
Return the time offset applied to entries in this instance. One reason this might be non-zero is if t...
Definition Entries.h:229
util::Fraction snapLocationToEntryOrKeep(util::Fraction location, bool findExact=true) const
Snaps a measure position to the nearest entry if possible.
Definition Entries.cpp:2803
ClefIndex calcClefIndexAt(util::Fraction position) const
Returns the clef index in effect for at the specified util::Fraction position (as a fraction of whole...
Definition Entries.h:141
util::Fraction calcMinLegacyPickupSpacer() const
Calculates the minimum legacy pickup spacer, if any.
Definition Entries.cpp:2814
bool iterateEntries(LayerIndex layerIndex, std::function< bool(const EntryInfoPtr &)> iterator) const
iterates the entries for the specified layer in this GFrameHold from left to right
Definition Entries.cpp:2684
bool calcVoicingIncludesLayer(LayerIndex layerIndex) const
Calculates if the part voicing for the current requested part includes the specified layer....
Definition Entries.cpp:2831
bool calcPolicyVoicingIncludesLayer(LayerIndex layerIndex) const
Similar to calcVoicingIncludesLayer, but honoring the document's part voicing policy.
Definition Entries.h:223
Cmper getRequestedPartId() const
Returns the requested part ID associated with this context.
Definition Entries.h:98
EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact=true, std::optional< LayerIndex > matchLayer=std::nullopt, MatchVoice matchVoice=MatchVoice::Default, util::Fraction atGraceNoteDuration=0) const
Calculates the nearest non-grace-note entry at the given position.
Definition Entries.cpp:2758
ClefIndex calcClefIndexAt(Edu position) const
Returns the clef index in effect for at the specified Edu position. This function does not take into ...
Definition Entries.cpp:2732
Represents the attributes of a Finale frame holder.
Definition Details.h:1146
A class to represent fractions with integer m_numerator and m_denominator, automatically reduced to s...
Definition Fraction.h:38
static constexpr Fraction fromEdu(dom::Edu edu)
Constructs a Fraction from edu.
Definition Fraction.h:93
A dependency-free, header-only collection of useful functions for music theory.
NoteName
The available note names in array order.
Definition music_theory.hpp:67
CurveContourDirection
Curve contour direction for ties and slurs.
Definition EnumClasses.h:62
@ Unspecified
contour is automatic, indeterminate, or does not apply
MatchVoice
Specifies which voice(s) are considered when matching entries.
Definition EnumClasses.h:128
@ Default
Default matching behavior: accept either voice, but prefer voice 1 when both voices coincide.
int16_t MeasCmper
Enigma meas Cmper (may be negative when not applicable)
Definition Fundamentals.h:66
std::shared_ptr< const T > MusxInstance
Defines the type of a musx instance stored in a pool.
Definition MusxInstance.h:40
EnharmonicOverride
Provides a three-state override option for enharmonic respelling.
Definition EnumClasses.h:108
@ None
Do not override the existing enharmonic state. (Default)
unsigned int LayerIndex
Layer index (valid values are 0..3)
Definition Fundamentals.h:73
PitchMode
Selects the pitch representation used by contextual pitch calculations.
Definition EnumClasses.h:162
@ CurrentView
Use the pitch representation displayed in the requested Finale score or part.
int32_t Evpu
EVPU value (288 per inch)
Definition Fundamentals.h:59
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:57
StemDirection
Three-state stem direction setting or override.
Definition EnumClasses.h:191
uint16_t ClefIndex
Index into options::ClefOptions::clefDefs.
Definition Fundamentals.h:70
int32_t Edu
"Enigma Durational Units" value (1024 per quarter note)
Definition Fundamentals.h:63
std::pair< NoteType, unsigned > Duration
Expresses a duration as a NoteType and a number of dots (unsigned)
Definition CommonClasses.h:63
unsigned calcNumberOfBeamsInEdu(Edu duration)
Returns the number of beams implied by an EDU duration.
Definition Entries.cpp:193
std::weak_ptr< Document > DocumentWeakPtr
Shared weak Document pointer.
Definition DocumentElement.h:37
int32_t EntryNumber
Entry identifier.
Definition Fundamentals.h:71
uint16_t NoteNumber
Note identifier.
Definition Fundamentals.h:72
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition DocumentElement.h:35
Duration calcDurationInfoFromEdu(Edu duration)
Calculates the NoteType and number of dots in an Edu value.
Definition Entries.cpp:171
int16_t StaffCmper
Enigma staff (staffId) Cmper (may be negative when not applicable)
Definition Fundamentals.h:67
std::weak_ptr< const T > MusxInstanceWeak
Defines a weak ptr to the type of a musx instance stored in a pool.
Definition MusxInstance.h:45
std::vector< XmlElementDescriptor< T > > XmlElementArray
an array type for XmlElementDescriptor instances.
Definition XmlInterface.h:133
object model for musx file (enigmaxml)
Definition BaseClasses.h:38
A spelled pitch, expressed relative to C4.
Definition music_theory.hpp:84
class to track tuplets in the frame
Definition Entries.h:1284
size_t startIndex
the index of the first entry in the tuplet
Definition Entries.h:1286
bool calcCreatesSingletonBeamRight() const
Calculates if this tuplet is being used to create a singleton beam to the right.
Definition Entries.h:1348
TupletInfo(const std::weak_ptr< const EntryFrame > &parent, const MusxInstance< details::TupletDef > &tup, size_t index, util::Fraction start, bool forVoice2)
Constructor.
Definition Entries.h:1293
bool calcIsTremolo() const
Calculates if this tuplet represents a tremolo based on the following criteria.
Definition Entries.cpp:345
size_t endIndex
the index of the last entry in the tuplet
Definition Entries.h:1287
bool includesEntry(const EntryInfoPtr &entryInfo) const
Return true if the entry is part of this tuplet.
Definition Entries.h:1311
util::Fraction endDura
the actual duration where the tuplet ends
Definition Entries.h:1289
size_t numEntries() const
Return the number of entries in the tuplet.
Definition Entries.h:1300
util::Fraction startDura
the actual duration where the tuplet starts
Definition Entries.h:1288
bool calcCreatesSingletonBeamLeft() const
Calculates if this tuplet is being used to create a singleton beam to the left.
Definition Entries.h:1360
MusxInstance< details::TupletDef > tuplet
the tuplet
Definition Entries.h:1285
bool voice2
whether this tuplet is for voice2
Definition Entries.h:1290
bool calcCreatesTimeStretch() const
Detects tuplets being used to create time stretch in an independent time signature.
Definition Entries.cpp:520
The location of this entry as calculated by calcLocations, which is called by the factory.
Definition Entries.h:454
void clear()
Clears the entry location. (Mainly used for benchmarking.)
Definition Entries.h:463
size_t entryIndex
The 0-based index of this entry within its layer.
Definition Entries.h:458
bool found() const
Returns if this entry has been found.
Definition Entries.h:461
MeasCmper measureId
The measure containing this entry.
Definition Entries.h:456
LayerIndex layerIndex
The layer containing this entry within the measure.
Definition Entries.h:457
StaffCmper staffId
The staff containing this entry.
Definition Entries.h:455
Metadata for a smart-shape arpeggiated tie match.
Definition Entries.h:1917
CurveContourDirection direction
Contour direction reported by the source smart shape.
Definition Entries.h:1920
size_t targetNoteIndex
Note index within targetEntry.
Definition Entries.h:1919
Cmper smartShapeId
Cmper of the smart shape that produced the match.
Definition Entries.h:1921
EntryInfoPtr targetEntry
Entry containing the tied-to note.
Definition Entries.h:1918
The resolved font, character, size, and offset for a note's notehead.
Definition Entries.h:1708
int percent
Size percentage for the notehead. (100 means 100%.)
Definition Entries.h:1722
MusxInstance< FontInfo > font
The font that character is drawn from.
Definition Entries.h:1720
Source source
The setting that supplied character.
Definition Entries.h:1719
char32_t character
The notehead character, interpreted in font.
Definition Entries.h:1721
Evpu vertOffset
Definition Entries.h:1724
Source
The setting that supplied the notehead. (See calcNoteheadInfo for the order of precedence....
Definition Entries.h:1712
@ ShapeNotes
The staff's shape-note convention.
@ Default
The document's default notehead for the note's duration category.
@ NoteAlteration
A per-note details::NoteAlterations::altNhead override.
@ PercussionMap
The shape of a mapped percussion note.
Evpu horzOffset
Horizontal notehead offset from the default position.
Definition Entries.h:1723
Metadata for pseudo tie and pseudo tie-end detection.
Definition Entries.h:1927
std::vector< TieStandInSource > sources
Contributing surrogate tie sources from the winning source type.
Definition Entries.h:1930
bool matched
True when this note satisfies the pseudo tie criteria.
Definition Entries.h:1928
CurveContourDirection direction
Resolved contour direction for this note.
Definition Entries.h:1929
Identifies one surrogate tie source matched for a note.
Definition Entries.h:1898
std::optional< Inci > sourceInci
Optional incidence index for sources that are inci-addressed.
Definition Entries.h:1910
Type
The category of source that produced the pseudo tie candidate.
Definition Entries.h:1902
@ ShapeExpression
Measure expression assignment with a tie-like shape.
@ SmartShape
Smart shape record from the Others pool.
@ ShapeArticulation
Articulation assignment with a tie-like shape.
CurveContourDirection direction
Contour direction resolved for this source.
Definition Entries.h:1911
Cmper sourceId
Source identifier within the source category.
Definition Entries.h:1909
Type type
The matched source category.
Definition Entries.h:1908
Options for calculating contextual note properties.
Definition Entries.h:545
bool alwaysUseEntryStaff
If true, do not check the note for cross-staff placement.
Definition Entries.h:548
PitchMode pitchMode
The pitch representation to calculate.
Definition Entries.h:546
EnharmonicOverride enharmonicOverride
Overrides enharmonic respelling behavior.
Definition Entries.h:547
Contextual pitch and staff-position properties of a note.
Definition Entries.h:283
bool operator!=(const NoteProperties &other) const
Inequality comparison operator.
Definition Entries.h:297
int alteration
The actual alteration in EDO divisions, relative to the natural note name.
Definition Entries.h:286
int staffPosition
The position relative to the staff reference line, normally the top line of a five-line staff.
Definition Entries.h:287
bool operator==(const NoteProperties &other) const
Equality comparison operator.
Definition Entries.h:290
music_theory::NoteName noteName
The note name (C, D, E, F, G, A, or B).
Definition Entries.h:284
int octave
The octave number, where middle C is C4.
Definition Entries.h:285
Options for converting a staff position to a spelled pitch.
Definition Entries.h:537
PitchMode pitchMode
The pitch representation to calculate.
Definition Entries.h:538
std::optional< int > actualAlteration
Optional alteration relative to the natural note name, in EDO divisions.
Definition Entries.h:539