24#include "musx/dom/BaseClasses.h"
25#include "musx/dom/Others.h"
26#include "musx/dom/Details.h"
27#include "musx/dom/Document.h"
28#include "musx/xml/XmlInterface.h"
29#include "FactoryBase.h"
31#ifndef DOXYGEN_SHOULD_IGNORE_THIS
40struct FieldPopulator<BaselineLyricsChorus> :
private FieldPopulator<Baseline>
42 using FieldPopulator<Baseline>::populate;
46struct FieldPopulator<BaselineLyricsSection> :
private FieldPopulator<Baseline>
48 using FieldPopulator<Baseline>::populate;
52struct FieldPopulator<BaselineLyricsVerse> :
private FieldPopulator<Baseline>
54 using FieldPopulator<Baseline>::populate;
58struct FieldPopulator<BeamAlterationsDownStem> :
private FieldPopulator<BeamAlterations>
60 static void populate(
const std::shared_ptr<BeamAlterationsDownStem>& instance,
61 const XmlElementPtr& element,
62 ElementLinker& elementLinker)
64 FieldPopulator<BeamAlterations>::template populate<BeamAlterationsDownStem>(instance, element, elementLinker);
69struct FieldPopulator<BeamAlterationsUpStem> :
private FieldPopulator<BeamAlterations>
71 static void populate(
const std::shared_ptr<BeamAlterationsUpStem>& instance,
72 const XmlElementPtr& element,
73 ElementLinker& elementLinker)
75 FieldPopulator<BeamAlterations>::template populate<BeamAlterationsUpStem>(instance, element, elementLinker);
80struct FieldPopulator<BeamExtensionDownStem> :
private FieldPopulator<BeamExtension>
82 using FieldPopulator<BeamExtension>::populate;
86struct FieldPopulator<BeamExtensionUpStem> :
private FieldPopulator<BeamExtension>
88 using FieldPopulator<BeamExtension>::populate;
92struct FieldPopulator<CustomDownStem> :
private FieldPopulator<CustomStem>
94 using FieldPopulator<CustomStem>::populate;
98struct FieldPopulator<CustomUpStem> :
private FieldPopulator<CustomStem>
100 using FieldPopulator<CustomStem>::populate;
104struct FieldPopulator<LyricAssignChorus> :
private FieldPopulator<LyricAssign>
106 using FieldPopulator<LyricAssign>::populate;
110struct FieldPopulator<LyricAssignSection> :
private FieldPopulator<LyricAssign>
112 using FieldPopulator<LyricAssign>::populate;
116struct FieldPopulator<LyricAssignVerse> :
private FieldPopulator<LyricAssign>
118 using FieldPopulator<LyricAssign>::populate;
122struct FieldPopulator<SecondaryBeamAlterationsDownStem> :
private FieldPopulator<BeamAlterations>
124 static void populate(
const std::shared_ptr<SecondaryBeamAlterationsDownStem>& instance,
125 const XmlElementPtr& element,
126 ElementLinker& elementLinker)
128 FieldPopulator<BeamAlterations>::template populate<SecondaryBeamAlterationsDownStem>(instance, element, elementLinker);
133struct FieldPopulator<SecondaryBeamAlterationsUpStem> :
private FieldPopulator<BeamAlterations>
135 static void populate(
const std::shared_ptr<SecondaryBeamAlterationsUpStem>& instance,
136 const XmlElementPtr& element,
137 ElementLinker& elementLinker)
139 FieldPopulator<BeamAlterations>::template populate<SecondaryBeamAlterationsUpStem>(instance, element, elementLinker);
144struct FieldPopulator<StemAlterationsUnderBeam> :
private FieldPopulator<StemAlterations>
146 using FieldPopulator<StemAlterations>::populate;
150struct FieldPopulator<TieAlterEnd> :
private FieldPopulator<TieAlterBase>
152 using FieldPopulator<TieAlterBase>::populate;
156struct FieldPopulator<TieAlterStart> :
private FieldPopulator<TieAlterBase>
158 using FieldPopulator<TieAlterBase>::populate;
162inline StaffGroup::BracketStyle toEnum<StaffGroup::BracketStyle>(
const int& value)
164 if (value >=
static_cast<int>(StaffGroup::BracketStyle::None) &&
165 value <=
static_cast<int>(StaffGroup::BracketStyle::DeskBracket)) {
166 return static_cast<StaffGroup::BracketStyle
>(value);
168 MUSX_UNKNOWN_XML(
"Invalid <bracket><id> value in XML for StaffGroup: " + std::to_string(value));
172MUSX_RESOLVER_ENTRY(BeamAlterationsDownStem, BeamAlterations::calcAllActiveFlags<BeamAlterationsDownStem>);
173MUSX_RESOLVER_ENTRY(BeamAlterationsUpStem, BeamAlterations::calcAllActiveFlags<BeamAlterationsUpStem>);
174MUSX_RESOLVER_ENTRY(SecondaryBeamAlterationsDownStem, BeamAlterations::calcAllActiveFlags<SecondaryBeamAlterationsDownStem>);
175MUSX_RESOLVER_ENTRY(SecondaryBeamAlterationsUpStem, BeamAlterations::calcAllActiveFlags<SecondaryBeamAlterationsUpStem>);
177MUSX_RESOLVER_ENTRY(StaffGroup, {
179 auto parts = document->getOthers()->getArray<others::PartDefinition>(
SCORE_PARTID);
180 for (
const auto& part : parts) {
181 auto groups = document->getDetails()->getArray<StaffGroup>(part->getCmper(),
BASE_SYSTEM_ID);
182 auto baseList = document->getOthers()->getArray<others::InstrumentUsed>(part->getCmper(),
BASE_SYSTEM_ID);
183 for (
const auto& instance : groups) {
186 if (!startIndex || !endIndex) {
190 +
" [" + std::to_string(part->getCmper()) +
"] has non-existent start or end staff cmpers");
193 for (
size_t x = *startIndex; x <= *endIndex && x < baseList.size(); x++) {
194 instance->staves.insert(baseList[x]->staffId);
static std::optional< size_t > getIndexForStaff(const std::vector< std::shared_ptr< InstrumentUsed > > &iuArray, InstCmper staffId)
Returns the 0-based index of the InstCmper or std::nullopt if not found.
Definition Implementations.cpp:1449
@ Verbose
Informational messages that should only displayed when verbose logging is requested.
static void log(LogLevel level, const std::string &message)
Logs a message with a specific severity level.
Definition Logger.h:87
Classes in the DetailsPool.
Definition CommonClasses.h:328
constexpr Cmper SCORE_PARTID
The part id of the score.
Definition Fundamentals.h:80
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition BaseClasses.h:51
constexpr Cmper BASE_SYSTEM_ID
The base system cmper that gives a list of all available staves and their score order (others::Instru...
Definition Fundamentals.h:81
Provides interfaces and optional implementations for traversing XML.
Definition PugiXmlImpl.h:33
object model for musx file (enigmaxml)
Definition BaseClasses.h:32