Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18158: Do not export invisible text lines #20225

Merged
merged 5 commits into from
Dec 5, 2023

Conversation

rettinghaus
Copy link
Contributor

closes #18158

@oktophonie
Copy link
Contributor

Shouldn't the line be exported as invisible, rather than not exported at all?
Also, with this PR if I create an export a file containing (for example) a PM marking with 'Show line' turned off, when re-importing the resulting MusicXML file, MuseScore complains that it is invalid.

@Jojo-Schmitz
Copy link
Contributor

How about

    _xml.startElement("direction-type");
    if (!tl->lineVisible())
        _xml.tag("dashes", { { "dash-length", 0} });
    } else if (isDashes) {
        _xml.tag("dashes", { { "type", type }, { "number", n + 1 } });
    } else {
        _xml.tagRaw(QString("bracket type=\"%1\" number=\"%2\" line-end=\"%3\"%4").arg(type, QString::number(n + 1), lineEnd, rest));

    }
    _xml.endElement();

Something similar is used for invisible (de-)crecendo lines

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Dec 4, 2023

Probably requires the import to handle this too

            const qreal dashLenght { _e.attributes().value("dash-length").isEmpty() ? -1.0 : _e.attributes().value("dash-length").toDouble() };
            if (ashLenght != 0) {
                b->setLineVisible(false);  // hack: export encodes invisible dash lines with a dashLength of 0
                b->setLineStyle(Qt::DashLine);
            }

@rettinghaus
Copy link
Contributor Author

@oktophonie There isn't such a thing as invisible lines in MusicXML. The bracket and dashes are missing the print-object attribute.
I'll recheck the validity issue.

@rettinghaus

This comment was marked as outdated.

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 4, 2023
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 4, 2023
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 4, 2023
@rettinghaus rettinghaus marked this pull request as ready for review December 4, 2023 19:55
@rettinghaus
Copy link
Contributor Author

@oktophonie Thanks for testing. The previously "fixed" export of invisible (de)crescendo lines showed the same problem. Now everything should be as expected.

@RomanPudashkin RomanPudashkin merged commit 6bdf8dc into musescore:master Dec 5, 2023
11 checks passed
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 5, 2023
@rettinghaus rettinghaus deleted the fix/lines branch December 5, 2023 09:40
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Musicxml Export] - Textline without line still exports line
5 participants