diff --git a/src/engraving/libmscore/gradualtempochange.cpp b/src/engraving/libmscore/gradualtempochange.cpp index 5416eb6b4c6c2..b3b6bebb55f2a 100644 --- a/src/engraving/libmscore/gradualtempochange.cpp +++ b/src/engraving/libmscore/gradualtempochange.cpp @@ -33,41 +33,41 @@ using namespace mu; using namespace mu::engraving; static const ElementStyle tempoStyle { - { Sid::tempoSystemFlag, Pid::SYSTEM_FLAG }, - { Sid::tempoPlacement, Pid::PLACEMENT }, - { Sid::tempoMinDistance, Pid::MIN_DISTANCE }, - { Sid::tempoLineSpacing, Pid::TEXT_LINE_SPACING }, + { Sid::tempoChangeSystemFlag, Pid::SYSTEM_FLAG }, + { Sid::tempoChangePlacement, Pid::PLACEMENT }, + { Sid::tempoChangeMinDistance, Pid::MIN_DISTANCE }, + { Sid::tempoChangeLineSpacing, Pid::TEXT_LINE_SPACING }, - { Sid::tempoColor, Pid::COLOR }, - { Sid::tempoPosAbove, Pid::OFFSET }, + { Sid::tempoChangeColor, Pid::COLOR }, + { Sid::tempoChangePosAbove, Pid::OFFSET }, - { Sid::tempoFontFace, Pid::BEGIN_FONT_FACE }, - { Sid::tempoFontFace, Pid::CONTINUE_FONT_FACE }, - { Sid::tempoFontFace, Pid::END_FONT_FACE }, + { Sid::tempoChangeFontFace, Pid::BEGIN_FONT_FACE }, + { Sid::tempoChangeFontFace, Pid::CONTINUE_FONT_FACE }, + { Sid::tempoChangeFontFace, Pid::END_FONT_FACE }, - { Sid::tempoFontSize, Pid::BEGIN_FONT_SIZE }, - { Sid::tempoFontSize, Pid::CONTINUE_FONT_SIZE }, - { Sid::tempoFontSize, Pid::END_FONT_SIZE }, + { Sid::tempoChangeFontSize, Pid::BEGIN_FONT_SIZE }, + { Sid::tempoChangeFontSize, Pid::CONTINUE_FONT_SIZE }, + { Sid::tempoChangeFontSize, Pid::END_FONT_SIZE }, - { Sid::tempoFontStyle, Pid::BEGIN_FONT_STYLE }, - { Sid::tempoFontStyle, Pid::CONTINUE_FONT_STYLE }, - { Sid::tempoFontStyle, Pid::END_FONT_STYLE }, + { Sid::tempoChangeFontStyle, Pid::BEGIN_FONT_STYLE }, + { Sid::tempoChangeFontStyle, Pid::CONTINUE_FONT_STYLE }, + { Sid::tempoChangeFontStyle, Pid::END_FONT_STYLE }, - { Sid::tempoAlign, Pid::BEGIN_TEXT_ALIGN }, - { Sid::tempoAlign, Pid::CONTINUE_TEXT_ALIGN }, - { Sid::tempoAlign, Pid::END_TEXT_ALIGN }, + { Sid::tempoChangeAlign, Pid::BEGIN_TEXT_ALIGN }, + { Sid::tempoChangeAlign, Pid::CONTINUE_TEXT_ALIGN }, + { Sid::tempoChangeAlign, Pid::END_TEXT_ALIGN }, - { Sid::tempoFontSpatiumDependent, Pid::SIZE_SPATIUM_DEPENDENT }, + { Sid::tempoChangeFontSpatiumDependent, Pid::SIZE_SPATIUM_DEPENDENT }, { Sid::tempoChangeLineWidth, Pid::LINE_WIDTH }, { Sid::tempoChangeLineStyle, Pid::LINE_STYLE }, { Sid::tempoChangeDashLineLen, Pid::DASH_LINE_LEN }, { Sid::tempoChangeDashGapLen, Pid::DASH_GAP_LEN }, - { Sid::tempoFontSpatiumDependent, Pid::TEXT_SIZE_SPATIUM_DEPENDENT }, + { Sid::tempoChangeFontSpatiumDependent, Pid::TEXT_SIZE_SPATIUM_DEPENDENT }, }; static const ElementStyle tempoSegmentStyle { - { Sid::tempoPosAbove, Pid::OFFSET }, - { Sid::tempoMinDistance, Pid::MIN_DISTANCE } + { Sid::tempoChangePosAbove, Pid::OFFSET }, + { Sid::tempoChangeMinDistance, Pid::MIN_DISTANCE } }; static const std::unordered_map DEFAULT_FACTORS_MAP { @@ -215,7 +215,7 @@ PropertyValue GradualTempoChange::propertyDefault(Pid propertyId) const { switch (propertyId) { case Pid::ALIGN: - return score()->styleV(Sid::tempoAlign); + return score()->styleV(Sid::tempoChangeAlign); case Pid::LINE_WIDTH: return score()->styleV(Sid::tempoChangeLineWidth); @@ -229,7 +229,7 @@ PropertyValue GradualTempoChange::propertyDefault(Pid propertyId) const return PropertyValue::fromValue(PointF(0, 0)); case Pid::BEGIN_FONT_STYLE: - return score()->styleV(Sid::tempoFontStyle); + return score()->styleV(Sid::tempoChangeFontStyle); case Pid::BEGIN_TEXT: case Pid::CONTINUE_TEXT: @@ -260,30 +260,30 @@ Sid GradualTempoChange::getPropertyStyle(Pid id) const { switch (id) { case Pid::PLACEMENT: - return Sid::tempoPlacement; + return Sid::tempoChangePlacement; case Pid::BEGIN_FONT_FACE: case Pid::CONTINUE_FONT_FACE: case Pid::END_FONT_FACE: - return Sid::tempoFontFace; + return Sid::tempoChangeFontFace; case Pid::BEGIN_FONT_SIZE: case Pid::CONTINUE_FONT_SIZE: case Pid::END_FONT_SIZE: - return Sid::tempoFontSize; + return Sid::tempoChangeFontSize; case Pid::BEGIN_FONT_STYLE: case Pid::CONTINUE_FONT_STYLE: case Pid::END_FONT_STYLE: - return Sid::tempoFontStyle; + return Sid::tempoChangeFontStyle; case Pid::BEGIN_TEXT_ALIGN: case Pid::CONTINUE_TEXT_ALIGN: case Pid::END_TEXT_ALIGN: - return Sid::tempoAlign; + return Sid::tempoChangeAlign; case Pid::BEGIN_TEXT: return Sid::letRingText; case Pid::OFFSET: if (placeAbove()) { - return Sid::tempoPosAbove; + return Sid::tempoChangePosAbove; } else { - return Sid::tempoPosBelow; + return Sid::tempoChangePosBelow; } default: break; diff --git a/src/engraving/style/styledef.cpp b/src/engraving/style/styledef.cpp index 5fcd862eaad9b..6ab971afb8ddd 100644 --- a/src/engraving/style/styledef.cpp +++ b/src/engraving/style/styledef.cpp @@ -890,12 +890,31 @@ const std::array StyleDef::styleValue { Sid::tempoFramePadding, "tempoFramePadding", 0.2 }, { Sid::tempoFrameWidth, "tempoFrameWidth", 0.1 }, { Sid::tempoFrameRound, "tempoFrameRound", 0 }, - { Sid::tempoFrameFgColor, "tempoFrameFgColor", PropertyValue::fromValue(Color::BLACK) }, - { Sid::tempoFrameBgColor, "tempoFrameBgColor", PropertyValue::fromValue(Color::transparent) }, - { Sid::tempoChangeLineWidth, "tempoChangeLineWidth", Spatium(0.15) }, - { Sid::tempoChangeLineStyle, "tempoChangeLineStyle", PropertyValue(LineType::DASHED) }, - { Sid::tempoChangeDashLineLen, "tempoChangeDashLineLen", 6.0 }, - { Sid::tempoChangeDashGapLen, "tempoChangeDashGapLen", 9.0 }, + { Sid::tempoFrameFgColor, "tempoFrameFgColor", PropertyValue::fromValue(draw::Color::BLACK) }, + { Sid::tempoFrameBgColor, "tempoFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) }, + + { Sid::tempoChangeFontFace, "tempoChangeFontFace", "Edwin" }, + { Sid::tempoChangeFontSize, "tempoChangeFontSize", 12.0 }, + { Sid::tempoChangeLineSpacing, "tempoChangeLineSpacing", 1.0 }, + { Sid::tempoChangeFontSpatiumDependent, "tempoChangeFontSpatiumDependent", true }, + { Sid::tempoChangeFontStyle, "tempoChangeFontStyle", int(FontStyle::Bold) }, + { Sid::tempoChangeColor, "tempoChangeColor", PropertyValue::fromValue(draw::Color::BLACK) }, + { Sid::tempoChangeAlign, "tempoChangeAlign", Align(AlignH::LEFT, AlignV::BASELINE) }, + { Sid::tempoChangeSystemFlag, "tempoChangeSystemFlag", true }, + { Sid::tempoChangePlacement, "tempoChangePlacement", PlacementV::ABOVE }, + { Sid::tempoChangePosAbove, "tempoChangePosAbove", PointF(.0, -2.0) }, + { Sid::tempoChangePosBelow, "tempoChangePosBelow", PointF(.0, 3.0) }, + { Sid::tempoChangeMinDistance, "tempoChangeMinDistance", Spatium(.5) }, + { Sid::tempoChangeFrameType, "tempoChangeFrameType", int(FrameType::NO_FRAME) }, + { Sid::tempoChangeFramePadding, "tempoChangeFramePadding", 0.2 }, + { Sid::tempoChangeFrameWidth, "tempoChangeFrameWidth", 0.1 }, + { Sid::tempoChangeFrameRound, "tempoChangeFrameRound", 0 }, + { Sid::tempoChangeFrameFgColor, "tempoChangeFrameFgColor", PropertyValue::fromValue(draw::Color::BLACK) }, + { Sid::tempoChangeFrameBgColor, "tempoChangeFrameBgColor", PropertyValue::fromValue(draw::Color::transparent) }, + { Sid::tempoChangeLineWidth, "tempoChangeLineWidth", Spatium(0.15) }, + { Sid::tempoChangeLineStyle, "tempoChangeLineStyle", PropertyValue(LineType::DASHED) }, + { Sid::tempoChangeDashLineLen, "tempoChangeDashLineLen", 6.0 }, + { Sid::tempoChangeDashGapLen, "tempoChangeDashGapLen", 9.0 }, { Sid::metronomeFontFace, "metronomeFontFace", "Edwin" }, { Sid::metronomeFontSize, "metronomeFontSize", 12.0 }, diff --git a/src/engraving/style/styledef.h b/src/engraving/style/styledef.h index 8d7479c37c07e..c31743e361c45 100644 --- a/src/engraving/style/styledef.h +++ b/src/engraving/style/styledef.h @@ -905,6 +905,25 @@ enum class Sid { tempoFrameRound, tempoFrameFgColor, tempoFrameBgColor, + + tempoChangeFontFace, + tempoChangeFontSize, + tempoChangeLineSpacing, + tempoChangeFontSpatiumDependent, + tempoChangeFontStyle, + tempoChangeColor, + tempoChangeAlign, + tempoChangeSystemFlag, + tempoChangePlacement, + tempoChangePosAbove, + tempoChangePosBelow, + tempoChangeMinDistance, + tempoChangeFrameType, + tempoChangeFramePadding, + tempoChangeFrameWidth, + tempoChangeFrameRound, + tempoChangeFrameFgColor, + tempoChangeFrameBgColor, tempoChangeLineWidth, tempoChangeLineStyle, tempoChangeDashLineLen, diff --git a/src/engraving/style/textstyle.cpp b/src/engraving/style/textstyle.cpp index 1236e858086fa..a574ec3d07206 100644 --- a/src/engraving/style/textstyle.cpp +++ b/src/engraving/style/textstyle.cpp @@ -316,6 +316,23 @@ const TextStyle tempoTextStyle { { { TextStylePropertyType::FrameFillColor, Sid::tempoFrameBgColor, Pid::FRAME_BG_COLOR }, } }; +const TextStyle tempoChangeTextStyle { { + { TextStylePropertyType::FontFace, Sid::tempoChangeFontFace, Pid::FONT_FACE }, + { TextStylePropertyType::FontSize, Sid::tempoChangeFontSize, Pid::FONT_SIZE }, + { TextStylePropertyType::LineSpacing, Sid::tempoChangeLineSpacing, Pid::TEXT_LINE_SPACING }, + { TextStylePropertyType::SizeSpatiumDependent, Sid::tempoChangeFontSpatiumDependent, Pid::SIZE_SPATIUM_DEPENDENT }, + { TextStylePropertyType::FontStyle, Sid::tempoChangeFontStyle, Pid::FONT_STYLE }, + { TextStylePropertyType::Color, Sid::tempoChangeColor, Pid::COLOR }, + { TextStylePropertyType::TextAlign, Sid::tempoChangeAlign, Pid::ALIGN }, + { TextStylePropertyType::Offset, Sid::tempoChangePosAbove, Pid::OFFSET }, + { TextStylePropertyType::FrameType, Sid::tempoChangeFrameType, Pid::FRAME_TYPE }, + { TextStylePropertyType::FramePadding, Sid::tempoChangeFramePadding, Pid::FRAME_PADDING }, + { TextStylePropertyType::FrameWidth, Sid::tempoChangeFrameWidth, Pid::FRAME_WIDTH }, + { TextStylePropertyType::FrameRound, Sid::tempoChangeFrameRound, Pid::FRAME_ROUND }, + { TextStylePropertyType::FrameBorderColor, Sid::tempoChangeFrameFgColor, Pid::FRAME_FG_COLOR }, + { TextStylePropertyType::FrameFillColor, Sid::tempoChangeFrameBgColor, Pid::FRAME_BG_COLOR }, +} }; + const TextStyle metronomeTextStyle { { { TextStylePropertyType::FontFace, Sid::metronomeFontFace, Pid::FONT_FACE }, { TextStylePropertyType::FontSize, Sid::metronomeFontSize, Pid::FONT_SIZE }, @@ -1017,6 +1034,7 @@ const TextStyle* textStyle(TextStyleType idx) case TextStyleType::MMREST_RANGE: return &mmRestRangeTextStyle; case TextStyleType::TEMPO: return &tempoTextStyle; + case TextStyleType::TEMPO_CHANGE: return &tempoChangeTextStyle; case TextStyleType::METRONOME: return &metronomeTextStyle; case TextStyleType::REPEAT_LEFT: return &repeatLeftTextStyle; case TextStyleType::REPEAT_RIGHT: return &repeatRightTextStyle; diff --git a/src/engraving/types/types.h b/src/engraving/types/types.h index e124360863393..e9e3814cdd02b 100644 --- a/src/engraving/types/types.h +++ b/src/engraving/types/types.h @@ -627,6 +627,7 @@ enum class TextStyleType { // System-level styles TEMPO, + TEMPO_CHANGE, METRONOME, REPEAT_LEFT, // align to start of measure REPEAT_RIGHT, // align to end of measure diff --git a/src/engraving/types/typesconv.cpp b/src/engraving/types/typesconv.cpp index 2fc06c36c87d9..266714e264201 100644 --- a/src/engraving/types/typesconv.cpp +++ b/src/engraving/types/typesconv.cpp @@ -940,6 +940,7 @@ static const std::vector > TEXTSTYLE_TYPES = { { TextStyleType::MMREST_RANGE, "mmrest_range", TranslatableString("engraving", "Multimeasure rest range") }, { TextStyleType::TEMPO, "tempo", TranslatableString("engraving", "Tempo") }, + { TextStyleType::TEMPO_CHANGE, "tempo change", TranslatableString("engraving", "Gradual tempo change") }, { TextStyleType::METRONOME, "metronome", TranslatableString("engraving", "Metronome") }, { TextStyleType::REPEAT_LEFT, "repeat_left", TranslatableString("engraving", "Repeat text left") }, { TextStyleType::REPEAT_RIGHT, "repeat_right", TranslatableString("engraving", "Repeat text right") }, diff --git a/src/importexport/musicxml/tests/data/testMeasureStyleSlash_ref.mscx b/src/importexport/musicxml/tests/data/testMeasureStyleSlash_ref.mscx index ce1c31e36eb5f..6f8514dc06a94 100644 --- a/src/importexport/musicxml/tests/data/testMeasureStyleSlash_ref.mscx +++ b/src/importexport/musicxml/tests/data/testMeasureStyleSlash_ref.mscx @@ -15,6 +15,7 @@ 10 10 10 + 10 10 10 10