25#include "CommonClasses.h"
55 set_type(barlineType);
81 set_duration(duration);
110 create_location(position);
139 create_location(position);
189 create_location(position);
204 using ArrayElementObject::ArrayElementObject;
232 create_value(noteValue);
247 using ArrayElementObject::ArrayElementObject;
284 using ArrayElementObject::ArrayElementObject;
323 set_selector(selector);
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:631
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:493
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:212
json_pointer pointer() const
Returns the json_pointer for this node.
Definition BaseTypes.h:274
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:260
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:294
Represents an MNX dictionary, where each key is a user-defined string.
Definition BaseTypes.h:785
Represents the global section of an MNX document, containing global measures.
Definition Global.h:337
MNX_OPTIONAL_CHILD(global::LyricsGlobal, lyrics)
lyrics metadata
MNX_OPTIONAL_CHILD(Array< global::StyleGlobal >, styles)
array of styles
Global(Base &parent, std::string_view key)
Creates a new Global class as a child of a JSON element.
Definition Global.h:344
MNX_REQUIRED_CHILD(Array< global::Measure >, measures)
array of global measures.
MNX_OPTIONAL_CHILD(Dictionary< global::Sound >, sounds)
dictionary of sounds with user-defined keys
Represents a key signature.
Definition CommonClasses.h:503
initializer class for NoteValue
Definition CommonClasses.h:534
Represents a symbolic note value (not necessarily a duration)
Definition CommonClasses.h:530
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:426
Object(const std::shared_ptr< json > &root, json_pointer pointer)
Wraps an Object class around an existing JSON object node.
Definition BaseTypes.h:431
Represents a system on a page in a score.
Definition CommonClasses.h:417
Represents the tempo for a global measure.
Definition CommonClasses.h:611
Represents the barline for a global measure.
Definition Global.h:40
Barline(Base &parent, std::string_view key, BarlineType barlineType)
Creates a new Barline class as a child of a JSON element.
Definition Global.h:52
MNX_REQUIRED_PROPERTY(BarlineType, type)
the type of barline
Barline(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Barline objects.
Definition Global.h:43
Represents an alternate ending (or "volta bracket") for a global measure.
Definition Global.h:66
MNX_REQUIRED_PROPERTY(int, duration)
the type of barline
MNX_OPTIONAL_CHILD(Array< int >, numbers)
ending numbers
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the ending
Ending(Base &parent, std::string_view key, int duration)
Creates a new Ending class as a child of a JSON element.
Definition Global.h:78
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, open, false)
if this is an open (i.e., final) ending
Ending(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Ending objects.
Definition Global.h:69
Represents an Fine object (as in "D.S. al Fine")
Definition Global.h:95
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the fine direction
Fine(Base &parent, std::string_view key, const FractionValue &position)
Creates a new Fine class as a child of a JSON element.
Definition Global.h:107
Fine(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Fine objects.
Definition Global.h:98
MNX_REQUIRED_CHILD(RhythmicPosition, location)
the location of the fine direction
Represents an Jump object (as in "D.S.")
Definition Global.h:122
Jump(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Jump objects.
Definition Global.h:125
Jump(Base &parent, std::string_view key, JumpType jumpType, const FractionValue &position)
Creates a new Jump class as a child of a JSON element.
Definition Global.h:135
MNX_REQUIRED_CHILD(RhythmicPosition, location)
the location of the jump
MNX_REQUIRED_PROPERTY(JumpType, type)
the JumpType
Metadata for lyrics in this MNX document.
Definition Global.h:295
MNX_OPTIONAL_CHILD(Array< std::string >, lineOrder)
Lyric line IDs used in the document (e.g. verse numbers)
MNX_OPTIONAL_CHILD(Dictionary< LyricLineMetadata >, lineMetadata)
Defines lyric line IDs and their metadata.
Represents a single global measure instance within an MNX document.
Definition Global.h:245
MNX_OPTIONAL_CHILD(Segno, segno)
if present, indicates that a segno marker is here
MNX_OPTIONAL_CHILD(Array< Tempo >, tempos)
the tempo changes within the measure, if any
std::optional< TimeSignature > calcCurrentTime() const
Calculates the current time signature by searching backwards.
Definition Implementations.cpp:286
MNX_OPTIONAL_PROPERTY(int, index)
the measure index which is used to refer to this measure by other classes in the MNX document
MNX_OPTIONAL_CHILD(Barline, barline)
optional barline for this measure
MNX_OPTIONAL_CHILD(RepeatStart, repeatStart)
if present, indicates that a repeated section starts here
MNX_OPTIONAL_PROPERTY(int, number)
visible measure number. Use calcMeasureIndex to get the default value.
MNX_OPTIONAL_CHILD(Jump, jump)
optional jump direction for this measure
MNX_OPTIONAL_CHILD(Ending, ending)
optional ending ("volta bracket") for this measure
MNX_OPTIONAL_CHILD(KeySignature, key)
optional key signature/key change for this measure
BarlineType calcBarlineType() const
Calculates the barline type for this measure.
Definition Implementations.cpp:263
int calcMeasureIndex() const
Calculates the measure index for this measure.
Definition Implementations.cpp:273
MNX_OPTIONAL_CHILD(Fine, fine)
optional fine direction for this measure
MNX_OPTIONAL_CHILD(RepeatEnd, repeatEnd)
if present, indicates that there is backwards repeat
static constexpr std::string_view JsonSchemaTypeName
required for mapping
Definition Global.h:274
MNX_OPTIONAL_CHILD(TimeSignature, time)
if present, indicates a meter change
Represents the end of a repeat in an MNX document.
Definition Global.h:151
MNX_OPTIONAL_PROPERTY(int, times)
number of times to repeat
Represents the start of a repeat in an MNX document.
Definition Global.h:163
Represents a segno marker.
Definition Global.h:174
Segno(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Segno objects.
Definition Global.h:177
MNX_OPTIONAL_PROPERTY(std::string, glyph)
the SMuFL glyph name to be used when rendering this segno.
Segno(Base &parent, std::string_view key, const FractionValue &position)
Creates a new Segno class as a child of a JSON element.
Definition Global.h:186
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the ending
MNX_REQUIRED_CHILD(RhythmicPosition, location)
location
Represents a sound definition.
Definition Global.h:202
MNX_OPTIONAL_PROPERTY(unsigned, midiNumber)
MIDI pitch of the sound from 0-127, where middle C is 60.
MNX_OPTIONAL_PROPERTY(std::string, name)
The name of the sound (presentable to the user)
Visual styling selectors for this MNX document.
Definition Global.h:308
StyleGlobal(Base &parent, std::string_view key, const std::string &selector)
Creates a new Jump class as a child of a JSON element.
Definition Global.h:320
MNX_OPTIONAL_PROPERTY(std::string, color)
the JumpType
MNX_REQUIRED_PROPERTY(std::string, selector)
the location of the jump
StyleGlobal(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing StyleGlobal objects.
Definition Global.h:311
Represents the tempo for a global measure.
Definition Global.h:215
MNX_REQUIRED_CHILD(NoteValue, value)
the note value for the tempo.
MNX_REQUIRED_PROPERTY(int, bpm)
the beats per minute of this tempo marking
Tempo(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Tempo instances.
Definition Global.h:218
MNX_OPTIONAL_CHILD(RhythmicPosition, location)
location within the measure of the tempo marking
Tempo(Base &parent, std::string_view key, int bpm, const NoteValue::Initializer ¬eValue)
Creates a new Tempo class as a child of a JSON element.
Definition Global.h:228
object model for MNX format
JumpType
The types of jumps.
Definition Enumerations.h:116
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:198
BarlineType
The types of barlines supported.
Definition Enumerations.h:52
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:59