25#include "CommonClasses.h"
61 set_type(barlineType);
65 operator Required()
const {
return { type() }; }
99 set_duration(duration);
103 operator Required()
const {
return { duration() }; }
140 create_location(position);
144 operator Required()
const {
return { location().fraction() }; }
183 create_location(position);
187 operator Required()
const {
return { type(), location().fraction() }; }
246 create_location(position);
250 operator Required()
const {
return { location().fraction() }; }
268 using ArrayElementObject::ArrayElementObject;
303 create_value(noteValue.
base, noteValue.
dots);
307 operator Required()
const {
return { bpm(), value() }; }
326 using ArrayElementObject::ArrayElementObject;
378 using ArrayElementObject::ArrayElementObject;
Represents an MNX object that is included as an array element.
Definition BaseTypes.h:664
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:499
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 dictionary, where each key is a user-defined string.
Definition BaseTypes.h:856
Represents the global section of an MNX document, containing global measures.
Definition Global.h:404
MNX_OPTIONAL_CHILD(global::LyricsGlobal, lyrics)
lyrics metadata
Global(Base &parent, std::string_view key)
Creates a new Global class as a child of a JSON element.
Definition Global.h:411
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:560
Represents a symbolic note value (not necessarily a duration)
Definition CommonClasses.h:599
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
Represents a system on a page in a score.
Definition CommonClasses.h:432
Represents the tempo for a global measure.
Definition CommonClasses.h:696
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:58
MNX_REQUIRED_PROPERTY(BarlineType, type)
the type of barline
static Required make(BarlineType barlineType)
Create a Required instance for Barline.
Definition Global.h:68
Barline(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Barline objects.
Definition Global.h:49
Represents an alternate ending (or "volta bracket") for a global measure.
Definition Global.h:78
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:96
static Required make(int duration)
Create a Required instance for Ending.
Definition Global.h:106
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:87
Represents an Fine object (as in "D.S. al Fine")
Definition Global.h:119
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:137
static Required make(const FractionValue &position)
Create a Required instance for Fine.
Definition Global.h:147
MNX_REQUIRED_CHILD(RhythmicPosition, location,(const FractionValue &, position))
the location of the fine direction
Fine(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Fine objects.
Definition Global.h:128
Represents an Jump object (as in "D.S.")
Definition Global.h:159
static Required make(JumpType jumpType, const FractionValue &position)
Create a Required instance for Jump.
Definition Global.h:190
Jump(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Jump objects.
Definition Global.h:169
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:179
MNX_REQUIRED_PROPERTY(JumpType, type)
the JumpType
MNX_REQUIRED_CHILD(RhythmicPosition, location,(const FractionValue &, position))
the location of the jump
Metadata for lyrics in this MNX document.
Definition Global.h:389
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:324
MNX_OPTIONAL_CHILD(Array< Tempo >, tempos)
the tempo changes within the measure, if any
MNX_OPTIONAL_CHILD(KeySignature, key,(int, fifths))
optional key signature/key change for this measure
std::optional< TimeSignature > calcCurrentTime() const
Calculates the current time signature by searching backwards.
Definition Implementations.cpp:555
MNX_OPTIONAL_CHILD(Segno, segno,(const FractionValue &, position))
if present, indicates that a segno marker is here
KeySignature::Required calcCurrentKeyFields() const
Get the fields of the current key signature.
Definition Implementations.cpp:583
MNX_OPTIONAL_CHILD(RepeatStart, repeatStart)
if present, indicates that a repeated section starts here
int calcVisibleNumber() const
Calculates the visible measure number for this measure.
Definition Implementations.cpp:550
MNX_OPTIONAL_CHILD(Fine, fine,(const FractionValue &, position))
optional fine direction for this measure
MNX_OPTIONAL_PROPERTY(int, number)
MNX_OPTIONAL_CHILD(Barline, barline,(BarlineType, barlineType))
optional barline for this measure
MNX_OPTIONAL_CHILD(TimeSignature, time,(int, count),(TimeSignatureUnit, unit))
if present, indicates a meter change
std::optional< KeySignature > calcCurrentKey() const
Calculates the current key signature by searching backwards.
Definition Implementations.cpp:569
BarlineType calcBarlineType() const
Calculates the barline type for this measure.
Definition Implementations.cpp:540
MNX_OPTIONAL_CHILD(Jump, jump,(JumpType, jumpType),(const FractionValue &, position))
optional jump 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:368
MNX_OPTIONAL_CHILD(Ending, ending,(int, duration))
optional ending ("volta bracket") for this measure
Represents the end of a repeat in an MNX document.
Definition Global.h:202
MNX_OPTIONAL_PROPERTY(int, times)
number of times to repeat
Represents the start of a repeat in an MNX document.
Definition Global.h:214
Represents a segno marker.
Definition Global.h:225
Segno(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Segno objects.
Definition Global.h:234
static Required make(const FractionValue &position)
Create a Required instance for Segno.
Definition Global.h:253
MNX_REQUIRED_CHILD(RhythmicPosition, location,(const FractionValue &, position))
location
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:243
MNX_OPTIONAL_PROPERTY(std::string, color)
color to use when rendering the ending
Represents a sound definition.
Definition Global.h:266
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)
Represents the tempo for a global measure.
Definition Global.h:279
MNX_REQUIRED_CHILD(NoteValue, value,(NoteValueBase, base),(unsigned, dots))
the note value for the tempo.
static Required make(int bpm, const NoteValue::Required ¬eValue)
Create a Required instance for Tempo.
Definition Global.h:310
MNX_OPTIONAL_CHILD(RhythmicPosition, location,(const FractionValue &, position))
location within the measure of the tempo marking
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:289
Tempo(Base &parent, std::string_view key, int bpm, const NoteValue::Required ¬eValue)
Creates a new Tempo class as a child of a JSON element.
Definition Global.h:299
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:68
TimeSignatureUnit
Valid units for the lower numbers of time signatures.
Definition Enumerations.h:317
BarlineType
The types of barlines supported.
Definition Enumerations.h:52
NoteValueBase
The note values allowed in MNX.
Definition Enumerations.h:198
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:59
initializer class for KeySignature
Definition CommonClasses.h:564
initializer class for NoteValue
Definition CommonClasses.h:603
NoteValueBase base
the note value base to initialize
Definition CommonClasses.h:604
unsigned dots
the number of dots to initialize
Definition CommonClasses.h:605
initializer class for Barline
Definition Global.h:44
BarlineType barlineType
the barline type for this Barline
Definition Global.h:45
initializer class for Ending
Definition Global.h:82
int duration
the duration of the ending
Definition Global.h:83
initializer class for Fine
Definition Global.h:123
FractionValue position
the position of the Fine within the measure
Definition Global.h:124
initializer class for Jump
Definition Global.h:163
FractionValue position
the position within the measure
Definition Global.h:165
JumpType jumpType
the jump type
Definition Global.h:164
initializer class for Segno
Definition Global.h:229
FractionValue position
the position of the Segno within the measure
Definition Global.h:230
initializer class for Tempo
Definition Global.h:283
int bpm
the beats per minute
Definition Global.h:284
NoteValue::Required noteValue
the note value for the tempo
Definition Global.h:285