Skip to content

Commit

Permalink
fix #294237: optimize reading of extra information for notes and rests
Browse files Browse the repository at this point in the history
In the original implementation of accessibility,
we had the screenreader always read all extra information associated with a chord
(including articulations, lyrics, staff text, etc)
every time a note in that chord was selected.
This was necessary becayse we had no no way at the time to reach those elements individually.
Now that the next/previous element commands can access those elements directly,
we no longer need to read them on selection of the note.
And yet, reading this information on ordinary navigation (left/right) is not without value.
So this change simply limits the reading of the extra info to the top note of a chord,
and even then also checks voices for segment annotations.
The result is, when navigating, you'll hear the extra information read
when the chord is first hit, because we navigate chords top to bottom,
ut will not hear the extra information repeated for each subsequent note in the chord.
Beat information continues to be read always.
  • Loading branch information
MarcSabatella authored and anatoly-os committed Sep 17, 2019
1 parent 903d723 commit 5eccc30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libmscore/chordrest.cpp
Expand Up @@ -1156,7 +1156,7 @@ QString ChordRest::accessibleExtraInfo() const
for (Element* e : segment()->annotations()) {
if (!score()->selectionFilter().canSelect(e))
continue;
if (e->staffIdx() == staffIdx() )
if (e->track() == track())
rez = QString("%1 %2").arg(rez).arg(e->screenReaderInfo());
}

Expand Down
6 changes: 5 additions & 1 deletion libmscore/note.cpp
Expand Up @@ -2821,7 +2821,11 @@ QString Note::accessibleExtraInfo() const
}
}

rez = QString("%1 %2").arg(rez).arg(chord()->accessibleExtraInfo());
// only read extra information for top note of chord
// (it is reached directly on next/previous element)
if (this == chord()->upNote())
rez = QString("%1 %2").arg(rez).arg(chord()->accessibleExtraInfo());

return rez;
}

Expand Down

0 comments on commit 5eccc30

Please sign in to comment.