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
35{
36public:
37 using Object::Object;
38};
39
45{
46public:
47 using EventMarkingBase::EventMarkingBase;
48
50};
51
57{
58public:
59 using EventMarkingBase::EventMarkingBase;
60
62};
63
69{
70public:
71 using EventMarkingBase::EventMarkingBase;
72};
73
79{
80public:
81 using EventMarkingBase::EventMarkingBase;
82};
83
89{
90public:
91 using EventMarkingBase::EventMarkingBase;
92};
93
99{
100public:
101 using EventMarkingBase::EventMarkingBase;
102};
103
109{
110public:
111 using EventMarkingBase::EventMarkingBase;
112};
113
119{
120public:
121 using EventMarkingBase::EventMarkingBase;
122
124};
125
131{
132public:
133 using EventMarkingBase::EventMarkingBase;
134};
135
141{
142public:
144 struct Required
145 {
146 unsigned marks{};
147 };
148
150 SingleNoteTremolo(const std::shared_ptr<json>& root, json_pointer pointer)
152 {
153 }
154
159 SingleNoteTremolo(Base& parent, std::string_view key, unsigned marks)
161 {
162 set_marks(marks);
163 }
164
166 operator Required() const { return { marks() }; }
167
169 static Required make(unsigned marks) { return { marks }; }
170
171 MNX_REQUIRED_PROPERTY(unsigned, marks);
172};
173
179{
180public:
181 using EventMarkingBase::EventMarkingBase;
182};
183
206
207} // namespace sequence
208} // 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:280
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:412
Object(const std::shared_ptr< json > &root, json_pointer pointer)
Wraps an Object class around an existing JSON object node.
Definition BaseTypes.h:417
Class that represents an accent marking on an event.
Definition EventMarkings.h:45
MNX_OPTIONAL_PROPERTY(MarkingUpDown, pointing)
Specifies if the accent points upward or downward.
Class that represents a spiccato marking on an event.
Definition EventMarkings.h:57
MNX_OPTIONAL_PROPERTY(BreathMarkSymbol, symbol)
The symbol for the breath mark.
Base class for event markings.
Definition EventMarkings.h:35
Container for any markings on an event.
Definition EventMarkings.h:189
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(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:141
static Required make(unsigned marks)
Create a Required instance for SingleNoteTremolo.
Definition EventMarkings.h:169
SingleNoteTremolo(Base &parent, std::string_view key, unsigned marks)
Creates a new SingleNoteTremolo class as a child of a JSON element.
Definition EventMarkings.h:159
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:150
Class that represents a soft accent marking on an event.
Definition EventMarkings.h:69
Class that represents a spiccato marking on an event.
Definition EventMarkings.h:79
Class that represents a staccatissimo marking on an event.
Definition EventMarkings.h:89
Class that represents a staccato marking on an event.
Definition EventMarkings.h:99
Class that represents a stress marking on an event.
Definition EventMarkings.h:109
Class that represents a strong accent marking on an event.
Definition EventMarkings.h:119
MNX_OPTIONAL_PROPERTY(MarkingUpDown, pointing)
Specifies if the accent points upward or downward.
Class that represents a tenuto marking on an event.
Definition EventMarkings.h:131
Class that represents an unstress marking on an event.
Definition EventMarkings.h:179
object model for MNX format
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
The values available in an event marking "pointing" property.
Definition Enumerations.h:171
initializer class for SingleNoteTremolo
Definition EventMarkings.h:145
unsigned marks
the number of marks
Definition EventMarkings.h:146