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 GraceType
105{
108 MakeTime
109};
110
115enum class JumpType
116{
117 DsAlFine,
118 Segno
119};
120
125enum class LabelRef
126{
127 Name,
128 ShortName
129};
130
135enum class LayoutSymbol
136{
137 NoSymbol,
138 Brace,
139 Bracket
140};
141
146enum class LineType
147{
148 Solid,
149 Dashed,
150 Dotted,
151 Wavy
152};
153
159{
160 End,
161 Middle,
162 Start,
163 Whole
164};
165
171{
172 Down,
173 Up
174};
175
182enum class NoteStep : int
183{
184 C = 0,
185 D = 1,
186 E = 2,
187 F = 3,
188 G = 4,
189 A = 5,
190 B = 6
191};
192
198{
199 Note4096th,
200 Note2048th,
201 Note1024th,
202 Note512th,
203 Note256th,
204 Note128th,
205 Note64th,
206 Note32nd,
207 Note16th,
208 Eighth,
209 Quarter,
210 Half,
211 Whole,
212 Breve,
213 Longa,
214 Maxima,
215 DuplexMaxima
216};
217
222enum class OttavaAmount : int
223{
224 OctaveDown = -1,
225 TwoOctavesDown = -2,
226 ThreeOctavesDown = -3,
227 OctaveUp = 1,
228 TwoOctavesUp = 2,
229 ThreeOctavesUp = 3
230};
231
241enum class OttavaAmountOrZero : int
242{
243 NoTransposition = 0,
244 ThreeOctavesDown = -3,
245 TwoOctavesDown = -2,
246 OctaveDown = -1,
247 OctaveUp = 1,
248 TwoOctavesUp = 2,
249 ThreeOctavesUp = 3
250};
251
257{
258 Outgoing,
259 Incoming,
260};
261
266enum class SlurTieSide
267{
268 Down,
269 Up,
270};
271
277{
278 Down,
279 Up
280};
281
286enum class TimeSignatureUnit : int
287{
288 Whole = 1,
289 Half = 2,
290 Quarter = 4,
291 Eighth = 8,
292 Value16th = 16,
293 Value32nd = 32,
294 Value64th = 64,
295 Value128th = 128
296};
297
303{
304 Inner,
305 NoNumber,
306 Both
307};
308
309} // namespace mnx
310
311#ifndef DOXYGEN_SHOULD_IGNORE_THIS
312
313namespace nlohmann {
314
315template<>
316struct adl_serializer<mnx::TimeSignatureUnit>
317{
318 template<typename BasicJsonType>
319 static mnx::TimeSignatureUnit from_json(const BasicJsonType& j)
320 { return mnx::TimeSignatureUnit(j.template get<int>()); }
321
322 template<typename BasicJsonType>
323 static void to_json(BasicJsonType& j, const mnx::TimeSignatureUnit& value)
324 { j = int(value); }
325};
326
327template<>
328struct adl_serializer<mnx::OttavaAmount>
329{
330 template<typename BasicJsonType>
331 static mnx::OttavaAmount from_json(const BasicJsonType& j)
332 { return mnx::OttavaAmount(j.template get<int>()); }
333
334 template<typename BasicJsonType>
335 static void to_json(BasicJsonType& j, const mnx::OttavaAmount& value)
336 { j = int(value); }
337};
338
339template<>
340struct adl_serializer<mnx::OttavaAmountOrZero>
341{
342 template<typename BasicJsonType>
343 static mnx::OttavaAmountOrZero from_json(const BasicJsonType& j)
344 { return mnx::OttavaAmountOrZero(j.template get<int>()); }
345
346 template<typename BasicJsonType>
347 static void to_json(BasicJsonType& j, const mnx::OttavaAmountOrZero& value)
348 { j = int(value); }
349};
350
351} // namespace nlohmann
352
353#endif // DOXYGEN_SHOULD_IGNORE_THIS
object model for MNX format
JumpType
The types of jumps.
Definition Enumerations.h:116
@ Segno
Dal Segno.
@ DsAlFine
D.S. al Fine.
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:147
@ 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:223
LyricLineType
The symbols available to bracket a staff group.
Definition Enumerations.h:159
@ 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:242
@ 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:136
@ NoSymbol
the default (none)
@ Brace
piano brace
NoteStep
The diatonic note step values.
Definition Enumerations.h:183
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:267
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:303
TimeSignatureUnit
Valid units for the lower numbers of time signatures.
Definition Enumerations.h:287
LabelRef
The values available in a labelref.
Definition Enumerations.h:126
@ 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.
GraceType
Options for how to perform grace notes.
Definition Enumerations.h:105
@ StealPrevious
steal time from the previous non-grace.
@ StealFollowing
steak time from the following non-grace.
@ MakeTime
add extra time for the grace note.
StemDirection
The values available in a labelref.
Definition Enumerations.h:277
SlurTieEndLocation
Specifies the location of the end of a slur or tie, if it doesn't have a target.
Definition Enumerations.h:257
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:198
MarkingUpDown
The values available in an event marking "pointing" property.
Definition Enumerations.h:171
@ Down
down (default)