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:
73 {
74 std::vector<LayerIndex> cueLayers;
75 bool isCueHold{};
76
78 explicit operator bool() const
79 { return isCueHold; }
80 };
81
92 GFrameHoldContext(const DocumentPtr& document, Cmper partId, Cmper staffId, Cmper measureId, util::Fraction timeOffset = 0);
93
101 GFrameHoldContext(const MusxInstance<GFrameHold>& gfHold, util::Fraction timeOffset = 0);
102
108 [[nodiscard]]
109 Cmper getRequestedPartId() const { return m_requestedPartId; }
110
116 [[nodiscard]]
117 MusxInstance<others::PartVoicing> getPartVoicing() const { return m_partVoicing; }
118
124 [[nodiscard]]
126 { return m_honorPartVoicing ? m_partVoicing : nullptr; }
127
133 const GFrameHold* operator->() const { return m_hold.get(); }
134
140 explicit operator bool() const noexcept { return static_cast<bool>(m_hold); }
141
145 [[nodiscard]]
146 ClefIndex calcClefIndexAt(Edu position) const;
147
151 [[nodiscard]]
153 { return calcClefIndexAt(position.calcEduDuration()); }
154
160 [[nodiscard]]
161 std::shared_ptr<const EntryFrame> createEntryFrame(LayerIndex layerIndex) const;
162
170 bool iterateEntries(LayerIndex layerIndex, std::function<bool(const EntryInfoPtr&)> iterator) const;
171
177 bool iterateEntries(std::function<bool(const EntryInfoPtr&)> iterator) const;
178
182 [[nodiscard]]
183 std::map<LayerIndex, int> calcVoices(bool excludeHidden = false) const;
184
187 [[nodiscard]]
188 bool calcIsCuesOnly(bool includeVisibleInScore = false) const;
189
192 [[nodiscard]]
193 CueSummary calcCueSummary(bool includeVisibleInScore = false) const;
194
203 [[nodiscard]]
204 EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact = true, std::optional<LayerIndex> matchLayer = std::nullopt,
205 MatchVoice matchVoice = MatchVoice::Default, util::Fraction atGraceNoteDuration = 0) const;
206
215 [[nodiscard]]
216 EntryInfoPtr calcNearestEntryAtGraceIndex(util::Fraction position, unsigned graceNoteIndex, bool findExact = true,
217 std::optional<LayerIndex> matchLayer = std::nullopt, MatchVoice matchVoice = MatchVoice::Default) const;
218
225 util::Fraction snapLocationToEntryOrKeep(util::Fraction location, bool findExact = true) const;
226
232 [[nodiscard]]
234
239 [[nodiscard]]
240 bool calcVoicingIncludesLayer(LayerIndex layerIndex) const;
241
243 [[nodiscard]]
245 { return !m_honorPartVoicing || calcVoicingIncludesLayer(layerIndex); }
246
249 [[nodiscard]]
250 util::Fraction getTimeOffset() const { return m_timeOffset; }
251
252private:
255 bool scanCueLayers(bool includeVisibleInScore, std::function<bool(LayerIndex, bool)> visitor) const;
256
257 EntryInfoPtr calcNearestEntryMatching(util::Fraction position, bool findExact, std::optional<LayerIndex> matchLayer,
258 MatchVoice matchVoice, const std::function<bool(const EntryInfoPtr&)>& matchesEntry) const;
259
261 Cmper m_requestedPartId{};
262 util::Fraction m_timeOffset;
264 bool m_honorPartVoicing{};
265};
266
267} // namespace details
268
279
285unsigned calcNumberOfBeamsInEdu(Edu duration);
286
293class Note : public EnigmaBase
294{
295public:
297 explicit Note(const DocumentWeakPtr& document, NoteNumber noteId)
298 : EnigmaBase(document, 0, ShareMode::All), m_noteId(noteId)
299 {
300 }
301
303 static constexpr NoteNumber RESTID = 31;
304
312 using NoteProperties = std::tuple<music_theory::NoteName, int, int, int>;
313
314 int harmLev{};
315 int harmAlt{};
316 bool isValid{};
317 bool tieStart{};
318 bool tieEnd{};
319 bool crossStaff{};
324 bool upSplitStem{};
326 bool showAcci{};
327 bool parenAcci{};
328 bool noPlayback{};
329 bool noSpacing{};
330 bool freezeAcci{};
332
335 [[nodiscard]]
336 NoteNumber getNoteId() const { return m_noteId; }
337
348 [[nodiscard]]
349 std::pair<int, int> calcDefaultEnharmonic(const MusxInstance<KeySignature>& key) const;
350
376 [[nodiscard]]
378 const MusxInstance<others::PercussionNoteInfo>& percNoteInfo, const MusxInstance<others::Staff>& staff = nullptr, bool respellEnharmonic = false) const;
379
381
382private:
383 NoteNumber m_noteId{};
384};
385
392class Entry : public EnigmaBase
393{
394public:
399 explicit Entry(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, EntryNumber entnum, EntryNumber prev, EntryNumber next)
400 : EnigmaBase(document, partId, shareMode), m_entnum(entnum), m_prev(prev), m_next(next)
401 {
402 }
403
413 int numNotes{};
415 bool isValid{};
416 bool isNote{};
417 bool v2Launch{};
418 bool voice2{};
419 bool createdByHP{};
421 bool graceNote{};
422 bool noteDetail{};
423 bool articDetail{};
424 bool lyricDetail{};
425 bool tupletStart{};
426 bool splitRest{};
428 bool floatRest{};
429 bool isHidden{};
430 bool beamExt{};
431 bool flipTie{};
432 bool dotTieAlt{};
433 bool beam{};
434 bool secBeam{};
436 bool stemDetail{};
437 bool crossStaff{};
440 bool doubleStem{};
441 bool splitStem{};
443 bool upStemScore{};
444 bool checkAccis{};
445 bool dummy{};
448 bool noLeger{};
449 bool sorted{};
450 bool slashGrace{};
453 bool flatBeam{};
454 bool noPlayback{};
455 bool noSpacing{};
456 bool freezeBeam{};
457
459 std::vector<std::shared_ptr<Note>> notes;
460
467 {
471 size_t entryIndex{};
472
474 bool found() const { return staffId != 0 && measureId != 0; }
476 void clear() { *this = {}; }
478
480 [[nodiscard]]
481 EntryNumber getEntryNumber() const { return m_entnum; }
482
486 [[nodiscard]]
488
492 [[nodiscard]]
494
498 [[nodiscard]]
500
504 [[nodiscard]]
506
509 [[nodiscard]]
510 bool hasStem() const { return duration < Edu(NoteType::Whole); }
511
516 [[nodiscard]]
518 { return !isNote && !isHidden && duration == Edu(NoteType::Whole); }
519
520 void integrityCheck(const std::shared_ptr<EnigmaBase>& ptrToThis) override
521 {
522 this->EnigmaBase::integrityCheck(ptrToThis);
523 if (size_t(numNotes) != notes.size()) {
524 MUSX_INTEGRITY_ERROR("Entry " + std::to_string(m_entnum) + " has an incorrect number of notes.");
525 }
526 if (notes.empty() && !floatRest) {
527 MUSX_INTEGRITY_ERROR("Entry " + std::to_string(m_entnum)
528 + " has an invalid rest representation: the entry has no notes but is not floatRest.");
529 }
530 }
531
534 static void calcLocations(const DocumentPtr& document);
535
536 constexpr static std::string_view XmlNodeName = "entry";
538
539private:
540 EntryNumber m_entnum{};
541 EntryNumber m_prev{};
542 EntryNumber m_next{};
543};
544
545class EntryInfo;
546class EntryFrame;
547class NoteInfoPtr;
548
553{
554public:
558 {
559 Normal,
560 IncludeAll,
566 };
567
568 class InterpretedIterator;
569
571 EntryInfoPtr() : m_entryFrame(nullptr), m_indexInFrame(0) {}
572
578 explicit EntryInfoPtr(const std::shared_ptr<const EntryFrame>& entryFrame, size_t index = 0)
579 : m_entryFrame(entryFrame), m_indexInFrame(index) {}
580
591 [[nodiscard]]
592 static EntryInfoPtr fromEntryNumber(const DocumentPtr& document, Cmper partId, EntryNumber entryNumber, util::Fraction timeOffset = 0);
593
595 const std::shared_ptr<const EntryInfo> operator->() const;
596
598 operator bool() const noexcept;
599
601 [[nodiscard]] int getVoice() const;
602
605 [[nodiscard]] bool isSameEntry(const EntryInfoPtr& src) const;
606
615 [[nodiscard]] bool calcIsSamePitchContent(const EntryInfoPtr& src, bool compareConcert = true) const;
616
629 [[nodiscard]]
630 bool calcIsSamePitchContentAndDuration(const EntryInfoPtr& src, bool compareConcert = true, bool requireSameVoice = true, bool requireSameGraceElapsedDura = false) const;
631
644 [[nodiscard]]
645 bool calcContainsPitchContent(const EntryInfoPtr& src, bool compareConcert = true) const;
646
650 [[nodiscard]]
651 NoteInfoPtr findNoteId(NoteNumber noteId) const;
652
654 [[nodiscard]] std::shared_ptr<const EntryFrame> getFrame() const { return m_entryFrame; }
655
657 [[nodiscard]] size_t getIndexInFrame() const { return m_indexInFrame; }
658
660 [[nodiscard]] LayerIndex getLayerIndex() const;
661
663 [[nodiscard]] StaffCmper getStaff() const;
664
667 [[nodiscard]] MusxInstance<others::StaffComposite> createCurrentStaff(const std::optional<StaffCmper>& forStaffId = std::nullopt) const;
668
670 [[nodiscard]] MeasCmper getMeasure() const;
671
673 [[nodiscard]] MusxInstance<KeySignature> getKeySignature() const;
674
677
680 [[nodiscard]] Evpu calcManuaOffset() const;
681
683 [[nodiscard]] unsigned calcReverseGraceIndex() const;
684
688 [[nodiscard]] util::Fraction calcGraceElapsedDuration() const;
689
691 [[nodiscard]] std::optional<size_t> calcNextTupletIndex(std::optional<size_t> currentIndex = 0) const;
692
694 [[nodiscard]] EntryInfoPtr getNextInFrame() const;
695
699 [[nodiscard]] EntryInfoPtr getNextInLayer(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
700
704 [[nodiscard]] EntryInfoPtr getNextSameV() const;
705
708 [[nodiscard]] EntryInfoPtr getNextSameVNoGrace() const;
709
713 [[nodiscard]] EntryInfoPtr getPreviousInLayer(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
714
716 [[nodiscard]] EntryInfoPtr getPreviousInFrame() const;
717
721 [[nodiscard]] EntryInfoPtr getPreviousSameV() const;
722
725 [[nodiscard]] EntryInfoPtr getPreviousSameVNoGrace() const;
726
732 [[nodiscard]] EntryInfoPtr getNextInVoice(int voice) const;
733
739 [[nodiscard]] EntryInfoPtr getPreviousInVoice(int voice) const;
740
743 [[nodiscard]] InterpretedIterator asInterpretedIterator(bool remapBeamOverBarlineEntries = true) const;
744
746 [[nodiscard]]
748 { return iterateBeamGroup<&EntryInfoPtr::nextPotentialInBeam, &EntryInfoPtr::previousPotentialInBeam>(beamIterationMode); }
749
751 [[nodiscard]]
753 { return iterateBeamGroup<&EntryInfoPtr::previousPotentialInBeam, &EntryInfoPtr::nextPotentialInBeam>(beamIterationMode); }
754
759
764
768 [[nodiscard]] bool calcDisplaysAsRest() const;
769
773 [[nodiscard]] std::pair<int, int> calcTopBottomStaffPositions() const;
774
779 [[nodiscard]] int calcFloatingRestStaffPosition() const;
780
786 [[nodiscard]] std::pair<Evpu, Evpu> calcTopBottomExtent() const;
787
793 [[nodiscard]] std::pair<bool, bool> calcEntryStemSettings() const;
794
798 [[nodiscard]] bool calcUpStemDefault() const;
799
804 [[nodiscard]] StemDirection calcStemDirectionForced() const;
805
820 [[nodiscard]] bool calcUpStem() const
821 {
822 if (m_upStem.has_value()) {
823 return m_upStem.value();
824 }
825 m_upStem = calcUpStemImpl();
826 return m_upStem.value();
827 }
828
832 [[nodiscard]] bool calcGraceNoteSlash(const MusxInstance<options::GraceNoteOptions> graceOptions = nullptr) const;
833
836 [[nodiscard]] bool calcUnbeamed() const;
837
839 [[nodiscard]] bool calcIsBeamStart(BeamIterationMode beamIterationMode = BeamIterationMode::Normal) const;
840
843 [[nodiscard]] bool calcCreatesSingletonBeamLeft() const;
844
847 [[nodiscard]] bool calcCreatesSingletonBeamRight() const;
848
857
866
871 [[nodiscard]] bool calcIsFeatheredBeamStart(Evpu& outLeftY, Evpu& outRightY) const;
872
877 [[nodiscard]] EntryInfoPtr findBeamStartOrCurrent() const;
878
881 [[nodiscard]] EntryInfoPtr findBeamEnd() const;
882
884 [[nodiscard]] unsigned calcNumberOfBeams() const;
885
889 [[nodiscard]] unsigned calcLowestBeamStart(bool considerBeamOverBarlines = false) const;
890
893 [[nodiscard]] unsigned calcLowestBeamEnd() const;
894
898 [[nodiscard]] unsigned calcLowestBeamEndAcrossBarlines() const;
899
902 [[nodiscard]] unsigned calcLowestBeamStub() const;
903
909 [[nodiscard]] bool calcBeamStubIsLeft() const;
910
912 [[nodiscard]] util::Fraction calcGlobalElapsedDuration() const;
913
915 [[nodiscard]] util::Fraction calcGlobalActualDuration() const;
916
922 [[nodiscard]]
923 bool calcIsImmediatelyFollowedBy(const EntryInfoPtr& nextEntry) const;
924
926 [[nodiscard]] bool calcCanBeBeamed() const;
927
929 [[nodiscard]] bool calcBeamMustStartHere() const;
930
933 [[nodiscard]] int calcEntrySize() const;
934
940 [[nodiscard]] bool calcIsCue(bool includeVisibleInScore = false) const;
941
944 [[nodiscard]] bool calcIsFullMeasureRest() const;
945
949 [[nodiscard]] bool calcIsBeamedRestWorkaroundHiddenRest() const;
950
954 [[nodiscard]] bool calcIsBeamedRestWorkaroundVisibleRest() const;
955
958 [[nodiscard]] std::vector<size_t> findTupletInfo() const;
959
963 [[nodiscard]] bool calcIfLayerSettingsApply() const;
964
975
979 [[nodiscard]] std::optional<StaffCmper> calcCrossedStaffForAll() const;
980
982 [[nodiscard]] bool calcIsSingletonGrace() const;
983
985 [[nodiscard]] bool calcHasGraceNote() const;
986
992 [[nodiscard]] int calcIsAuxiliaryPitchMarker() const;
993
1004 [[nodiscard]] bool calcIsTrillToGraceEntry() const;
1005
1013 [[nodiscard]] bool calcIsGlissToGraceEntry() const;
1014
1020
1027
1033 [[nodiscard]] EntryInfoPtr findMainEntryForGraceNote(bool ignoreRests = false) const;
1034
1051 bool iterateStartingSmartShapes(std::function<bool(const MusxInstance<others::SmartShape>&)> callback, bool findExact = false) const;
1052
1054 bool operator<(const EntryInfoPtr& other) const
1055 {
1056 if (m_entryFrame != other.m_entryFrame)
1057 return m_entryFrame < other.m_entryFrame;
1058 return m_indexInFrame < other.m_indexInFrame;
1059 }
1060
1061private:
1062 [[nodiscard]] unsigned calcVisibleBeams() const;
1063
1064 [[nodiscard]] bool calcUpStemImpl() const;
1065
1066 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1067 [[nodiscard]] std::optional<unsigned> iterateFindRestsInSecondaryBeam(const EntryInfoPtr nextOrPrevInBeam) const;
1068
1069 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1070 [[nodiscard]] EntryInfoPtr iteratePotentialEntryInBeam() const;
1071
1072 template<EntryInfoPtr(EntryInfoPtr::* Iterator)() const>
1073 [[nodiscard]] bool iterateNotesExistLeftOrRight() const;
1074
1075 [[nodiscard]] EntryInfoPtr nextPotentialInBeam(BeamIterationMode beamIterationMode) const;
1076
1077 [[nodiscard]] EntryInfoPtr previousPotentialInBeam(BeamIterationMode beamIterationMode) const;
1078
1079 using BeamIteratorFn = EntryInfoPtr (EntryInfoPtr::*)(BeamIterationMode) const;
1080 template<BeamIteratorFn Iterator, BeamIteratorFn ReverseIterator>
1081 [[nodiscard]] EntryInfoPtr iterateBeamGroup(BeamIterationMode beamIterationMode) const;
1082
1086 [[nodiscard]] EntryInfoPtr findLeftBeamAnchorForBeamOverBarline() const;
1087
1091 [[nodiscard]] EntryInfoPtr findRightBeamAnchorForBeamOverBarline() const;
1092
1093 std::shared_ptr<const EntryFrame> m_entryFrame;
1094 size_t m_indexInFrame{};
1095
1097 mutable MusxInstance<others::StaffComposite> m_cachedStaff;
1098
1100 mutable std::optional<bool> m_upStem;
1101};
1102
1117// the the caller should use for calculating elapsed time.
1149{
1150 EntryInfoPtr m_entry;
1151 bool m_effectiveHidden{};
1152 // --------
1153 // internal
1154 // --------
1155 EntryInfoPtr m_iteratedEntry;
1156 bool m_useIteratedForBackLaunch{};
1157 bool m_remapBeamOverBarlineEntries{};
1158
1159 [[nodiscard]] const EntryInfoPtr& getIteratedEntry() const noexcept
1160 { return m_iteratedEntry ? m_iteratedEntry : m_entry; }
1161
1162 [[nodiscard]] const EntryInfoPtr& getForwardLaunchEntry() const noexcept
1163 { return getIteratedEntry(); }
1164
1165 [[nodiscard]] const EntryInfoPtr& getBackwardLaunchEntry() const noexcept
1166 { return m_useIteratedForBackLaunch ? getIteratedEntry() : m_entry; }
1167
1171 InterpretedIterator(EntryInfoPtr entry, bool remapBeamOverBarlineEntries);
1172
1173 friend class EntryFrame;
1174 friend class EntryInfoPtr;
1175
1176public:
1179
1182 [[nodiscard]] const EntryInfoPtr& getEntryInfo() const noexcept { return m_entry; }
1183
1187 [[nodiscard]] bool getEffectiveHidden() const noexcept { return m_effectiveHidden; }
1188
1192 [[nodiscard]] util::Fraction getEffectiveActualDuration(bool global = false) const;
1193
1197 [[nodiscard]] util::Fraction getEffectiveElapsedDuration(bool global = false) const;
1198
1202
1205 [[nodiscard]] bool calcIsPastLogicalEndOfFrame() const;
1206
1214 [[nodiscard]] InterpretedIterator getNext() const;
1215
1223 [[nodiscard]] InterpretedIterator getPrevious() const;
1224
1228 explicit operator bool() const noexcept
1229 {
1230 return static_cast<bool>(m_entry);
1231 }
1232};
1233
1240class EntryFrame : public std::enable_shared_from_this<EntryFrame>
1241{
1242public:
1250 explicit EntryFrame(const details::GFrameHoldContext& gfhold, LayerIndex layerIndex, util::Fraction timeStretch, const MusxInstance<others::StaffComposite>& startStaff) :
1251 m_context(gfhold),
1252 m_layerIndex(layerIndex),
1253 m_timeStretch(timeStretch),
1254 m_startStaff(startStaff)
1255 {
1256 }
1257
1260 {
1262 size_t startIndex;
1263 size_t endIndex;
1266 bool voice2;
1267
1269 TupletInfo(const std::weak_ptr<const EntryFrame>& parent, const MusxInstance<details::TupletDef>& tup, size_t index, util::Fraction start, bool forVoice2)
1270 : tuplet(tup), startIndex(index), endIndex((std::numeric_limits<size_t>::max)()),
1271 startDura(start), endDura(-1), voice2(forVoice2), m_parent(parent)
1272 {}
1273
1275 [[nodiscard]]
1276 size_t numEntries() const
1277 {
1278 MUSX_ASSERT_IF(startIndex > endIndex) {
1279 throw std::logic_error("TupletInfo has invalid start and end indices.");
1280 }
1281 return endIndex - startIndex + 1;
1282 }
1283
1286 [[nodiscard]]
1287 bool includesEntry(const EntryInfoPtr& entryInfo) const
1288 {
1289 const size_t x = entryInfo.getIndexInFrame();
1290 return (x >= startIndex && x <= endIndex);
1291 }
1292
1304 [[nodiscard]]
1305 bool calcIsTremolo() const;
1306
1320 [[nodiscard]]
1321 bool calcCreatesSingletonBeamRight() const { return calcCreatesSingleton(false); }
1322
1332 [[nodiscard]]
1333 bool calcCreatesSingletonBeamLeft() const { return calcCreatesSingleton(true); }
1334
1345 // - the independent display time signature matches the tuplet's total display duration
1346 [[nodiscard]]
1347 bool calcCreatesTimeStretch() const;
1348
1349 private:
1350 [[nodiscard]]
1351 bool calcCreatesSingleton(bool left) const;
1352
1353 [[nodiscard]]
1354 const std::shared_ptr<const EntryFrame> getParent() const
1355 {
1356 auto result = m_parent.lock();
1357 MUSX_ASSERT_IF(!result) {
1358 throw std::logic_error("Unable to obtain lock on parent entry frame.");
1359 }
1360 return result;
1361 }
1362
1363 const std::weak_ptr<const EntryFrame> m_parent;
1364 };
1365
1372 std::vector<TupletInfo> tupletInfo;
1377
1379 [[nodiscard]]
1380 DocumentPtr getDocument() const;
1381
1383 [[nodiscard]]
1384 const details::GFrameHoldContext& getContext() const { return m_context; }
1385
1387 [[nodiscard]]
1388 Cmper getRequestedPartId() const { return m_context.getRequestedPartId(); }
1389
1391 [[nodiscard]]
1392 StaffCmper getStaff() const;
1393
1395 [[nodiscard]]
1396 MeasCmper getMeasure() const;
1397
1399 [[nodiscard]]
1400 LayerIndex getLayerIndex() const { return m_layerIndex; }
1401
1403 [[nodiscard]]
1405
1408 [[nodiscard]]
1409 util::Fraction getTimeStretch() const { return m_timeStretch; }
1410
1412 [[nodiscard]]
1413 const std::vector<std::shared_ptr<const EntryInfo>>& getEntries() const
1414 { return m_entries; }
1415
1419 [[nodiscard]]
1420 EntryInfoPtr getFirstInVoice(int voice) const;
1421
1425 [[nodiscard]]
1426 EntryInfoPtr getLastInVoice(int voice) const;
1427
1480 [[nodiscard]]
1481 EntryInfoPtr::InterpretedIterator getFirstInterpretedIterator(int voice, bool remapBeamOverBarlineEntries = true) const;
1482
1484 void addEntry(const std::shared_ptr<const EntryInfo>& entry)
1485 { m_entries.emplace_back(entry); }
1486
1490 [[nodiscard]]
1491 std::shared_ptr<const EntryFrame> getNext(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
1492
1496 [[nodiscard]]
1497 std::shared_ptr<const EntryFrame> getPrevious(std::optional<MeasCmper> targetMeasure = std::nullopt) const;
1498
1500 [[nodiscard]]
1503
1507 [[nodiscard]]
1508 MusxInstance<others::StaffComposite> createCurrentStaff(Edu eduPosition, const std::optional<StaffCmper>& forStaffId = std::nullopt) const;
1509
1511 [[nodiscard]]
1513
1519 [[nodiscard]]
1520 bool calcIsCueFrame(bool includeVisibleInScore = false) const;
1521
1527 [[nodiscard]]
1528 bool calcAreAllEntriesHiddenInFrame() const;
1529
1537 [[nodiscard]]
1538 EntryInfoPtr calcNearestEntry(util::Fraction position, bool findExact = true, MatchVoice matchVoice = MatchVoice::Default,
1539 util::Fraction atGraceNoteDuration = 0) const;
1540
1545 bool iterateEntries(std::function<bool(const EntryInfoPtr&)> iterator) const;
1546
1547private:
1549 LayerIndex m_layerIndex;
1550 util::Fraction m_timeStretch;
1551
1552 std::vector<std::shared_ptr<const EntryInfo>> m_entries;
1553
1556
1558 mutable MusxInstance<others::LayerAttributes> m_cachedLayerAttributes;
1559};
1560
1561namespace details {
1562class GFrameHold;
1563} // namespace details
1564
1574{
1579 explicit EntryInfo(const MusxInstance<Entry>& entry)
1580 : m_entry(entry) {}
1581
1582#ifndef DOXYGEN_SHOULD_IGNORE_THIS
1584#endif
1585
1586public:
1593 unsigned graceIndex{};
1597
1600 [[nodiscard]]
1602 {
1603 auto retval = m_entry.lock();
1604 if (!retval) {
1605 throw std::logic_error("Entry pointer is no longer valid");
1606 }
1607 return retval;
1608 }
1609
1611 [[nodiscard]]
1614
1615private:
1617};
1618
1621{
1622public:
1624 NoteInfoPtr() : m_entry(), m_noteIndex(0) {}
1625
1629 NoteInfoPtr(const EntryInfoPtr& entryInfo, size_t noteIndex)
1630 : m_entry(entryInfo), m_noteIndex(noteIndex)
1631 {}
1632
1634 explicit operator bool() const noexcept
1635 { return m_entry && m_noteIndex < m_entry->getEntry()->notes.size(); }
1636
1639 [[nodiscard]]
1640 bool isSameNote(const NoteInfoPtr& src) const
1641 { return m_entry.isSameEntry(src.m_entry) && m_noteIndex == src.m_noteIndex; }
1642
1646 [[nodiscard]]
1647 NoteInfoPtr findEqualPitch(const EntryInfoPtr& entry) const;
1648
1650 [[nodiscard]]
1652 {
1653 MUSX_ASSERT_IF(m_noteIndex >= m_entry->getEntry()->notes.size()) {
1654 throw std::logic_error("Note index is too large for notes array.");
1655 }
1656 return m_entry->getEntry()->notes[m_noteIndex];
1657 }
1658
1660 [[nodiscard]]
1662 { return m_entry; }
1663
1665 [[nodiscard]]
1666 size_t getNoteIndex() const
1667 { return m_noteIndex; }
1668
1681 [[nodiscard]]
1682 Note::NoteProperties calcNoteProperties(EnharmonicOverride enharmonicOverride = EnharmonicOverride::None, bool alwaysUseEntryStaff = false) const;
1683
1690 [[nodiscard]]
1691 Note::NoteProperties calcNotePropertiesConcert(bool alwaysUseEntryStaff = false) const;
1692
1701 [[nodiscard]]
1702 Note::NoteProperties calcNotePropertiesInView(bool alwaysUseEntryStaff = false) const;
1703
1706 [[nodiscard]]
1708
1720
1736 [[nodiscard]]
1737 NoteheadInfo calcNoteheadInfo() const;
1738
1742 [[nodiscard]]
1743 NoteInfoPtr calcTieTo() const;
1744
1749 [[nodiscard]]
1750 NoteInfoPtr calcTieFrom(bool requireTie = true) const;
1751
1757 [[nodiscard]]
1758 CurveContourDirection calcFreezeTieDirection(bool forTieEnd = false) const;
1760
1766 [[nodiscard]]
1767 CurveContourDirection calcEffectiveTieDirection(bool forTieEnd = false) const;
1775 [[nodiscard]] bool calcHasOuterTie(bool forTieEnd = false) const;
1776
1784 [[nodiscard]] bool calcHasInnerTie(bool forTieEnd = false) const;
1785
1787 [[nodiscard]]
1788 StaffCmper calcStaff() const;
1789
1792 [[nodiscard]]
1793 std::unique_ptr<music_theory::Transposer> createTransposer() const;
1794
1797 [[nodiscard]]
1799 {
1800 if (m_noteIndex >= m_entry->getEntry()->notes.size()) {
1801 return NoteInfoPtr();
1802 }
1803 return NoteInfoPtr(m_entry, m_noteIndex + 1);
1804 }
1805
1808 [[nodiscard]]
1810 {
1811 if (m_noteIndex <= 0) {
1812 return NoteInfoPtr();
1813 }
1814 return NoteInfoPtr(m_entry, m_noteIndex - 1);
1815 }
1816
1818 [[nodiscard]]
1819 bool calcIsEnharmonicRespell() const;
1820
1830 [[nodiscard]]
1831 std::pair<int, int> calcDefaultEnharmonic() const
1832 { return (*this)->calcDefaultEnharmonic(m_entry.getKeySignature()); }
1833
1836 [[nodiscard]]
1838
1848 [[nodiscard]]
1850
1853 [[nodiscard]]
1854 bool calcIsIncludedInVoicing() const;
1855
1858 [[nodiscard]]
1859 bool calcIsTop() const;
1860
1863 [[nodiscard]]
1864 bool calcIsBottom() const;
1865
1888
1898
1902 {
1903 bool matched{};
1905 std::vector<TieStandInSource> sources{};
1906
1908 explicit operator bool() const noexcept { return matched; }
1909 };
1910
1914 [[nodiscard]]
1915 std::optional<ArpeggiatedTieInfo> calcArpeggiatedTieInfo() const;
1916
1919 [[nodiscard]]
1920 PseudoTieInfo calcPseudoLvTieInfo() const;
1921
1924 [[nodiscard]]
1925 PseudoTieInfo calcPseudoTieEndInfo() const;
1926
1933 [[nodiscard]]
1934 std::vector<std::pair<NoteInfoPtr, CurveContourDirection>> calcJumpTieContinuationsFrom() const;
1935
1936private:
1937 enum class TieFromSearchAction {
1938 Continue,
1939 Accept,
1940 Stop,
1941 };
1942
1943 static NoteInfoPtr findTieFromCandidate(const NoteInfoPtr& note, Cmper previousMeasure,
1944 const std::function<TieFromSearchAction(const NoteInfoPtr&, bool)>& decide);
1945
1947 [[nodiscard]]
1948 PseudoTieInfo calcPseudoTieInfoInternal(utils::PseudoTieMode mode) const;
1949
1951 [[nodiscard]]
1952 bool selectPseudoTieDirectionAndMatch(PseudoTieInfo* info,
1953 std::vector<CurveContourDirection>& directions,
1954 const std::vector<size_t>* eligibleNoteIndices = nullptr) const;
1955
1959 [[nodiscard]]
1960 bool isSamePitch(const NoteInfoPtr& src) const;
1961
1965 [[nodiscard]]
1966 bool isSamePitchValues(const NoteInfoPtr& src) const;
1967
1970 [[nodiscard]]
1971 NoteInfoPtr calcTieToWithNextMeasure(Cmper nextMeasure) const;
1972
1976 [[nodiscard]]
1977 NoteInfoPtr calcTieFromWithPreviousMeasure(Cmper previousMeasure, bool requireTie) const;
1978
1979 EntryInfoPtr m_entry;
1980 size_t m_noteIndex;
1981
1983 mutable std::optional<CurveContourDirection> m_tieDirection{};
1984};
1985
1986} // namespace dom
1987} // 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:81
ShareMode
Describes how this instance is shared between part and score.
Definition BaseClasses.h:91
virtual void integrityCheck(const std::shared_ptr< EnigmaBase > &ptrToThis)
Performs a final consistency check after population.
Definition BaseClasses.h:125
Represents a vector of EntryInfo instances for a given frame, along with computed information.
Definition Entries.h:1241
util::Fraction getTimeStretch() const
Get the time stretch in this frame. Rather than accessing this value directly, consider using EntryIn...
Definition Entries.h:1409
util::Fraction maxElapsedStaffDuration
Definition Entries.h:1375
EntryFrame(const details::GFrameHoldContext &gfhold, LayerIndex layerIndex, util::Fraction timeStretch, const MusxInstance< others::StaffComposite > &startStaff)
Constructor function.
Definition Entries.h:1250
util::Fraction measureStaffDuration
The duration of the measure in staff duration units.
Definition Entries.h:1374
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:312
EntryInfoPtr getLastInVoice(int voice) const
Returns the last entry in the specified v1/v2 or null if none.
Definition Entries.cpp:227
MusxInstance< others::StaffComposite > getStartStaffInstance() const
Gets the staff at eduPosition 0 without needing to create it again.
Definition Entries.h:1501
bool calcAreAllEntriesHiddenInFrame() const
Calculates if this all notes in the frame are hidden. This routine only checks that entries are indiv...
Definition Entries.cpp:301
MeasCmper getMeasure() const
Get the measure for the entry frame.
Definition Entries.cpp:201
MusxInstance< others::Measure > getMeasureInstance() const
Get the measure instance.
Definition Entries.cpp:280
void addEntry(const std::shared_ptr< const EntryInfo > &entry)
Add an entry to the list.
Definition Entries.h:1484
const std::vector< std::shared_ptr< const EntryInfo > > & getEntries() const
Get the entry list.
Definition Entries.h:1413
EntryInfoPtr getFirstInVoice(int voice) const
Returns the first entry in the specified v1/v2 or null if none.
Definition Entries.cpp:211
StaffCmper getStaff() const
Get the staff for the entry.
Definition Entries.cpp:199
Cmper getRequestedPartId() const
Get the requested part ID for the entry frame.
Definition Entries.h:1388
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:250
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:271
MusxInstance< KeySignature > keySignature
This can be different than the measure key sig if the staff has independent key signatures.
Definition Entries.h:1373
MusxInstance< others::LayerAttributes > getLayerAttributes() const
Get the LayerAttributes for this entry frame.
Definition Entries.cpp:203
const details::GFrameHoldContext & getContext() const
Get the frame context for this frame.
Definition Entries.h:1384
LayerIndex getLayerIndex() const
Get the layer index (0..3) of the entry frame.
Definition Entries.h:1400
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:319
DocumentPtr getDocument() const
Get the document for the entry frame.
Definition Entries.cpp:197
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:259
std::vector< TupletInfo > tupletInfo
A list of the tuplets in the frame and their calculated starting and ending information.
Definition Entries.h:1372
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:237
bool calcIsCueFrame(bool includeVisibleInScore=false) const
Calculates if this entry frame is part of a cue.
Definition Entries.cpp:285
Iterator-style wrapper for workaround-aware voice traversal.
Definition Entries.h:1149
const EntryInfoPtr & getEntryInfo() const noexcept
Returns the entry at the current iterator position.
Definition Entries.h:1182
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:2381
InterpretedIterator getNext() const
Returns an iterator advanced to the next usable entry in this voice.
Definition Entries.cpp:2416
util::Fraction getEffectiveMeasureStaffDuration() const
Return the effective measure staff duration of the entry. Calling code using InterpretedIterator shou...
Definition Entries.cpp:2376
InterpretedIterator getPrevious() const
Returns an iterator advanced to the previous usable entry in this voice.
Definition Entries.cpp:2428
bool getEffectiveHidden() const noexcept
Returns whether the entry should be treated as hidden.
Definition Entries.h:1187
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:2360
util::Fraction getEffectiveElapsedDuration(bool global=false) const
Return the effective elapsed duration of the entry. Calling code using InterpretedIterator should use...
Definition Entries.cpp:2368
Wraps a frame of shared_ptr<const EntryInfo> and an index for per entry access. This class manages ow...
Definition Entries.h:553
bool calcUpStemDefault() const
Calculates if the entry is upstem by default, without considering voices, layers, staff options,...
Definition Entries.cpp:1066
EntryInfoPtr getNextInFrame() const
Get the next entry in the frame.
Definition Entries.cpp:794
bool calcHasGraceNote() const
Return true if this entry is a main note with one or more grace notes.
Definition Entries.cpp:2226
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:942
bool calcIsBeamStart(BeamIterationMode beamIterationMode=BeamIterationMode::Normal) const
Returns whether this is the start of a primary beam.
Definition Entries.cpp:1250
bool calcBeamMustStartHere() const
Determines if a beam must start on this entry.
Definition Entries.cpp:1245
EntryInfoPtr(const std::shared_ptr< const EntryFrame > &entryFrame, size_t index=0)
Constructor function.
Definition Entries.h:578
EntryInfoPtr getNextSameV() const
Get the next entry in the frame in the same voice.
Definition Entries.cpp:802
bool calcCanBeBeamed() const
Determines if this entry can be beamed.
Definition Entries.cpp:1232
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:1498
size_t getIndexInFrame() const
Returns the index within the frame.
Definition Entries.h:657
util::Fraction calcGlobalElapsedDuration() const
Calculates the elapsed duration in global edu, removing any time stretch due to independent time sign...
Definition Entries.cpp:1853
std::pair< bool, bool > calcEntryStemSettings() const
Returns the Entry stem settings for the current requested part. This function encapsulates handling o...
Definition Entries.cpp:720
EntryInfoPtr calcBeamContinuesLeftOverBarline() const
Determines if this entry continues a beam across a barline from the previous measure.
Definition Entries.cpp:1533
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:747
bool calcIfLayerSettingsApply() const
Calculates whether the conditions are met for the layer attributes dependent on others::LayerAttribut...
Definition Entries.cpp:2128
EntryInfoPtr getPreviousInVoice(int voice) const
Returns the previous entry in the frame in the specified v1/v2 or null if none.
Definition Entries.cpp:910
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:2298
unsigned calcReverseGraceIndex() const
Caclulates the grace index counting leftward (used by other standards such as MNX)
Definition Entries.cpp:737
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:509
EntryInfoPtr getPreviousSameVNoGrace() const
Get the previous entry in the frame in the same voice, skipping grace notes.
Definition Entries.cpp:891
MusxInstance< details::EntryPartFieldDetail > getPartFieldData() const
Gets the applicable part data for the entry, or nullptr if none.
Definition Entries.cpp:697
BeamIterationMode
Controls which entries are included when iterating over beams.
Definition Entries.h:558
@ 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:563
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:830
Evpu calcManuaOffset() const
Returns the manual offset of the entry for the current requested part. This function encapsulates han...
Definition Entries.cpp:712
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:783
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:1708
bool isSameEntry(const EntryInfoPtr &src) const
Returns whether the input and the current instance refer to the same entry.
Definition Entries.cpp:550
EntryInfoPtr findHiddenSourceForBeamOverBarline() const
Find the hidden source entry for a mid-system beam created by the Beam Over Barline plugin....
Definition Entries.cpp:1371
unsigned calcLowestBeamStub() const
Returns the lowest beam stub at this entry, where 2 = 16th note stub, 3 = 32nd note stub,...
Definition Entries.cpp:1794
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:2094
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:614
bool calcGraceNoteSlash(const MusxInstance< options::GraceNoteOptions > graceOptions=nullptr) const
Calculates if the current entry is a grace note with a slash.
Definition Entries.cpp:1201
util::Fraction calcGraceElapsedDuration() const
Calculates a grace note's symbolic starting duration as a negative offset from the main note....
Definition Entries.cpp:749
unsigned calcLowestBeamEnd() const
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam,...
Definition Entries.cpp:1750
LayerIndex getLayerIndex() const
Get the layer index (0..3) of the entry.
Definition Entries.cpp:689
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:2214
unsigned calcLowestBeamEndAcrossBarlines() const
Returns the lowest beam number ending at this entry, where 1 = 8th note beam, 2 = 16th note beam,...
Definition Entries.cpp:1773
StemDirection calcStemDirectionForced() const
Returns the forced stem direction if any.
Definition Entries.cpp:1160
unsigned calcNumberOfBeams() const
Calculates the number of beams or flags on the entry.
Definition Entries.cpp:1657
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:926
EntryInfoPtr getPreviousInFrame() const
Get the previous entry in the frame.
Definition Entries.cpp:868
std::shared_ptr< const EntryFrame > getFrame() const
Returns the frame.
Definition Entries.h:654
bool calcUpStem() const
Determines the effective stem direction of the entry, taking into account voices, layers,...
Definition Entries.h:820
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:2074
int getVoice() const
Gets the voice as integer value 1 or 2.
Definition Entries.cpp:558
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:650
EntryInfoPtr findBeamStartOrCurrent() const
Finds the first entry of a beamed group or returns the current entry if it is not beams.
Definition Entries.cpp:1622
bool calcDisplaysAsRest() const
Calculates if an entry displays as a rest.
Definition Entries.cpp:958
MusxInstance< KeySignature > getKeySignature() const
Get the key signature of the entry.
Definition Entries.cpp:695
bool calcIsCue(bool includeVisibleInScore=false) const
Calculates if this entry is part of a cue.
Definition Entries.cpp:2024
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:752
InterpretedIterator asInterpretedIterator(bool remapBeamOverBarlineEntries=true) const
Returns this EntryInfoPtr in a InterpretedIterator instance.
Definition Entries.cpp:920
bool calcCreatesSingletonBeamLeft() const
Determines if this entry contains a tuplet that creates a singleton beam left. See EntryFrame::Tuplet...
Definition Entries.cpp:1262
bool operator<(const EntryInfoPtr &other) const
Explicit operator< for std::map.
Definition Entries.h:1054
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:857
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:762
std::pair< int, int > calcTopBottomStaffPositions() const
Calculates the top and bottom staff positions of the entry, taking into account percussion notes....
Definition Entries.cpp:1010
StaffCmper getStaff() const
Get the staff cmper.
Definition Entries.cpp:691
EntryInfoPtr findBeamEnd() const
Finds the end entry of a beamed group.
Definition Entries.cpp:1639
int calcEntrySize() const
Returns the entry size as a percentage, taking into account the beaming.
Definition Entries.cpp:2010
EntryInfoPtr getPreviousSameV() const
Get the previous entry in the frame in the same voice.
Definition Entries.cpp:876
int calcCrossStaffDirectionForAll(DeferredReference< MusxInstanceList< others::StaffUsed > > staffList={}) const
Calculates if this entry has cross-staffed notes all in a single direction.
Definition Entries.cpp:2169
MusxInstance< others::StaffComposite > createCurrentStaff(const std::optional< StaffCmper > &forStaffId=std::nullopt) const
Creates the current StaffComposite for the entry.
Definition Entries.cpp:729
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:1446
bool calcIsTrillToGraceEntry() const
Calculates if this entry is a trill-to entry as created by the Parenthesize Trill-To Notes plugin.
Definition Entries.cpp:2248
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:2237
EntryInfoPtr getNextInVoice(int voice) const
Returns the next entry in the frame in the specified v1/v2 or null if none.
Definition Entries.cpp:900
EntryInfoPtr calcBeamContinuesRightOverBarline() const
Determines if this entry continues a beam across a barline to the next measure.
Definition Entries.cpp:1577
int calcFloatingRestStaffPosition() const
Calculates the staff position of a floating rest.
Definition Entries.cpp:976
std::optional< StaffCmper > calcCrossedStaffForAll() const
Calculates all the notes in this entry are crossed to the same staff.
Definition Entries.cpp:2193
const std::shared_ptr< const EntryInfo > operator->() const
Allows -> access to the underlying EntryInfo instance.
Definition Entries.cpp:534
bool calcUnbeamed() const
Returns whether this is an unbeamed entry.
Definition Entries.cpp:1223
NoteInfoPtr findNoteId(NoteNumber noteId) const
Returns a NoteInfoPtr for the note specified by noteId within this entry.
Definition Entries.cpp:678
EntryInfoPtr()
Default constructor.
Definition Entries.h:571
bool calcCreatesSingletonBeamRight() const
Determines if this entry contains a tuplet that creates a singleton beam right. See EntryFrame::Tuple...
Definition Entries.cpp:1273
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:1804
bool calcIsGlissToGraceEntry() const
Calculates if this entry is a gliss-to entry as created by the Parenthesize Trill-To Notes plugin.
Definition Entries.cpp:2271
std::pair< Evpu, Evpu > calcTopBottomExtent() const
Calculates the top and bottom EVPU extent of the entry's approximate visual footprint.
Definition Entries.cpp:1036
bool calcIsFullMeasureRest() const
Returns whether this is a full measure rest.
Definition Entries.cpp:2050
util::Fraction calcGlobalActualDuration() const
Calculates the actual duration in global edu, removing any time stretch due to independent time signa...
Definition Entries.cpp:1858
MeasCmper getMeasure() const
Get the measure cmper.
Definition Entries.cpp:693
EntryInfoPtr getNextSameVNoGrace() const
Get the next entry in the frame in the same voice, skipping grace notes.
Definition Entries.cpp:820
std::vector< size_t > findTupletInfo() const
Finds the tuplet info for tuplets that include this entry.
Definition Entries.cpp:2114
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:1975
Information an entry along with the entry.
Definition Entries.h:1574
unsigned graceIndex
Definition Entries.h:1593
ClefIndex clefIndex
the clef index in effect for the entry.
Definition Entries.h:1595
util::Fraction calcNextElapsedDuration() const
Calculates the next duration position after this entry.
Definition Entries.h:1612
util::Fraction cumulativeRatio
Definition Entries.h:1591
util::Fraction elapsedDuration
Definition Entries.h:1587
ClefIndex clefIndexConcert
the concert clef index in effect for the entry.
Definition Entries.h:1596
util::Fraction actualDuration
Definition Entries.h:1589
MusxInstance< Entry > getEntry() const
Get the entry.
Definition Entries.h:1601
Represents an entry containing metadata and notes.
Definition Entries.h:393
bool splitStem
Definition Entries.h:441
Entry(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, EntryNumber entnum, EntryNumber prev, EntryNumber next)
Constructor function.
Definition Entries.h:399
EntryNumber getEntryNumber() const
Gets the entry number for this entry.
Definition Entries.h:481
bool articDetail
Indicates there is an articulation on the entry.
Definition Entries.h:423
bool upStemScore
Whether a stem is up or down as set in the score. (Only reliable when freezeStemScore is true....
Definition Entries.h:443
bool isNote
If this value is false, the entry is a rest.
Definition Entries.h:416
bool noLeger
Hide ledger lines.
Definition Entries.h:448
MusxInstance< Entry > getNext() const
Gets the next entry in this list or nullptr if none.
Definition Entries.cpp:119
bool noPlayback
Indicates that the entry should not be played back.
Definition Entries.h:454
bool voice2
This is a V2 note. (xml node <v2>)
Definition Entries.h:418
bool splitRest
Indicates that rests in different layers are not combined on this entry.
Definition Entries.h:426
bool beamExt
Indicates that there is a beam extension on the entry.
Definition Entries.h:430
bool createdByHP
Indicates the entry was created by Finale's smart playback engine.
Definition Entries.h:419
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Entries.h:536
MusxInstance< Entry > getPrevious() const
Gets the previous entry in this list or nullptr if none.
Definition Entries.cpp:129
bool secBeam
Signifies a secondary beam break occurs on the entry.
Definition Entries.h:434
bool stemDetail
Indicates there are stem modifications.
Definition Entries.h:436
bool slashGrace
Definition Entries.h:450
bool isValid
Should always be true but otherwise appears to be used internally by Finale.
Definition Entries.h:415
bool playDisabledByHP
Used by Finale's smart playback engine.
Definition Entries.h:420
bool flipTie
Indicates the existence of a flipped tie, either in Speedy Entry or Layer Attributes.
Definition Entries.h:431
bool flatBeam
Forces any beam that starts on this entry to be flat by default.
Definition Entries.h:453
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:459
bool dummy
Definition Entries.h:445
Evpu hOffsetScore
Manual offset created with the Note Position Tool in the score. (xml node is <posi>....
Definition Entries.h:414
bool checkAccis
Used by Finale to convert pre-2014 .mus files. May never be saved in .musx.
Definition Entries.h:444
bool noteDetail
Indicates there is a note detail or EntrySize record for the entry.
Definition Entries.h:422
util::Fraction calcFraction() const
Calculates the duration as a util::Fraction of a whole note.
Definition Entries.h:505
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:510
bool crossStaff
Signifies that at least one note in the entry has been cross staffed.
Definition Entries.h:437
bool floatRest
Is floating rest. If false, the first note element gives the staff position of the rest.
Definition Entries.h:428
bool smartShapeDetail
Indicates this entry has a smart shape assignment.
Definition Entries.h:447
Edu duration
Duration of the entry, not taking into account tuplets.
Definition Entries.h:412
bool isHidden
Indicates the entry is hidden, (xml node is <ignore>)
Definition Entries.h:429
void integrityCheck(const std::shared_ptr< EnigmaBase > &ptrToThis) override
Performs a final consistency check after population.
Definition Entries.h:520
bool tupletStart
Indicates that a tuplet start on the entry.
Definition Entries.h:425
bool lyricDetail
Indicates there is a lyric assignment on the entry.
Definition Entries.h:424
int numNotes
Number of notes in the entry. There is an error if this is not the same as notes.size().
Definition Entries.h:413
bool sorted
Sorted flag.
Definition Entries.h:449
bool reverseDownStem
Indicates that a stem normally down is reversed.
Definition Entries.h:439
bool reverseUpStem
Indicates that a stem normally up is reversed.
Definition Entries.h:438
bool v2Launch
Indicates if this entry (which is voice1) launches a voice2 sequence. (xml node is <controller>)
Definition Entries.h:417
bool doubleStem
Creates a double stem on the entry. (Appears to be exclusive with splitStem.)
Definition Entries.h:440
bool isPossibleFullMeasureRest() const
Returns true if the entry could be a full-measure rest.
Definition Entries.h:517
bool beam
Signifies the start of a beam or singleton entry. (That is, any beam breaks at this entry....
Definition Entries.h:433
bool freezeStemScore
Freeze stem flag in the score. (upStemScore gives the direction.)
Definition Entries.h:435
bool performanceData
Indicates there is performance data on the entry.
Definition Entries.h:427
bool noSpacing
Indicates that the entry should be ignored when calculating music spacing.
Definition Entries.h:455
bool dotTieAlt
Indicates dot or tie alterations are present.
Definition Entries.h:432
bool freezeBeam
Freeze beam flag (Derived from the presence of <freezeBeam> node.)
Definition Entries.h:456
struct musx::dom::Entry::EntryLocation location
The location of this entry.
bool graceNote
Indicate the entry is a grace note.
Definition Entries.h:421
Duration calcDurationInfo() const
Calculates the NoteType and number of augmentation dots. (See calcDurationInfoFromEdu....
Definition Entries.h:499
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:174
KeyContext
Indicates whether to compute key signature values in concert or written pitch.
Definition CommonClasses.h:204
Provides optional per-type extension methods for MusxInstanceList.
Definition MusxInstance.h:118
Wraps an EntryInfo instance and a note index.
Definition Entries.h:1621
CurveContourDirection calcFreezeTieDirection(bool forTieEnd=false) const
Calculates the user-frozen tie direction for this note, if any.
Definition Entries.cpp:3038
size_t getNoteIndex() const
Gets the note index for this note.
Definition Entries.h:1666
NoteheadInfo calcNoteheadInfo() const
Resolves the effective font and character used to render this note's notehead, along with any size or...
Definition Entries.cpp:3165
EntryInfoPtr getEntryInfo() const
Gets the entry info for this note.
Definition Entries.h:1661
MusxInstance< others::PercussionNoteInfo > calcPercussionNoteInfo() const
Calculates the percussion note info for this note, if any.
Definition Entries.cpp:3144
MusxInstance< Note > operator->() const
Allows -> access to the underlying Note instance.
Definition Entries.h:1651
bool calcHasInnerTie(bool forTieEnd=false) const
Determines whether this note has an inner tie at the specified endpoint.
Definition Entries.cpp:3066
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:3546
bool isSameNote(const NoteInfoPtr &src) const
Returns whether the input and the current instance refer to the same note.
Definition Entries.h:1640
StaffCmper calcStaff() const
Calculates the staff number, taking into account cross staffing.
Definition Entries.cpp:3076
bool calcIsBottom() const
Return true if this is the bottom note in the entry.
Definition Entries.cpp:3345
CurveContourDirection calcEffectiveTieDirection(bool forTieEnd=false) const
Determines whether this note has an outer tie at the specified endpoint.
Definition Entries.cpp:3048
NoteInfoPtr getPrevious() const
Gets the next note in a chord on the same entry.
Definition Entries.h:1809
Note::NoteProperties calcNotePropertiesConcert(bool alwaysUseEntryStaff=false) const
Calculates the note name, octave number, actual alteration, and staff position for the concert pitch ...
Definition Entries.cpp:3118
bool calcIsEnharmonicRespellInAnyPart() const
Calculates if any linked part has this note enharmonically respelled.
Definition Entries.cpp:3250
NoteInfoPtr calcTieFrom(bool requireTie=true) const
Calculates the note that this note could tie from.
Definition Entries.cpp:3033
PseudoTieInfo calcPseudoTieEndInfo() const
Calculates whether this note has a stand-in tie-end and returns tie metadata. For a match,...
Definition Entries.cpp:3394
bool calcIsIncludedInVoicing() const
Returns true if this note is included in the part voicing. This function returns the correct value ev...
Definition Entries.cpp:3319
bool calcHasOuterTie(bool forTieEnd=false) const
Determines whether this note has an outer tie at the specified endpoint.
Definition Entries.cpp:3056
bool calcIsEnharmonicRespell() const
Returns if this note is enharmonically respelled in the current part view.
Definition Entries.cpp:3239
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:1831
Note::NoteProperties calcNotePropertiesInView(bool alwaysUseEntryStaff=false) const
Calculates the note name, octave number, actual alteration, and staff position for the pitch of the n...
Definition Entries.cpp:3134
int calcCrossStaffDirection(DeferredReference< MusxInstanceList< others::StaffUsed > > staffList={}) const
Calculates if this note is cross-staffed and if so, which direction.
Definition Entries.cpp:3296
PseudoTieInfo calcPseudoLvTieInfo() const
Calculates whether this note has a stand-in laissez-vibrer tie and returns tie metadata....
Definition Entries.cpp:3389
NoteInfoPtr(const EntryInfoPtr &entryInfo, size_t noteIndex)
Constructor.
Definition Entries.h:1629
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:3363
NoteInfoPtr calcTieTo() const
Calculates the note that this note could tie to. Check the return value's Note::tieEnd to see if ther...
Definition Entries.cpp:3028
bool calcIsTop() const
Return true if this is the top note in the entry.
Definition Entries.cpp:3327
NoteInfoPtr findEqualPitch(const EntryInfoPtr &entry) const
Finds a note with the same pitch in the supplied entry.
Definition Entries.cpp:2887
NoteInfoPtr getNext() const
Gets the next note in a chord on the same entry.
Definition Entries.h:1798
NoteInfoPtr()
Default constructor.
Definition Entries.h:1624
std::unique_ptr< music_theory::Transposer > createTransposer() const
Creates a transposer for this Note instance.
Definition Entries.cpp:3234
Note::NoteProperties calcNoteProperties(EnharmonicOverride enharmonicOverride=EnharmonicOverride::None, bool alwaysUseEntryStaff=false) const
Calculates the note name, octave number, actual alteration, and staff position. The staff position ta...
Definition Entries.cpp:3091
Represents a single note element in an entry.
Definition Entries.h:294
bool upStemSecond
When the entry is upstem, it is drawn on the "wrong" side of the stem.
Definition Entries.h:320
bool isValid
Should always be true but otherwise appears to be used internally by Finale.
Definition Entries.h:316
bool playDisabledByHP
Used by Finale's smart playback engine.
Definition Entries.h:331
static constexpr NoteNumber RESTID
Non floating rests have a note with this noteId that defines their staff positions.
Definition Entries.h:303
int harmAlt
Chromatic alteration relative to the key signature. Never has a magnitude greater than +/-7.
Definition Entries.h:315
bool upSplitStem
Definition Entries.h:324
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:336
bool tieEnd
Indicates a tie ends on this note.
Definition Entries.h:318
Note(const DocumentWeakPtr &document, NoteNumber noteId)
Constructor function.
Definition Entries.h:297
bool tieStart
Indicates a tie starts on this note.
Definition Entries.h:317
bool crossStaff
Signifies that the note has a details::CrossStaff note detail.
Definition Entries.h:319
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:2822
int harmLev
Diatonic displacement relative to middle C or to the tonic in the middle C octave (if the key signatu...
Definition Entries.h:314
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:322
std::tuple< music_theory::NoteName, int, int, int > NoteProperties
Note properites. A tuple containing:
Definition Entries.h:312
bool noPlayback
Indicates that this note should not be played back.
Definition Entries.h:328
bool parenAcci
True if the accidental has parentheses.
Definition Entries.h:327
bool noSpacing
Indicates that this note should ignored when calculating spacing.
Definition Entries.h:329
bool showAcci
True if the note has an accidental. (Dynamically changed by Finale unless freezeAcci is set....
Definition Entries.h:326
bool freezeAcci
True if the accidental should be forced on or off (based on showAcci.)
Definition Entries.h:330
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:2850
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:2745
const GFrameHold * operator->() const
Provides const pointer-style access to the underlying GFrameHold.
Definition Entries.h:133
MusxInstance< others::PartVoicing > getPolicyPartVoicing() const
Returns the part voicing for the requested part, based on the document's PartVoicingPolicy.
Definition Entries.h:125
MusxInstance< others::PartVoicing > getPartVoicing() const
Returns the part voicing for the requested part.
Definition Entries.h:117
CueSummary calcCueSummary(bool includeVisibleInScore=false) const
Calculates cue layers and whether this hold is comprised only of cue frames and full-measure rests.
Definition Entries.cpp:2699
std::map< LayerIndex, int > calcVoices(bool excludeHidden=false) const
Calculates the number of voices used by the GFrameHold instance.
Definition Entries.cpp:2631
std::shared_ptr< const EntryFrame > createEntryFrame(LayerIndex layerIndex) const
Returns the EntryFrame for all entries in the given layer.
Definition Entries.cpp:2494
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:250
util::Fraction snapLocationToEntryOrKeep(util::Fraction location, bool findExact=true) const
Snaps a measure position to the nearest entry if possible.
Definition Entries.cpp:2782
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:152
util::Fraction calcMinLegacyPickupSpacer() const
Calculates the minimum legacy pickup spacer, if any.
Definition Entries.cpp:2793
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:2612
bool calcIsCuesOnly(bool includeVisibleInScore=false) const
Calculates if this staff in this measure contains only a cue layer and full-measure rest layers.
Definition Entries.cpp:2686
bool calcVoicingIncludesLayer(LayerIndex layerIndex) const
Calculates if the part voicing for the current requested part includes the specified layer....
Definition Entries.cpp:2810
bool calcPolicyVoicingIncludesLayer(LayerIndex layerIndex) const
Similar to calcVoicingIncludesLayer, but honoring the document's part voicing policy.
Definition Entries.h:244
Cmper getRequestedPartId() const
Returns the requested part ID associated with this context.
Definition Entries.h:109
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:2737
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:2660
Represents the attributes of a Finale frame holder.
Definition Details.h:1143
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
constexpr dom::Edu calcEduDuration() const
Calculates duration as a fraction of a whole note. The result is rounded to the nearest integer Edu v...
Definition Fraction.h:142
A dependency-free, header-only collection of useful functions for music theory.
NoteName
The available note names in array order.
Definition music_theory.hpp:66
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
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:173
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:55
unsigned calcNumberOfBeamsInEdu(Edu duration)
Returns the number of beams implied by an EDU duration.
Definition Entries.cpp:161
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:139
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:127
object model for musx file (enigmaxml)
Definition BaseClasses.h:38
class to track tuplets in the frame
Definition Entries.h:1260
size_t startIndex
the index of the first entry in the tuplet
Definition Entries.h:1262
bool calcCreatesSingletonBeamRight() const
Calculates if this tuplet is being used to create a singleton beam to the right.
Definition Entries.h:1321
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:1269
bool calcIsTremolo() const
Calculates if this tuplet represents a tremolo based on the following criteria.
Definition Entries.cpp:329
size_t endIndex
the index of the last entry in the tuplet
Definition Entries.h:1263
bool includesEntry(const EntryInfoPtr &entryInfo) const
Return true if the entry is part of this tuplet.
Definition Entries.h:1287
util::Fraction endDura
the actual duration where the tuplet ends
Definition Entries.h:1265
size_t numEntries() const
Return the number of entries in the tuplet.
Definition Entries.h:1276
util::Fraction startDura
the actual duration where the tuplet starts
Definition Entries.h:1264
bool calcCreatesSingletonBeamLeft() const
Calculates if this tuplet is being used to create a singleton beam to the left.
Definition Entries.h:1333
MusxInstance< details::TupletDef > tuplet
the tuplet
Definition Entries.h:1261
bool voice2
whether this tuplet is for voice2
Definition Entries.h:1266
bool calcCreatesTimeStretch() const
Detects tuplets being used to create time stretch in an independent time signature.
Definition Entries.cpp:475
The location of this entry as calculated by calcLocations, which is called by the factory.
Definition Entries.h:467
void clear()
Clears the entry location. (Mainly used for benchmarking.)
Definition Entries.h:476
size_t entryIndex
The 0-based index of this entry within its layer.
Definition Entries.h:471
bool found() const
Returns if this entry has been found.
Definition Entries.h:474
MeasCmper measureId
The measure containing this entry.
Definition Entries.h:469
LayerIndex layerIndex
The layer containing this entry within the measure.
Definition Entries.h:470
StaffCmper staffId
The staff containing this entry.
Definition Entries.h:468
Metadata for a smart-shape arpeggiated tie match.
Definition Entries.h:1892
CurveContourDirection direction
Contour direction reported by the source smart shape.
Definition Entries.h:1895
size_t targetNoteIndex
Note index within targetEntry.
Definition Entries.h:1894
Cmper smartShapeId
Cmper of the smart shape that produced the match.
Definition Entries.h:1896
EntryInfoPtr targetEntry
Entry containing the tied-to note.
Definition Entries.h:1893
The resolved font, character, size, and offset for a note's notehead.
Definition Entries.h:1712
int percent
Size percentage for the notehead. (100 means 100%.)
Definition Entries.h:1715
MusxInstance< FontInfo > font
The font that character is drawn from.
Definition Entries.h:1713
char32_t character
The notehead character, interpreted in font.
Definition Entries.h:1714
Evpu vertOffset
Definition Entries.h:1717
Evpu horzOffset
Horizontal notehead offset from the default position.
Definition Entries.h:1716
Metadata for pseudo tie and pseudo tie-end detection.
Definition Entries.h:1902
std::vector< TieStandInSource > sources
Contributing surrogate tie sources from the winning source type.
Definition Entries.h:1905
bool matched
True when this note satisfies the pseudo tie criteria.
Definition Entries.h:1903
CurveContourDirection direction
Resolved contour direction for this note.
Definition Entries.h:1904
Identifies one surrogate tie source matched for a note.
Definition Entries.h:1873
std::optional< Inci > sourceInci
Optional incidence index for sources that are inci-addressed.
Definition Entries.h:1885
Type
The category of source that produced the pseudo tie candidate.
Definition Entries.h:1877
@ 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:1886
Cmper sourceId
Source identifier within the source category.
Definition Entries.h:1884
Type type
The matched source category.
Definition Entries.h:1883
Summary of cue information for a GFrameHold in this context.
Definition Entries.h:73
bool isCueHold
True if the hold contains only cue frames and full-measure rests.
Definition Entries.h:75
std::vector< LayerIndex > cueLayers
0-based layer indices whose frames are cue frames.
Definition Entries.h:74