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

[MU3] [DAISY] backport of master fixes to 3.x #7870

Closed
wants to merge 5 commits into from
Closed
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
25 changes: 17 additions & 8 deletions importexport/musicxml/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2678,12 +2678,14 @@ static void writeChordLines(const Chord* const chord, XmlWriter& xml, Notations&
void ExportMusicXml::chordAttributes(Chord* chord, Notations& notations, Technical& technical,
TrillHash& trillStart, TrillHash& trillStop)
{
QVector<Element*> fl;
for (Element* e : chord->segment()->annotations()) {
if (e->track() == chord->track() && e->isFermata())
fl.push_back(e);
if (!chord->isGrace()) {
QVector<Element*> fl;
for (Element* e : chord->segment()->annotations()) {
if (e->track() == chord->track() && e->isFermata())
fl.push_back(e);
}
fermatas(fl, _xml, notations);
}
fermatas(fl, _xml, notations);

const QVector<Articulation*> na = chord->articulations();
// first the attributes whose elements are children of <articulations>
Expand Down Expand Up @@ -4777,15 +4779,21 @@ static void directionMarker(XmlWriter& xml, const Marker* const m)
// findTrackForAnnotations
//---------------------------------------------------------

// An annotation is attached to the staff, with track set
// to the lowest track in the staff. Find a track for it
// (the lowest track in this staff that has a chord or rest)
// Annotations must be attached to chords or rests. If there is no chord or
// rest in the annotation's track then we must use a different track that
// does have a chord or a rest.

static int findTrackForAnnotations(int track, Segment* seg)
{
if (seg->segmentType() != SegmentType::ChordRest)
return -1;

if (seg->element(track))
return track; // able to use annotation's own track

// No chords or rests in the annotation's own track so look for chord and
// rests in the other tracks in this staff.

int staff = track / VOICES;
int strack = staff * VOICES; // start track of staff containing track
int etrack = strack + VOICES; // end track of staff containing track + 1
Expand Down Expand Up @@ -6130,6 +6138,7 @@ void MeasureNumberStateHandler::updateForMeasure(const Measure* const m)
}

// update measure numbers and cache result
_measureNo += m->noOffset();
_cachedAttributes = " number=";
if ((_irregularMeasureNo + _measureNo) == 2 && m->irregular()) {
_cachedAttributes += "\"0\" implicit=\"yes\"";
Expand Down
6 changes: 4 additions & 2 deletions importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,8 +1969,8 @@ void MusicXMLParserPass2::measure(const QString& partId,
const Fraction time)
{
Q_ASSERT(_e.isStartElement() && _e.name() == "measure");
//QString number = _e.attributes().value("number").toString();
//qDebug("measure %s start", qPrintable(number));
int number = _e.attributes().value("number").toInt();
//qDebug("measure %d start", number);

Measure* measure = findMeasure(_score, time);
if (!measure) {
Expand All @@ -1979,6 +1979,8 @@ void MusicXMLParserPass2::measure(const QString& partId,
return;
}

measure->setNoOffset(measure->no() - number);

// handle implicit measure
if (_e.attributes().value("implicit") == "yes")
measure->setIrregular(true);
Expand Down
3 changes: 2 additions & 1 deletion libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ QString ChordRest::durationUserName() const
tupletType = QObject::tr("Nonuplet");
break;
default:
tupletType = QObject::tr("Custom tuplet");
//: %1 is tuplet ratio numerator (i.e. the number of notes in the tuplet)
tupletType = QObject::tr("%1 note tuplet").arg(tuplet()->ratio().numerator());
}
}
QString dotString = "";
Expand Down
4 changes: 3 additions & 1 deletion libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3071,7 +3071,9 @@ QString Note::screenReaderInfo() const
else if (staff()->isTabStaff(tick()))
pitchName = QObject::tr("%1; String: %2; Fret: %3").arg(tpcUserName(true), QString::number(string() + 1), QString::number(fret()));
else
pitchName = tpcUserName(true);
pitchName = _headGroup == NoteHead::Group::HEAD_NORMAL
? tpcUserName(true)
: QObject::tr("%1 head %2").arg(subtypeName()).arg(tpcUserName(true));
return QString("%1 %2 %3%4").arg(noteTypeUserName(), pitchName, duration, (chord()->isGrace() ? "" : QString("; %1").arg(voice)));
}

Expand Down