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
256enum class SlurTieSide
257{
258 Down,
259 Up,
260};
261
270{
271 Individual,
272 Instrument,
273 Unified,
275};
276
284{
285 None,
286 Unified,
288};
289
295{
296 Down,
297 Up
298};
299
305{
306 NextNote,
307 Arpeggio,
308 CrossJump,
310};
311
316enum class TimeSignatureUnit : int
317{
318 Whole = 1,
319 Half = 2,
320 Quarter = 4,
321 Eighth = 8,
322 Value16th = 16,
323 Value32nd = 32,
324 Value64th = 64,
325 Value128th = 128
326};
327
333{
334 Inner,
335 NoNumber,
336 Both
337};
338
339} // namespace mnx
340
341#ifndef DOXYGEN_SHOULD_IGNORE_THIS
342
343namespace nlohmann {
344
345template<>
346struct adl_serializer<mnx::TimeSignatureUnit>
347{
348 template<typename BasicJsonType>
349 static mnx::TimeSignatureUnit from_json(const BasicJsonType& j)
350 { return mnx::TimeSignatureUnit(j.template get<int>()); }
351
352 template<typename BasicJsonType>
353 static void to_json(BasicJsonType& j, const mnx::TimeSignatureUnit& value)
354 { j = int(value); }
355};
356
357template<>
358struct adl_serializer<mnx::OttavaAmount>
359{
360 template<typename BasicJsonType>
361 static mnx::OttavaAmount from_json(const BasicJsonType& j)
362 { return mnx::OttavaAmount(j.template get<int>()); }
363
364 template<typename BasicJsonType>
365 static void to_json(BasicJsonType& j, const mnx::OttavaAmount& value)
366 { j = int(value); }
367};
368
369template<>
370struct adl_serializer<mnx::OttavaAmountOrZero>
371{
372 template<typename BasicJsonType>
373 static mnx::OttavaAmountOrZero from_json(const BasicJsonType& j)
374 { return mnx::OttavaAmountOrZero(j.template get<int>()); }
375
376 template<typename BasicJsonType>
377 static void to_json(BasicJsonType& j, const mnx::OttavaAmountOrZero& value)
378 { j = int(value); }
379};
380
381} // namespace nlohmann
382
383#endif // DOXYGEN_SHOULD_IGNORE_THIS
object model for MNX format
StaffGroupBarlineOverride
Resolved barline override setting for a layout staff group.
Definition Enumerations.h:284
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
enclose accidental in brackets
@ Parentheses
enclose accidental in parentheses
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
TieTargetType
The values that describe the target of a tie.
Definition Enumerations.h:305
@ 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: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:257
TupletDisplaySetting
Controls display of a tuplet's number or note value.
Definition Enumerations.h:333
TimeSignatureUnit
Valid units for the lower numbers of time signatures.
Definition Enumerations.h:317
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:295
StaffGroupBarlineStyle
The types of barline overrides for staff groups in layouts.
Definition Enumerations.h:270
@ 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:198
MarkingUpDown
The values available in an event marking "pointing" property.
Definition Enumerations.h:171
@ Down
down (default)