more status line stuff
[alioth/musescore.git] / debian / patches / experiments / statusline-concert-transposing-pitch.diff
1 Description: Indicate the sounding pitch in the status line if…
2   * the current instrument has an actual pitch
3     (not beat/rhythm slashes or drums)
4   * the Concert Pitch (global) toggle is off
5  .
6  This will show the same pitch twice for nōn-transposing
7  instruments; that’s by design, to show we’re currently
8  in transposing pitch mode but that instrument does not
9  transpose (helps debugging).
10  .
11  Partially addresses node #283120.
12 Author: mirabilos <m@mirbsd.org>
13 Forwarded: https://github.com/musescore/MuseScore/pull/5036
14
15 --- a/libmscore/note.cpp
16 +++ b/libmscore/note.cpp
17 @@ -2771,6 +2771,13 @@ QString Note::accessibleInfo() const
18              pitchName = chord()->noStem() ? QObject::tr("Beat slash") : QObject::tr("Rhythm slash");
19        else if (staff()->isDrumStaff(tick()) && drumset)
20              pitchName = qApp->translate("drumset", drumset->name(pitch()).toUtf8().constData());
21 +      else if (!concertPitch()) {
22 +            pitchName = tpcUserName(false);
23 +            // tpcUserName equivalent for getting the sounding pitch
24 +            QString soundingPitch = propertyUserValue(Pid::TPC1) + QString::number(((_pitch + ottaveCapoFret() - int(tpc2alter(tpc()))) / 12) - 1);
25 +            // almost the same string as below
26 +            return QObject::tr("%1; Pitch: %2 (sounding as %3); Duration: %4%5").arg(noteTypeUserName()).arg(pitchName).arg(soundingPitch).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
27 +            }
28        else
29              pitchName = tpcUserName(false);
30        return QObject::tr("%1; Pitch: %2; Duration: %3%4").arg(noteTypeUserName()).arg(pitchName).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));