MNX Document Model
Loading...
Searching...
No Matches
EventMarkings.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 "BaseTypes.h"
25#include "Enumerations.h"
26
27namespace mnx {
28namespace sequence {
29
41
47{
48public:
49 using EventMarkingBase::EventMarkingBase;
50};
51
57{
58public:
60 struct Required
61 {
63 };
64
68 {
69 set_direction(direction);
70 }
71
73 BowDirection(const std::shared_ptr<json>& root, json_pointer pointer)
75 {
76 }
77
82 BowDirection(Base& parent, std::string_view key, MarkingUpDown direction)
84 {
85 set_direction(direction);
86 }
87
89 operator Required() const { return { direction() }; }
90
92 static Required make(MarkingUpDown direction) { return { direction }; }
93
95};
96
102{
103public:
104 using EventMarkingBase::EventMarkingBase;
105
107};
108
114{
115public:
116 using EventMarkingBase::EventMarkingBase;
117};
118
124{
125public:
126 using EventMarkingBase::EventMarkingBase;
127};
128
134{
135public:
136 using EventMarkingBase::EventMarkingBase;
137};
138
144{
145public:
146 using EventMarkingBase::EventMarkingBase;
147};
148
154{
155public:
156 using EventMarkingBase::EventMarkingBase;
157};
158
164{
165public:
166 using EventMarkingBase::EventMarkingBase;
167
170};
171
177{
178public:
179 using EventMarkingBase::EventMarkingBase;
180};
181
187{
188public:
190 struct Required
191 {
192 unsigned marks{};
193 };
194
196 SingleNoteTremolo(const std::shared_ptr<json>& root, json_pointer pointer)
198 {
199 }
200
204 {
205 set_marks(marks);
206 }
207
212 SingleNoteTremolo(Base& parent, std::string_view key, unsigned marks)
214 {
215 set_marks(marks);
216 }
217
219 operator Required() const { return { marks() }; }
220
222 static Required make(unsigned marks) { return { marks }; }
223
224 MNX_REQUIRED_PROPERTY(unsigned, marks);
225};
226
232{
233public:
234 using EventMarkingBase::EventMarkingBase;
235};
236
261
262} // namespace sequence
263} // namespace mnx
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:198
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:260
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:246
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:283
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:415
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:418
Class that represents an accent marking on an event.
Definition EventMarkings.h:47
Class that represents down- or up-bow marking.
Definition EventMarkings.h:57
BowDirection(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing BowDirection objects.
Definition EventMarkings.h:73
BowDirection(MarkingUpDown direction)
Constructor for detatched instance.
Definition EventMarkings.h:67
MNX_REQUIRED_PROPERTY(MarkingUpDown, direction)
whether it is a down bow or up bow
static Required make(MarkingUpDown direction)
Create a Required instance for BowDirection.
Definition EventMarkings.h:92
BowDirection(Base &parent, std::string_view key, MarkingUpDown direction)
Creates a new BowDirection class as a child of a JSON element.
Definition EventMarkings.h:82
Class that represents a spiccato marking on an event.
Definition EventMarkings.h:102
MNX_OPTIONAL_PROPERTY(BreathMarkSymbol, symbol)
The symbol for the breath mark.
Base class for event markings.
Definition EventMarkings.h:35
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(Orientation, orient, Orientation::Auto)
Whether the marking is above or below its associated event.
Container for any markings on an event.
Definition EventMarkings.h:242
MNX_OPTIONAL_CHILD(StrongAccent, strongAccent)
A strong accent mark.
MNX_OPTIONAL_CHILD(Tenuto, tenuto)
A stress mark.
MNX_OPTIONAL_CHILD(Spiccato, spiccato)
A spiccato mark.
MNX_OPTIONAL_CHILD(Accent, accent)
An accent mark.
MNX_OPTIONAL_CHILD(Stress, stress)
A stress mark.
MNX_OPTIONAL_CHILD(SoftAccent, softAccent)
A soft accent mark.
MNX_OPTIONAL_CHILD(Staccatissimo, staccatissimo)
A staccatissimo mark.
MNX_OPTIONAL_CHILD(BowDirection, bowDirection,(MarkingUpDown, direction))
A bow direction mark.
MNX_OPTIONAL_CHILD(Unstress, unstress)
A stress mark.
MNX_OPTIONAL_CHILD(BreathMark, breath)
A breath mark.
MNX_OPTIONAL_CHILD(SingleNoteTremolo, tremolo,(unsigned, marks))
A single-note tremolo mark.
MNX_OPTIONAL_CHILD(Staccato, staccato)
A staccato mark.
Class that represents single-note tremolo marking on an event.
Definition EventMarkings.h:187
static Required make(unsigned marks)
Create a Required instance for SingleNoteTremolo.
Definition EventMarkings.h:222
SingleNoteTremolo(Base &parent, std::string_view key, unsigned marks)
Creates a new SingleNoteTremolo class as a child of a JSON element.
Definition EventMarkings.h:212
MNX_REQUIRED_PROPERTY(unsigned, marks)
the number of marks (a value from 0..8, inclusive)
SingleNoteTremolo(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing SingleNoteTremolo objects.
Definition EventMarkings.h:196
SingleNoteTremolo(unsigned marks)
Constructor for detached instance.
Definition EventMarkings.h:203
Class that represents a soft accent marking on an event.
Definition EventMarkings.h:114
Class that represents a spiccato marking on an event.
Definition EventMarkings.h:124
Class that represents a staccatissimo marking on an event.
Definition EventMarkings.h:134
Class that represents a staccato marking on an event.
Definition EventMarkings.h:144
Class that represents a stress marking on an event.
Definition EventMarkings.h:154
Class that represents a strong accent marking on an event.
Definition EventMarkings.h:164
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(MarkingUpDownAuto, pointing, MarkingUpDownAuto::Auto)
Class that represents a tenuto marking on an event.
Definition EventMarkings.h:177
Class that represents an unstress marking on an event.
Definition EventMarkings.h:232
object model for MNX format
MarkingUpDownAuto
Specifies up or down or auto for a marking symbol.
Definition Enumerations.h:232
@ Auto
determined by consuming property
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
BreathMarkSymbol
The symbols available for a breath mark.
Definition Enumerations.h:82
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
@ Auto
the default value determined by implementation
initializer class for BowDirection
Definition EventMarkings.h:61
MarkingUpDown direction
whether it is a down-bow or up-bow marking
Definition EventMarkings.h:62
initializer class for SingleNoteTremolo
Definition EventMarkings.h:191
unsigned marks
the number of marks
Definition EventMarkings.h:192