Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ option(MUE_COMPILE_USE_SYSTEM_HARFBUZZ "Try use system harfbuzz" OFF)
option(MUE_COMPILE_USE_SYSTEM_OPUS "Try use system opus" OFF)
option(MUE_COMPILE_USE_SYSTEM_OPUSENC "Try use system libopusenc" OFF)
option(MUE_COMPILE_USE_SYSTEM_MNXDOM "Try use system mnxdom" OFF)
option(MUE_COMPILE_USE_SYSTEM_PUGIXML "Try use system pugixml" OFF)

# === Debug ===
option(MUE_ENABLE_LOAD_QML_FROM_SOURCE "Load qml files from source (not resource)" OFF)
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/rendering/score/headerfooterlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ TextBlock HeaderFooterLayout::replaceTextMacros(const LayoutContext& ctx, const
}
[[fallthrough]];
case 'N': // on page 1 only if there are multiple pages
if ((page->score()->npages() + page->score()->pageNumberOffset()) <= 1) {
if ((static_cast<int>(page->score()->npages()) + page->score()->pageNumberOffset()) <= 1) {
break;
}
[[fallthrough]];
case 'P': // on all pages
{
size_t no = page->pageNumber() + 1 + page->score()->pageNumberOffset();
const int no = static_cast<int>(page->pageNumber()) + 1 + page->score()->pageNumberOffset();
if (no > 0) {
const String pageNumberString = String::number(no);
const CharFormat pageNumberFormat = formatForMacro(ctx, String('$' + nc));
Expand All @@ -283,7 +283,7 @@ TextBlock HeaderFooterLayout::replaceTextMacros(const LayoutContext& ctx, const
break;
case 'n':
{
size_t no = page->score()->npages() + page->score()->pageNumberOffset();
const int no = static_cast<int>(page->score()->npages()) + page->score()->pageNumberOffset();
const String numberOfPagesString = String::number(no);
const CharFormat pageNumberFormat = formatForMacro(ctx, String('$' + nc));
appendFormattedString(newFragments, numberOfPagesString, defaultFormat, pageNumberFormat);
Expand Down
4 changes: 2 additions & 2 deletions src/engraving/rendering/score/parenthesislayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ void ParenthesisLayout::createPathAndShape(Parenthesis* item, Parenthesis::Layou

PointF startPoint = PointF();
double midThickness = 2 * midPointThickness;
int nbShapes = round(5.0 * heightInSpatium);
nbShapes = std::clamp(nbShapes, 20, 50);
int nbShapes = round(2.0 * heightInSpatium);
nbShapes = std::clamp(nbShapes, 3, 10);
PointF bezier1mid = bezier1for - PointF(midPointThickness * direction, 0.0);
PointF bezier2mid = bezier2for - PointF(midPointThickness * direction, 0.0);
const CubicBezier b(startPoint, bezier1mid, bezier2mid, endNormalised);
Expand Down
3 changes: 2 additions & 1 deletion src/engraving/rendering/score/tdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ void TDraw::draw(const Bend* item, Painter* painter, const PaintOptions& opt)
painter->setBrush(Brush(item->curColor(opt)));

Font f = item->font(spatium);
painter->setFont(f);

double x = data->noteWidth + spatium * .2;
double y = -spatium * .8;
Expand All @@ -978,6 +977,7 @@ void TDraw::draw(const Bend* item, Painter* painter, const PaintOptions& opt)

int idx = (pitch + 12) / 25;
const char* l = item->label[idx];
painter->setFont(f);
painter->drawText(RectF(x2, y2, .0, .0),
muse::draw::AlignHCenter | muse::draw::AlignBottom | muse::draw::TextDontClip,
String::fromAscii(l));
Expand Down Expand Up @@ -1010,6 +1010,7 @@ void TDraw::draw(const Bend* item, Painter* painter, const PaintOptions& opt)
int idx = (item->points()[pt + 1].pitch + 12) / 25;
const char* l = item->label[idx];
double ty = y2; // - _spatium;
painter->setFont(f);
painter->drawText(RectF(x2, ty, .0, .0),
muse::draw::AlignHCenter | muse::draw::AlignBottom | muse::draw::TextDontClip,
String::fromAscii(l));
Expand Down
3 changes: 3 additions & 0 deletions src/engraving/rw/write/twrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,8 @@ static void writeTimeSig(Score* score, const Fraction& tick, XmlWriter& xml, Wri
TimeSig* ts = Factory::createTimeSig(score->dummy()->segment());
ts->setSig(tsf);
TWrite::write(ts, xml, ctx);
ts->masterScore()->eidRegister()->removeItem(ts);
delete ts;
}

//---------------------------------------------------------
Expand Down Expand Up @@ -3607,6 +3609,7 @@ void TWrite::writeSegments(XmlWriter& xml, WriteContext& ctx, track_idx_t strack
KeySig* ks = Factory::createKeySig(score->dummy()->segment());
ks->setKey(ck, tk);
TWrite::write(ks, xml, ctx);
ks->masterScore()->eidRegister()->removeItem(ks);
delete ks;
keySigWritten = true;
}
Expand Down
15 changes: 12 additions & 3 deletions src/framework/global/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,19 @@ target_sources(muse_global PRIVATE
serialization/xmlstreamwriter.h
serialization/xmldom.cpp
serialization/xmldom.h

thirdparty/pugixml/pugixml.hpp
thirdparty/pugixml/pugixml.cpp
)
if (MUE_COMPILE_USE_SYSTEM_PUGIXML)
find_package(PkgConfig REQUIRED)
pkg_check_modules(pugixml REQUIRED IMPORTED_TARGET pugixml)
target_link_libraries(muse_global PRIVATE PkgConfig::pugixml)
target_include_directories(muse_global PRIVATE ${pugixml_INCLUDE_DIRS})
else()
target_sources(muse_global PRIVATE
thirdparty/pugixml/pugixml.hpp
thirdparty/pugixml/pugixml.cpp
)
target_include_directories(muse_global PRIVATE thirdparty/pugixml)
endif()

if (MUSE_THREADS_SUPPORT)
target_sources(muse_global PRIVATE
Expand Down
27 changes: 21 additions & 6 deletions src/importexport/musicxml/internal/export/exportmusicxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ class GlissandoHandler
{
public:
GlissandoHandler();
void reset();
void doGlissandoStart(Glissando* gliss, Notations& notations, XmlWriter& xml);
void doGlissandoStop(Glissando* gliss, Notations& notations, XmlWriter& xml);

Expand Down Expand Up @@ -1005,6 +1006,11 @@ static void glissando(const Glissando* gli, int number, bool start, Notations& n
//---------------------------------------------------------

GlissandoHandler::GlissandoHandler()
{
reset();
}

void GlissandoHandler::reset()
{
for (int i = 0; i < MAX_NUMBER_LEVEL; ++i) {
m_glissNote[i] = 0;
Expand Down Expand Up @@ -1458,8 +1464,8 @@ static void creditWords(XmlWriter& xml, const MStyle& s, const page_idx_t pageNr
if (!creditType.empty()) {
xml.tag("credit-type", creditType);
}
String attr = String(u" default-x=\"%1\"").arg(x);
attr += String(u" default-y=\"%1\"").arg(y);
String attr = String(u" default-x=\"%1\"").arg(String::number(x, 2));
attr += String(u" default-y=\"%1\"").arg(String::number(y, 2));
attr += u" justify=\"" + just + u"\"";
attr += u" valign=\"" + val + u"\"";
MScoreTextToMusicXml mttm(u"credit-words", attr, defFmt, mtf);
Expand Down Expand Up @@ -3360,6 +3366,12 @@ static void writeChordLines(const Chord* const chord, XmlWriter& xml, Notations&
}
if (!subtype.empty()) {
subtype += color2xml(cl);
if (cl->isStraight()) {
subtype += u" line-shape=\"straight\"";
}
if (cl->isWavy()) {
subtype += u" line-type=\"wavy\"";
}
notations.tag(xml, cl, "articulations");
xml.tagRaw(subtype);
}
Expand Down Expand Up @@ -5609,7 +5621,7 @@ void ExportMusicXml::pedal(Pedal const* const pd, staff_idx_t staff, const Fract
pedalType = u"change";
break;
case HookType::NONE:
pedalType = pd->lineVisible() ? u"resume" : u"start";
pedalType = (pd->lineVisible() && pd->beginText().isEmpty()) ? u"resume" : u"start";
break;
default:
pedalType = u"start";
Expand All @@ -5619,10 +5631,12 @@ void ExportMusicXml::pedal(Pedal const* const pd, staff_idx_t staff, const Fract
pedalType = u"sostenuto";
}
} else {
if (!pd->endText().isEmpty() || pd->endHookType() == HookType::HOOK_90) {
switch (pd->endHookType()) {
case HookType::NONE:
pedalType = (pd->lineVisible() && pd->endText().isEmpty()) ? u"discontinue" : u"stop";
break;
default:
pedalType = u"stop";
} else {
pedalType = u"discontinue";
}
// "change" type is handled only on the beginning of pedal lines

Expand Down Expand Up @@ -8629,6 +8643,7 @@ void ExportMusicXml::writeParts()

for (size_t partIndex = 0; partIndex < parts.size(); ++partIndex) {
const Part* part = parts.at(partIndex);
m_gh.reset(); // reset glissando handler state for each part
m_tick = { 0, 1 };
m_xml.startElementRaw(String(u"part id=\"P%1\"").arg(partIndex + 1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ static void resizeTitleBox(VBox* vbox)
score->renderer()->layoutItem(e);
}

double padding = vbox->spatium();
const double padding = vbox->sizeIsSpatiumDependent() ? vbox->style().spatium() : vbox->style().defaultSpatium();

for (EngravingItem* e : elist) {
if (e->isText()) {
Expand Down
10 changes: 10 additions & 0 deletions src/importexport/musicxml/internal/import/importmusicxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9215,6 +9215,8 @@ static void addChordLine(const Notation& notation, Note* note,
MusicXmlLogger* logger, const XmlStreamReader* const xmlreader)
{
const String chordLineType = notation.subType();
const String lineType = notation.attribute(u"line-type");
const String lineShape = notation.attribute(u"line-shape");
if (!chordLineType.empty()) {
if (note) {
ChordLine* const chordline = Factory::createChordLine(note->chord());
Expand All @@ -9227,6 +9229,14 @@ static void addChordLine(const Notation& notation, Note* note,
} else if (chordLineType == u"scoop") {
chordline->setChordLineType(ChordLineType::SCOOP);
}
if (lineShape == u"straight") {
chordline->setStraight(true);
}
if (lineType == u"wavy") {
chordline->setWavy(true);
} else if (!lineType.empty() && lineType != u"solid") {
logger->logError(String(u"unsupported line-type: %1").arg(lineType), xmlreader);
}
chordline->setVisible(notation.visible());
colorItem(chordline, Color::fromString(notation.attribute(u"color")));
note->chord()->add(chordline);
Expand Down
Loading