25#include "ContentArray.h"
30class DynamicGroupArray;
33class DynamicImmediate;
43 std::string_view defaultType()
const override {
return ""; }
58 create_position(position);
79 return value() || attackValue() || !prefix_or({}).
empty() || !suffix_or({}).
empty()
80 || (glyphs() && !glyphs().value().empty());
115 operator Required()
const {
return { value().
value(), position().fraction() }; }
156 set_wedgeType(wedgeType);
162 return { wedgeType(), position().fraction(), end().measure(), end().
position().fraction() };
170 (
const std::string&, measureId), (
const FractionValue&, position));
207 operator Required()
const {
return { value().
value(), position().fraction() }; }
242 set_relativeValue(relativeValue);
246 operator Required()
const {
return { relativeValue(), position().fraction() }; }
262 {
return appendWithType<part::DynamicAccent>(value, position); }
266 {
return appendWithType<part::DynamicGradual>(wedgeType, position, endPosition); }
269 {
return appendWithType<part::DynamicImmediate>(value, position); }
272 {
return appendWithType<part::DynamicRelative>(relativeValue, position); }
Represents an MNX array, encapsulating property access.
Definition BaseTypes.h:531
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
bool empty() const
Returns true if the object is empty.
Definition BaseTypes.h:280
const std::shared_ptr< json > & root() const
Returns the root.
Definition BaseTypes.h:297
Class for content arrays.
Definition ContentArray.h:49
Base class for objects that are elements of content arrays.
Definition BaseTypes.h:742
Represents a system on a page in a score.
Definition CommonClasses.h:550
Represents a system on a page in a score.
Definition CommonClasses.h:489
Immediate dynamics (e.g., ff, ppp)
Definition Dynamics.h:89
static Required make(DynamicValue value, const FractionValue &position)
Create a Required instance for DynamicAccent.
Definition Dynamics.h:118
DynamicAccent(Base &parent, std::string_view key, DynamicValue value, const FractionValue &position)
Creates a new Space class as a child of a JSON element.
Definition Dynamics.h:108
DynamicAccent(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:99
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:120
Gradual dynamics (hairpins)
Definition Dynamics.h:128
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:173
DynamicGradual(Base &parent, std::string_view key, DynamicWedgeType wedgeType, const FractionValue &position, const MeasureRhythmicPosition::Required &endPosition)
Creates a new Space class as a child of a JSON element.
Definition Dynamics.h:151
MNX_REQUIRED_CHILD(MeasureRhythmicPosition, end,(const std::string &, measureId),(const FractionValue &, position))
the end position of the hairpin dynamic; set graceIndex to 0 to include preceding grace notes at the ...
static Required make(DynamicWedgeType wedgeType, const FractionValue &position, const MeasureRhythmicPosition::Required &endPosition)
Create a Required instance for DynamicGradual.
Definition Dynamics.h:166
DynamicGradual(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:140
MNX_REQUIRED_PROPERTY(DynamicWedgeType, wedgeType)
the type of hairpin dynamic
Definition Dynamics.h:257
Base class for dynamics.
Definition Dynamics.h:41
DynamicGroupBase(Base &parent, std::string_view key, const FractionValue &position)
Creates a new Space class as a child of a JSON element.
Definition Dynamics.h:55
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(MultiStaffOrientation, orient, MultiStaffOrientation::Auto)
positioning of the dynamic relative to its part staves
DynamicGroupBase(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:45
MNX_OPTIONAL_PROPERTY(std::string, suffix)
Text following the dynamics representation, e.g., "subito".
MNX_OPTIONAL_PROPERTY(std::string, voice)
Optionally specify the voice this dynamic applies to.
bool calcHasImmediateText() const
Calculates if this dynamic has immediate text. If this value returns false, then it should be a hairp...
Definition Dynamics.h:77
MNX_OPTIONAL_PROPERTY(std::string, prefix)
Text preceding the dynamics representation, e.g., "più".
MNX_OPTIONAL_PROPERTY(DynamicValue, attackValue)
MNX_OPTIONAL_PROPERTY(DynamicValue, value)
The value of the dynamic. Currently the MNX spec allows any string here.
MNX_REQUIRED_CHILD(RhythmicPosition, position,(const FractionValue &, position))
The rhythmic position of the dynamic within the measure.
MNX_OPTIONAL_PROPERTY(int, staff)
The staff (within the part) this dynamic applies to.
MNX_OPTIONAL_CHILD(Array< std::string >, glyphs)
Relative dynamics (e.g., più f)
Definition Dynamics.h:220
DynamicRelative(Base &parent, std::string_view key, DynamicRelativeValue relativeValue, const FractionValue &position)
Creates a new Space class as a child of a JSON element.
Definition Dynamics.h:239
MNX_REQUIRED_PROPERTY(DynamicRelativeValue, relativeValue)
Whether the dynamic is relatively softer or louder.
static Required make(DynamicRelativeValue relativeValue, const FractionValue &position)
Create a Required instance for DynamicRelative.
Definition Dynamics.h:249
DynamicRelative(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:230
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:253
object model for MNX format
DynamicWedgeType
The types of dynamic wedges (hairpins)
Definition Enumerations.h:130
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
DynamicRelativeValue
The possible relative changes in dynamic value.
Definition Enumerations.h:105
MultiStaffOrientation
Specifies the vertical visual orientation of a symbol with respect to its part's staves.
Definition Enumerations.h:278
@ Auto
the default value determined by implementation
Represents a detached arithmetic fraction with normalization.
Definition CommonClasses.h:74
initializer class for MeasureRhythmicPosition
Definition CommonClasses.h:554
std::string measureId
the global measure id of the position
Definition CommonClasses.h:555
FractionValue position
the position within the measure
Definition CommonClasses.h:556
initializer class for DynamicAccent
Definition Dynamics.h:93
FractionValue position
the position within the measure
Definition Dynamics.h:95
DynamicValue value
the value of the dynamic
Definition Dynamics.h:94
initializer class for DynamicGradual
Definition Dynamics.h:132
std::string endMeasureId
the end measure id
Definition Dynamics.h:135
FractionValue endPosition
the end position within the measure
Definition Dynamics.h:136
DynamicWedgeType wedgeType
the type of hairpin dynamic
Definition Dynamics.h:133
FractionValue position
the start position within the measure
Definition Dynamics.h:134
initializer class for DynamicRelative
Definition Dynamics.h:224
DynamicRelativeValue relativeValue
Whether the dynamic is relatively softer or louder.
Definition Dynamics.h:225
FractionValue position
the position within the measure
Definition Dynamics.h:226