MUSX Document Model
Loading...
Searching...
No Matches
FieldPopulatorsDetails.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 "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"
30
31#ifndef DOXYGEN_SHOULD_IGNORE_THIS
32
33namespace musx {
34namespace factory {
35
36using namespace ::musx::xml;
37using namespace ::musx::dom::details;
38
39template <>
40struct FieldPopulator<BaselineChords> : private FieldPopulator<Baseline>
41{
42 using FieldPopulator<Baseline>::populate;
43};
44
45template <>
46struct FieldPopulator<BaselineExpressionsAbove> : private FieldPopulator<Baseline>
47{
48 using FieldPopulator<Baseline>::populate;
49};
50
51template <>
52struct FieldPopulator<BaselineExpressionsBelow> : private FieldPopulator<Baseline>
53{
54 using FieldPopulator<Baseline>::populate;
55};
56
57template <>
58struct FieldPopulator<BaselineFretboards> : private FieldPopulator<Baseline>
59{
60 using FieldPopulator<Baseline>::populate;
61};
62
63template <>
64struct FieldPopulator<BaselineLyricsChorus> : private FieldPopulator<Baseline>
65{
66 using FieldPopulator<Baseline>::populate;
67};
68
69template <>
70struct FieldPopulator<BaselineLyricsSection> : private FieldPopulator<Baseline>
71{
72 using FieldPopulator<Baseline>::populate;
73};
74
75template <>
76struct FieldPopulator<BaselineLyricsVerse> : private FieldPopulator<Baseline>
77{
78 using FieldPopulator<Baseline>::populate;
79};
80
81template <>
82struct FieldPopulator<BaselineSystemChords> : private FieldPopulator<Baseline>
83{
84 using FieldPopulator<Baseline>::populate;
85};
86
87template <>
88struct FieldPopulator<BaselineSystemExpressionsAbove> : private FieldPopulator<Baseline>
89{
90 using FieldPopulator<Baseline>::populate;
91};
92
93template <>
94struct FieldPopulator<BaselineSystemExpressionsBelow> : private FieldPopulator<Baseline>
95{
96 using FieldPopulator<Baseline>::populate;
97};
98
99template <>
100struct FieldPopulator<BaselineSystemFretboards> : private FieldPopulator<Baseline>
101{
102 using FieldPopulator<Baseline>::populate;
103};
104
105template <>
106struct FieldPopulator<BaselineSystemLyricsChorus> : private FieldPopulator<Baseline>
107{
108 using FieldPopulator<Baseline>::populate;
109};
110
111template <>
112struct FieldPopulator<BaselineSystemLyricsSection> : private FieldPopulator<Baseline>
113{
114 using FieldPopulator<Baseline>::populate;
115};
116
117template <>
118struct FieldPopulator<BaselineSystemLyricsVerse> : private FieldPopulator<Baseline>
119{
120 using FieldPopulator<Baseline>::populate;
121};
122
123template <>
124struct FieldPopulator<BeamAlterationsDownStem> : private FieldPopulator<BeamAlterations>
125{
126 using FieldPopulator<BeamAlterations>::populate;
127};
128
129template <>
130struct FieldPopulator<BeamAlterationsUpStem> : private FieldPopulator<BeamAlterations>
131{
132 using FieldPopulator<BeamAlterations>::populate;
133};
134
135template <>
136struct FieldPopulator<BeamExtensionDownStem> : private FieldPopulator<BeamExtension>
137{
138 using FieldPopulator<BeamExtension>::populate;
139};
140
141template <>
142struct FieldPopulator<BeamExtensionUpStem> : private FieldPopulator<BeamExtension>
143{
144 using FieldPopulator<BeamExtension>::populate;
145};
146
147template <>
148struct FieldPopulator<CustomDownStem> : private FieldPopulator<CustomStem>
149{
150 using FieldPopulator<CustomStem>::populate;
151};
152
153template <>
154struct FieldPopulator<CustomUpStem> : private FieldPopulator<CustomStem>
155{
156 using FieldPopulator<CustomStem>::populate;
157};
158
159template <>
160struct FieldPopulator<LyricAssignChorus> : private FieldPopulator<LyricAssign>
161{
162 using FieldPopulator<LyricAssign>::populate;
163};
164
165template <>
166struct FieldPopulator<LyricAssignSection> : private FieldPopulator<LyricAssign>
167{
168 using FieldPopulator<LyricAssign>::populate;
169};
170
171template <>
172struct FieldPopulator<LyricAssignVerse> : private FieldPopulator<LyricAssign>
173{
174 using FieldPopulator<LyricAssign>::populate;
175};
176
177template <>
178struct FieldPopulator<SecondaryBeamAlterationsDownStem> : private FieldPopulator<BeamAlterations>
179{
180 using FieldPopulator<BeamAlterations>::populate;
181};
182
183template <>
184struct FieldPopulator<SecondaryBeamAlterationsUpStem> : private FieldPopulator<BeamAlterations>
185{
186 using FieldPopulator<BeamAlterations>::populate;
187};
188
189template <>
190struct FieldPopulator<ShapeNote> : private FieldPopulator<ShapeNoteBase>
191{
192 using FieldPopulator<ShapeNoteBase>::populate;
193};
194
195template <>
196struct FieldPopulator<ShapeNoteStyle> : private FieldPopulator<ShapeNoteBase>
197{
198 using FieldPopulator<ShapeNoteBase>::populate;
199};
200
201template <>
202struct FieldPopulator<StemAlterationsUnderBeam> : private FieldPopulator<StemAlterations>
203{
204 using FieldPopulator<StemAlterations>::populate;
205};
206
207template <>
208struct FieldPopulator<TieAlterEnd> : private FieldPopulator<TieAlterBase>
209{
210 using FieldPopulator<TieAlterBase>::populate;
211};
212
213template <>
214struct FieldPopulator<TieAlterStart> : private FieldPopulator<TieAlterBase>
215{
216 using FieldPopulator<TieAlterBase>::populate;
217};
218
219template <>
220inline Bracket::BracketStyle toEnum<Bracket::BracketStyle>(const int& value)
221{
222 Bracket::BracketStyle result{};
223 if (value >= static_cast<int>(Bracket::BracketStyle::None) &&
224 value <= static_cast<int>(Bracket::BracketStyle::DeskBracket)) {
225 result = static_cast<Bracket::BracketStyle>(value);
226 } else {
227 MUSX_UNKNOWN_XML("Invalid <bracket><id> value in XML for Bracket: " + std::to_string(value));
228 }
229 return result;
230}
231
232} // namespace factory
233} // namespace musx
234
235#endif // DOXYGEN_SHOULD_IGNORE THIS
Classes in the DetailsPool.
Definition CommonClasses.h:50
Provides interfaces and optional implementations for traversing XML.
Definition PugiXmlImpl.h:33
object model for musx file (enigmaxml)
Definition BaseClasses.h:38