MNX Document Model
Loading...
Searching...
No Matches
Enumerations.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
24namespace mnx {
25
35
40enum class AutoYesNo
41{
42 Auto,
43 Yes,
44 No
45};
46
51enum class BarlineType
52{
53 Regular,
54 Dashed,
55 Dotted,
56 Double,
57 Final,
58 Heavy,
61 NoBarline,
62 Short,
63 Tick
64};
65
71{
72 Auto,
73 Left,
74 Right
75};
76
82{
83 Comma,
84 Tick,
85 Upbow,
86 Salzedo
87};
88
93enum class ClefSign
94{
95 CClef,
96 FClef,
97 GClef
98};
99
104enum class JumpType
105{
106 DsAlFine,
107 Segno
108};
109
114enum class LabelRef
115{
116 Name,
117 ShortName
118};
119
124enum class LayoutSymbol
125{
126 NoSymbol,
127 Brace,
128 Bracket
129};
130
135enum class LineType
136{
137 Solid,
138 Dashed,
139 Dotted,
140 Wavy
141};
142
148{
149 End,
150 Middle,
151 Start,
152 Whole
153};
154
160{
161 Down,
162 Up
163};
164
171enum class NoteStep : int
172{
173 C = 0,
174 D = 1,
175 E = 2,
176 F = 3,
177 G = 4,
178 A = 5,
179 B = 6
180};
181
187{
188 Note4096th,
189 Note2048th,
190 Note1024th,
191 Note512th,
192 Note256th,
193 Note128th,
194 Note64th,
195 Note32nd,
196 Note16th,
197 Eighth,
198 Quarter,
199 Half,
200 Whole,
201 Breve,
202 Longa,
203 Maxima,
204 DuplexMaxima
205};
206
211enum class OttavaAmount : int
212{
213 OctaveDown = -1,
214 TwoOctavesDown = -2,
215 ThreeOctavesDown = -3,
216 OctaveUp = 1,
217 TwoOctavesUp = 2,
218 ThreeOctavesUp = 3
219};
220
230enum class OttavaAmountOrZero : int
231{
232 NoTransposition = 0,
233 ThreeOctavesDown = -3,
234 TwoOctavesDown = -2,
235 OctaveDown = -1,
236 OctaveUp = 1,
237 TwoOctavesUp = 2,
238 ThreeOctavesUp = 3
239};
240
246{
247 Outgoing,
248 Incoming,
249};
250
255enum class SlurTieSide
256{
257 Down,
258 Up,
259};
260
266{
267 Down,
268 Up
269};
270
275enum class TimeSignatureUnit : int
276{
277 Whole = 1,
278 Half = 2,
279 Quarter = 4,
280 Eighth = 8,
281 Value16th = 16,
282 Value32nd = 32,
283 Value64th = 64,
284 Value128th = 128
285};
286
292{
293 Inner,
294 NoNumber,
295 Both
296};
297
298} // namespace mnx
299
300#ifndef DOXYGEN_SHOULD_IGNORE_THIS
301
302namespace nlohmann {
303
304template<>
305struct adl_serializer<mnx::TimeSignatureUnit>
306{
307 template<typename BasicJsonType>
308 static mnx::TimeSignatureUnit from_json(const BasicJsonType& j)
309 { return mnx::TimeSignatureUnit(j.template get<int>()); }
310
311 template<typename BasicJsonType>
312 static void to_json(BasicJsonType& j, const mnx::TimeSignatureUnit& value)
313 { j = int(value); }
314};
315
316template<>
317struct adl_serializer<mnx::OttavaAmount>
318{
319 template<typename BasicJsonType>
320 static mnx::OttavaAmount from_json(const BasicJsonType& j)
321 { return mnx::OttavaAmount(j.template get<int>()); }
322
323 template<typename BasicJsonType>
324 static void to_json(BasicJsonType& j, const mnx::OttavaAmount& value)
325 { j = int(value); }
326};
327
328template<>
329struct adl_serializer<mnx::OttavaAmountOrZero>
330{
331 template<typename BasicJsonType>
332 static mnx::OttavaAmountOrZero from_json(const BasicJsonType& j)
333 { return mnx::OttavaAmountOrZero(j.template get<int>()); }
334
335 template<typename BasicJsonType>
336 static void to_json(BasicJsonType& j, const mnx::OttavaAmountOrZero& value)
337 { j = int(value); }
338};
339
340} // namespace nlohmann
341
342#endif // DOXYGEN_SHOULD_IGNORE_THIS
object model for MNX format
JumpType
The types of jumps.
Definition Enumerations.h:105
@ Segno
Dal Segno.
@ DsAlFine
D.S. al Fine.
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:136
@ Wavy
A wavy line.
@ Solid
A solid (unbroken) line.
ClefSign
The values available in a clef sign object.
Definition Enumerations.h:94
@ FClef
F Clef.
@ CClef
C Clef.
@ GClef
G Clef.
OttavaAmount
Valid values for ottava amount.
Definition Enumerations.h:212
LyricLineType
The symbols available to bracket a staff group.
Definition Enumerations.h:148
@ End
the end of a word
@ Start
the start of a word
@ Middle
the middle of a word
@ Whole
this lyric is a whole word
AccidentalEnclosureSymbol
The types of accidental enclosure symbols.
Definition Enumerations.h:31
@ Brackets
stems down (default)
OttavaAmountOrZero
Valid values for octave displacment amount, including zero for no transposition.
Definition Enumerations.h:231
@ NoTransposition
No transposition.
AutoYesNo
3-state choice enum
Definition Enumerations.h:41
BreathMarkSymbol
The symbols available for a breath mark.
Definition Enumerations.h:82
@ Comma
comma symbol
@ Salzedo
salzedo symbol
@ Upbow
upbow symbol
LayoutSymbol
The symbols available to bracket a staff group.
Definition Enumerations.h:125
@ NoSymbol
the default (none)
@ Brace
piano brace
NoteStep
The diatonic note step values.
Definition Enumerations.h:172
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:256
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:292
TimeSignatureUnit
Valid units for the lower numbers of time signatures.
Definition Enumerations.h:276
LabelRef
The values available in a labelref.
Definition Enumerations.h:115
@ Name
the full name from the part (the default)
@ ShortName
the abbreviated name from the part
BeamHookDirection
The types of jumps.
Definition Enumerations.h:71
@ Right
Force hook right.
@ Left
Force hook left.
StemDirection
The values available in a labelref.
Definition Enumerations.h:266
SlurTieEndLocation
Specifies the location of the end of a slur or tie, if it doesn't have a target.
Definition Enumerations.h:246
BarlineType
The types of barlines supported.
Definition Enumerations.h:52
@ NoBarline
no barline (barline is invisible)
@ Tick
tick barline
@ Short
length 2 spaces centered on middle staff line.
@ Dotted
dotted barline
@ HeavyLight
thick ling followed by thin line
@ Final
thin line followed by thick line
@ Regular
the default (normal barline)
@ Double
two thin lines together
@ HeavyHeavy
two thick lines
@ Dashed
dashed barline
@ Heavy
single thick line
NoteValueBase
The note values allowed in MNX.
Definition Enumerations.h:187
MarkingUpDown
The values available in an event marking "pointing" property.
Definition Enumerations.h:160
@ Down
down (default)