25#include "CommonClasses.h"
63 set_start(startMeasure);
64 set_duration(numMeasures);
68 operator Required()
const {
return { start(), duration() }; }
71 static Required make(
const std::string& startMeasure,
int numMeasures) {
return { startMeasure, numMeasures }; }
108 set_layout(layoutId);
109 create_location(measureId, position);
113 operator Required()
const {
return { layout(), location().measure(), location().
position().fraction() }; }
117 {
return { layoutId, measureId, position }; }
121 (
const std::string&, measureId), (
const FractionValue&, position));
150 set_measure(startMeasure);
154 operator Required()
const {
return { measure() }; }
157 static Required make(
const std::string& startMeasure) {
return { startMeasure }; }
171 using ArrayElementObject::ArrayElementObject;
222 static Required make(
const std::string& scoreName) {
return { scoreName }; }
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 a system on a page in a score.
Definition CommonClasses.h:474
Represents an element in the scores section of an MNX document.
Definition Score.h:194
MNX_REQUIRED_PROPERTY(std::string, name)
Required name, such as "Flute 1" or "Full Score".
Score(Base &parent, std::string_view key, const std::string &scoreName)
Creates a new Score class as a child of a JSON element.
Definition Score.h:212
static Required make(const std::string &scoreName)
Create a Required instance for Score.
Definition Score.h:222
MNX_OPTIONAL_CHILD(Array< score::Page >, pages)
An optional list of pages.
MNX_OPTIONAL_PROPERTY(std::string, layout)
Layout id, referring to an element in the root-level layouts array.
MNX_OPTIONAL_CHILD(Array< score::MultimeasureRest >, multimeasureRests)
List of multimeasure rests in the score.
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(bool, useWritten, false)
If this value is true, the score should be displayed transposed.
Score(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing system layouts.
Definition Score.h:203
Represents a system layout change in a score.
Definition Score.h:83
MNX_REQUIRED_PROPERTY(std::string, layout)
Layout id, referring to an element in the root-level layouts array.
LayoutChange(Base &parent, std::string_view key, const std::string &layoutId, const std::string &measureId, const FractionValue &position)
Creates a new LayoutChange class as a child of a JSON element.
Definition Score.h:105
static Required make(const std::string &layoutId, const std::string &measureId, const FractionValue &position)
Create a Required instance for LayoutChange.
Definition Score.h:116
MNX_REQUIRED_CHILD(MeasureRhythmicPosition, location,(const std::string &, measureId),(const FractionValue &, position))
location where the new layout takes effect.
LayoutChange(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing system layouts.
Definition Score.h:94
Represents a multimeasure rest in a score.
Definition Score.h:40
MultimeasureRest(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing mm rests.
Definition Score.h:50
static Required make(const std::string &startMeasure, int numMeasures)
Create a Required instance for MultimeasureRest.
Definition Score.h:71
MNX_REQUIRED_PROPERTY(int, duration)
the number of measures in the multimeasure rest
MNX_OPTIONAL_PROPERTY(std::string, label)
the label to place on the multimeasure rest, if provided.
MultimeasureRest(Base &parent, std::string_view key, const std::string &startMeasure, int numMeasures)
Creates a new MultimeasureRest class as a child of a JSON element.
Definition Score.h:60
MNX_REQUIRED_PROPERTY(std::string, start)
the global measure id of the start measure of the multimeasure rest
Represents a page in a score.
Definition Score.h:169
MNX_OPTIONAL_PROPERTY(std::string, layout)
Layout id, referring to an element in the root-level layouts array.
Page(Base &parent, std::string_view key)
Creates a new Page class as a child of a JSON element.
Definition Score.h:176
MNX_REQUIRED_CHILD(Array< System >, systems)
and array systems on the page.
Represents a system on a page in a score.
Definition Score.h:129
System(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing system layouts.
Definition Score.h:138
MNX_OPTIONAL_PROPERTY(std::string, layout)
Layout id, referring to an element in the root-level layouts array.
MNX_REQUIRED_PROPERTY(std::string, measure)
The global measure if of the first measure in the system.
System(Base &parent, std::string_view key, const std::string &startMeasure)
Creates a new System class as a child of a JSON element.
Definition Score.h:147
MNX_OPTIONAL_CHILD(Array< LayoutChange >, layoutChanges)
layout changes in the system (e.g., for changes in stem direction)
static Required make(const std::string &startMeasure)
Create a Required instance for System.
Definition Score.h:157
object model for MNX format
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:59
initializer class for Score
Definition Score.h:198
std::string scoreName
the name of the score to be created
Definition Score.h:199
initializer class for LayoutChange
Definition Score.h:87
std::string layoutId
the id of the layout to use for the layout change
Definition Score.h:88
FractionValue position
the position of the LayoutChange within the measure
Definition Score.h:90
std::string measureId
the global measure id of the measure of the position
Definition Score.h:89
initializer class for MultimeasureRest
Definition Score.h:44
std::string startMeasure
the measure index of the first measure in the multimeasure rest
Definition Score.h:45
int numMeasures
the number of measures in the multimeasure rest
Definition Score.h:46
initializer class for System
Definition Score.h:133
std::string startMeasure
the measure index of the first measure in the system
Definition Score.h:134