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
105{
106 Auto,
107 Long,
108 None,
109 Normal,
110 Short,
111 VeryLong,
112 VeryShort
113};
114
120{
121 Normal,
122 Angled,
123 Curlew,
125 DoubleDot,
127 HalfCurve,
128 Square
129};
130
135enum class FontStyle
136{
137 Plain,
138 Italic
139};
140
145enum class FontWeight
146{
147 Plain,
148 Bold
149};
150
155enum class GraceType
156{
159 MakeTime
160};
161
166enum class JumpType
167{
168 DsAlFine,
169 Segno
170};
171
176enum class LabelRef
177{
178 Name,
179 ShortName
180};
181
186enum class LayoutSymbol
187{
188 NoSymbol,
189 Brace,
190 Bracket
191};
192
197enum class LineType
198{
199 Solid,
200 Dashed,
201 Dotted,
202 Wavy
203};
204
210{
211 End,
212 Middle,
213 Start,
214 Whole
215};
216
222{
223 Down,
224 Up
225};
226
232{
233 Auto,
234 Down,
235 Up
236};
237
244enum class NoteStep : int
245{
246 C = 0,
247 D = 1,
248 E = 2,
249 F = 3,
250 G = 4,
251 A = 5,
252 B = 6
253};
254
260{
261 Note4096th,
262 Note2048th,
263 Note1024th,
264 Note512th,
265 Note256th,
266 Note128th,
267 Note64th,
268 Note32nd,
269 Note16th,
270 Eighth,
271 Quarter,
272 Half,
273 Whole,
274 Breve,
275 Longa,
276 Maxima,
277 DuplexMaxima
278};
279
284enum class Orientation
285{
286 Auto,
287 Above,
288 Below
289};
290
295enum class OttavaAmount : int
296{
297 OctaveDown = -1,
298 TwoOctavesDown = -2,
299 ThreeOctavesDown = -3,
300 OctaveUp = 1,
301 TwoOctavesUp = 2,
302 ThreeOctavesUp = 3
303};
304
314enum class OttavaAmountOrZero : int
315{
316 NoTransposition = 0,
317 ThreeOctavesDown = -3,
318 TwoOctavesDown = -2,
319 OctaveDown = -1,
320 OctaveUp = 1,
321 TwoOctavesUp = 2,
322 ThreeOctavesUp = 3
323};
324
329enum class SlurTieSide
330{
331 Down,
332 Up,
333};
334
343{
344 Individual,
345 Instrument,
346 Unified,
348};
349
357{
358 None,
359 Unified,
361};
362
368{
369 Down,
370 Up
371};
372
378{
379 NextNote,
380 Arpeggio,
381 CrossJump,
383};
384
389enum class TimeSignatureUnit : int
390{
391 Whole = 1,
392 Half = 2,
393 Quarter = 4,
394 Eighth = 8,
395 Value16th = 16,
396 Value32nd = 32,
397 Value64th = 64,
398 Value128th = 128
399};
400
406{
407 Inner,
408 NoNumber,
409 Both
410};
411
412} // namespace mnx
413
414#ifndef DOXYGEN_SHOULD_IGNORE_THIS
415
416namespace nlohmann {
417
418template<>
419struct adl_serializer<mnx::TimeSignatureUnit>
420{
421 template<typename BasicJsonType>
422 static mnx::TimeSignatureUnit from_json(const BasicJsonType& j)
423 { return mnx::TimeSignatureUnit(j.template get<int>()); }
424
425 template<typename BasicJsonType>
426 static void to_json(BasicJsonType& j, const mnx::TimeSignatureUnit& value)
427 { j = int(value); }
428};
429
430template<>
431struct adl_serializer<mnx::OttavaAmount>
432{
433 template<typename BasicJsonType>
434 static mnx::OttavaAmount from_json(const BasicJsonType& j)
435 { return mnx::OttavaAmount(j.template get<int>()); }
436
437 template<typename BasicJsonType>
438 static void to_json(BasicJsonType& j, const mnx::OttavaAmount& value)
439 { j = int(value); }
440};
441
442template<>
443struct adl_serializer<mnx::OttavaAmountOrZero>
444{
445 template<typename BasicJsonType>
446 static mnx::OttavaAmountOrZero from_json(const BasicJsonType& j)
447 { return mnx::OttavaAmountOrZero(j.template get<int>()); }
448
449 template<typename BasicJsonType>
450 static void to_json(BasicJsonType& j, const mnx::OttavaAmountOrZero& value)
451 { j = int(value); }
452};
453
454} // namespace nlohmann
455
456#endif // DOXYGEN_SHOULD_IGNORE_THIS
object model for MNX format
StaffGroupBarlineOverride
Resolved barline override setting for a layout staff group.
Definition Enumerations.h:357
JumpType
The types of jumps.
Definition Enumerations.h:167
@ Segno
Dal Segno.
@ DsAlFine
D.S. al Fine.
MarkingUpDownAuto
Specifies up or down or auto for a marking symbol.
Definition Enumerations.h:232
LineType
Specifies the visual style of a line in (specifically) slurs.
Definition Enumerations.h:198
@ 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:296
FermataSymbol
Specifies the symbol style for the fermat.
Definition Enumerations.h:120
@ DoubleDot
curved fermata symbol with two dots (used by Henze to denote long duration)
@ HalfCurve
half-curve fermata symbol (used by Henze to denote short duration)
@ DoubleSquare
double-square fermata symbol (often used to denote very long duration)
@ DoubleAngled
double-angled fermata symbol (often used to denote very short duration)
@ Square
square fermata symbol (often used to denote long duration)
@ Angled
angled fermata symbol (often used to denote short duration)
@ Curlew
double-curve (used by Britten in Curlew River to denote holding until a synchronization point)
LyricLineType
The symbols available to bracket a staff group.
Definition Enumerations.h:210
@ 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
enclose accidental in brackets
@ Parentheses
enclose accidental in parentheses
OttavaAmountOrZero
Valid values for octave displacment amount, including zero for no transposition.
Definition Enumerations.h:315
@ NoTransposition
No transposition.
FontWeight
Specifies the weight of text glyphs.
Definition Enumerations.h:146
@ Bold
bold text
AutoYesNo
3-state choice enum
Definition Enumerations.h:41
TieTargetType
The values that describe the target of a tie.
Definition Enumerations.h:378
@ CrossVoice
The tie end on the next adjacent note in a different voice.
@ CrossJump
The tie crosses to a different ending or jump location.
@ NextNote
The tie ends on the next adjacent note in the same voice. This is the most common case.
@ Arpeggio
The tie is part of an arpeggio notated as consecutive ties.
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:187
@ NoSymbol
the default (none)
@ Brace
piano brace
NoteStep
The diatonic note step values.
Definition Enumerations.h:245
SlurTieSide
Specifies the direction of a slur or tie.
Definition Enumerations.h:330
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:406
TimeSignatureUnit
Valid units for the lower numbers of time signatures.
Definition Enumerations.h:390
LabelRef
The values available in a labelref.
Definition Enumerations.h:177
@ Name
the full name from the part (the default)
@ ShortName
the abbreviated name from the part
FontStyle
Specifies the style of text glyphs.
Definition Enumerations.h:136
@ Italic
italic text
@ Plain
plain (non-italic) text
BeamHookDirection
The types of jumps.
Definition Enumerations.h:71
@ Right
Force hook right.
@ Left
Force hook left.
FermataDuration
Specifies the subjective playback duration of a fermata.
Definition Enumerations.h:105
@ VeryShort
very short fermata
@ None
playback should ignore fermata
@ Long
long fermata
@ Normal
normal length fermata
@ VeryLong
very long fermata
GraceType
Options for how to perform grace notes.
Definition Enumerations.h:156
@ 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:368
StaffGroupBarlineStyle
The types of barline overrides for staff groups in layouts.
Definition Enumerations.h:343
@ Unified
override with unified barline
@ Individual
currently interpreted as no override
@ Instrument
currently interpreted as no override or unified, depending on whether the group is single- or multi-i...
@ Mensurstrich
override with mensurstrich barline
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:260
MarkingUpDown
Specifies up or down for a marking symbol.
Definition Enumerations.h:222
Orientation
Specifies the vertical visual orientation of a glyph with respect to its corresponding notation.
Definition Enumerations.h:285
@ Above
glyph should be above its corresponding notation
@ Below
glyph should be below its corresponding notation