Skip to content

Commit

Permalink
fix #39621: accessible info for drum and slash notation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Nov 21, 2014
1 parent 6b0ff3a commit 98eafe2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions libmscore/note.cpp
Expand Up @@ -2469,7 +2469,14 @@ QString Note::accessibleInfo()
{
QString duration = chord()->durationUserName();
QString voice = tr("Voice: %1").arg(QString::number(track() % VOICES + 1));
return tr("%1; Pitch: %2; Duration: %3%4").arg(noteTypeUserName()).arg(tpcUserName(false)).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
QString pitchName;
if (fixed() && headGroup() == NoteHead::Group::HEAD_SLASH)
pitchName = chord()->noStem() ? tr("Beat Slash") : tr("Rhythm Slash");
else if (staff()->isDrumStaff())
pitchName = qApp->translate("drumset", staff()->part()->instr()->drumset()->name(pitch()).toUtf8().constData());
else
pitchName = tpcUserName(false);
return tr("%1; Pitch: %2; Duration: %3%4").arg(noteTypeUserName()).arg(pitchName).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
}

//---------------------------------------------------------
Expand All @@ -2480,7 +2487,14 @@ QString Note::screenReaderInfo()
{
QString duration = chord()->durationUserName();
QString voice = tr("Voice: %1").arg(QString::number(track() % VOICES + 1));
return QString("%1 %2 %3%4").arg(noteTypeUserName()).arg(tpcUserName(true)).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
QString pitchName;
if (fixed() && headGroup() == NoteHead::Group::HEAD_SLASH)
pitchName = chord()->noStem() ? tr("Beat Slash") : tr("Rhythm Slash");
else if (staff()->isDrumStaff())
pitchName = qApp->translate("drumset", staff()->part()->instr()->drumset()->name(pitch()).toUtf8().constData());
else
pitchName = tpcUserName(true);
return QString("%1 %2 %3%4").arg(noteTypeUserName()).arg(pitchName).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
}

//---------------------------------------------------------
Expand Down

0 comments on commit 98eafe2

Please sign in to comment.