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<LyricAssignChorus> :
private FieldPopulator<LyricAssign>
60 using FieldPopulator<LyricAssign>::populate;
64struct FieldPopulator<LyricAssignSection> :
private FieldPopulator<LyricAssign>
66 using FieldPopulator<LyricAssign>::populate;
70struct FieldPopulator<LyricAssignVerse> :
private FieldPopulator<LyricAssign>
72 using FieldPopulator<LyricAssign>::populate;
76struct FieldPopulator<TieAlterEnd> :
private FieldPopulator<TieAlterBase>
78 using FieldPopulator<TieAlterBase>::populate;
82struct FieldPopulator<TieAlterStart> :
private FieldPopulator<TieAlterBase>
84 using FieldPopulator<TieAlterBase>::populate;
88inline StaffGroup::BracketStyle toEnum<StaffGroup::BracketStyle>(
const int& value)
90 if (value >=
static_cast<int>(StaffGroup::BracketStyle::None) &&
91 value <=
static_cast<int>(StaffGroup::BracketStyle::DeskBracket)) {
92 return static_cast<StaffGroup::BracketStyle
>(value);
94 MUSX_UNKNOWN_XML(
"Invalid <bracket><id> value in XML for StaffGroup: " + std::to_string(value));
98MUSX_RESOLVER_ENTRY(StaffGroup, {
100 auto parts = document->getOthers()->getArray<others::PartDefinition>(
SCORE_PARTID);
101 for (
const auto& part : parts) {
102 auto groups = document->getDetails()->getArray<StaffGroup>(part->getCmper(),
BASE_SYSTEM_ID);
103 auto baseList = document->getOthers()->getArray<others::InstrumentUsed>(part->getCmper(),
BASE_SYSTEM_ID);
104 for (
const auto& instance : groups) {
107 if (!startIndex || !endIndex) {
111 +
" [" + std::to_string(part->getCmper()) +
"] has non-existent start or end staff cmpers");
114 for (
size_t x = *startIndex; x <= *endIndex && x < baseList.size(); x++) {
115 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:1067
@ 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:296
constexpr Cmper SCORE_PARTID
The part id of the score.
Definition Fundamentals.h:75
std::shared_ptr< Document > DocumentPtr
Shared Document pointer.
Definition BaseClasses.h:55
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:76
Provides interfaces and optional implementations for traversing XML.
Definition PugiXmlImpl.h:33
object model for musx file (enigmaxml)
Definition BaseClasses.h:32