25#include "ContentArray.h"
30class DynamicGroupArray;
33class DynamicImmediate;
43 std::string_view defaultType()
const override {
return ""; }
58 create_position(position);
78 return value() || !prefix_or({}).
empty() || !suffix_or({}).
empty()
79 || (glyphs() && !glyphs().value().empty());
114 operator Required()
const {
return { value().
value(), position().fraction() }; }
169 set_wedgeType(wedgeType);
175 return { wedgeType(), position().fraction(), end().measure(), end().
position().fraction() };
183 (
const std::string&, measureId), (
const FractionValue&, position));
221 operator Required()
const {
return { value().
value(), position().fraction() }; }
256 set_relativeValue(relativeValue);
260 operator Required()
const {
return { relativeValue(), position().fraction() }; }
276 {
return appendWithType<part::DynamicAccent>(value, position); }
280 {
return appendWithType<part::DynamicGradual>(wedgeType, position, endPosition); }
283 {
return appendWithType<part::DynamicImmediate>(value, position); }
286 {
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:88
static Required make(DynamicValue value, const FractionValue &position)
Create a Required instance for DynamicAccent.
Definition Dynamics.h:117
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:107
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(DynamicSuffix, accentSuffix, DynamicSuffix::z)
defines suffix ("z" or "");
DynamicAccent(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:98
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:133
MNX_OPTIONAL_PROPERTY_WITH_DEFAULT(DynamicPrefix, accentPrefix, DynamicPrefix::s)
defines prefix ("r", "s", or "");
MNX_OPTIONAL_PROPERTY(DynamicValue, residualValue)
bool calcHasImmediateText() const override
Calculates if this dynamic has immediate text. If this value returns false, then it should be a hairp...
Definition Dynamics.h:125
Gradual dynamics (hairpins)
Definition Dynamics.h:141
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:187
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:164
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:179
DynamicGradual(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:153
MNX_REQUIRED_PROPERTY(DynamicWedgeType, wedgeType)
the type of hairpin dynamic
MNX_OPTIONAL_PROPERTY(int, staffEnd)
the staff (within the part) on which the hairpin ends
Definition Dynamics.h:271
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.
MNX_OPTIONAL_PROPERTY(std::string, prefix)
Text preceding the dynamics representation, e.g., "più".
MNX_OPTIONAL_PROPERTY(DynamicValue, value)
The value of the dynamic.
MNX_REQUIRED_CHILD(RhythmicPosition, position,(const FractionValue &, position))
The rhythmic position of the dynamic within the measure.
MNX_OPTIONAL_PROPERTY(std::string, visuallyContinues)
Points to the ID of the directly previous dynamic group.
MNX_OPTIONAL_PROPERTY(int, staff)
The staff (within the part) this dynamic applies to.
MNX_OPTIONAL_CHILD(Array< std::string >, glyphs)
virtual bool calcHasImmediateText() const
Calculates if this dynamic has immediate text. If this value returns false, then it should be a hairp...
Definition Dynamics.h:76
Relative dynamics (e.g., più f)
Definition Dynamics.h:234
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:253
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:263
DynamicRelative(const std::shared_ptr< json > &root, json_pointer pointer)
Constructor for existing Space objects.
Definition Dynamics.h:244
static constexpr std::string_view ContentTypeValue
type value that identifies the type of dynamic
Definition Dynamics.h:267
object model for MNX format
DynamicWedgeType
The types of dynamic wedges (hairpins)
Definition Enumerations.h:153
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:68
DynamicPrefix
Definition Enumerations.h:105
@ s
"s-" as in sforzando (sf)
DynamicSuffix
Definition Enumerations.h:122
@ z
"-zato" as in forzato (fz)
DynamicRelativeValue
The possible relative changes in dynamic value.
Definition Enumerations.h:114
MultiStaffOrientation
Specifies the vertical visual orientation of a symbol with respect to its part's staves.
Definition Enumerations.h:301
@ 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:92
FractionValue position
the position within the measure
Definition Dynamics.h:94
DynamicValue value
the value of the dynamic
Definition Dynamics.h:93
initializer class for DynamicGradual
Definition Dynamics.h:145
std::string endMeasureId
the end measure id
Definition Dynamics.h:148
FractionValue endPosition
the end position within the measure
Definition Dynamics.h:149
DynamicWedgeType wedgeType
the type of hairpin dynamic
Definition Dynamics.h:146
FractionValue position
the start position within the measure
Definition Dynamics.h:147
initializer class for DynamicRelative
Definition Dynamics.h:238
DynamicRelativeValue relativeValue
Whether the dynamic is relatively softer or louder.
Definition Dynamics.h:239
FractionValue position
the position within the measure
Definition Dynamics.h:240