merge and forward
[alioth/musescore.git] / debian / patches / experiments / statusline-pitch-onofftime.diff
@@ -1,11 +1,22 @@
-# DP: https://musescore.org/en/node/290900#comment-927933
-# DP: requested velocity, on time, off time
-# DP: but velocity is hard (needs full rendermidi)
-# DP: this does tuning, on/off time
+Description: indicate pitch and on/off time in the status line
+ - indicate sounding pitch if the global concert pitch toggle
+   is off and the current instrument has an actual pitch,
+   i.e. not beat/rhythm slashes or drums; this will show the
+   identical pitch for nōn-transposing instruments by design
+   (to show we’re currently in transposing pitch mode, but the
+   current instrument is not transposing) which helps debugging
+ - indicate tuning (if any) after the sounding pitch (either mode)
+ - show on/off times if at least one of them is nōn-standard
+ .
+ The first change partially addresses node #283120.
+ The on/off time was requested in node #290900#comment-927933
+ (velocity is too hard, sorry about that).
+Author: mirabilos <m@mirbsd.org>
+Forwarded: https://github.com/musescore/MuseScore/pull/6750
 
 --- a/libmscore/note.cpp
 +++ b/libmscore/note.cpp
-@@ -2766,21 +2766,31 @@ QString Note::accessibleInfo() const
+@@ -2749,14 +2749,31 @@ QString Note::accessibleInfo() const
        QString duration = chord()->durationUserName();
        QString voice = QObject::tr("Voice: %1").arg(QString::number(track() % VOICES + 1));
        QString pitchName;
              pitchName = chord()->noStem() ? QObject::tr("Beat slash") : QObject::tr("Rhythm slash");
        else if (staff()->isDrumStaff(tick()) && drumset)
              pitchName = qApp->translate("drumset", drumset->name(pitch()).toUtf8().constData());
--      else if (!concertPitch()) {
+-      else
 +      else {
              pitchName = tpcUserName(false);
--            // tpcUserName equivalent for getting the sounding pitch
--            QString soundingPitch = propertyUserValue(Pid::TPC1) + QString::number(((_pitch + ottaveCapoFret() - int(tpc2alter(tpc()))) / 12) - 1);
--            // almost the same string as below
--            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)));
+-      return QObject::tr("%1; Pitch: %2; Duration: %3%4").arg(noteTypeUserName()).arg(pitchName).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
 +            if (tuning() != 0)
 +                  pitchOffset = QString::asprintf("%+.3f", tuning());
 +            if (!concertPitch()) {
 +                  // almost the same string as below
 +                  return QObject::tr("%1; Pitch: %2 (sounding as %3%4); Duration: %5%6%7").arg(noteTypeUserName()).arg(pitchName).arg(soundingPitch).arg(pitchOffset).arg(duration).arg(onofftime).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
 +                  }
-             }
--      else
--            pitchName = tpcUserName(false);
--      return QObject::tr("%1; Pitch: %2; Duration: %3%4").arg(noteTypeUserName()).arg(pitchName).arg(duration).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
++            }
 +      return QObject::tr("%1; Pitch: %2%3; Duration: %4%5%6").arg(noteTypeUserName()).arg(pitchName).arg(pitchOffset).arg(duration).arg(onofftime).arg((chord()->isGrace() ? "" : QString("; %1").arg(voice)));
        }