revert, back to the ReiƟbrett
authormirabilos <tg@debian.org>
Sun, 2 Jun 2019 22:20:01 +0000 (00:20 +0200)
committermirabilos <mirabilos@evolvis.org>
Sun, 2 Jun 2019 22:20:01 +0000 (00:20 +0200)
debian/patches/experiments/factor-out-statusbar.diff [deleted file]
debian/patches/experiments/revert-restriking-patch.diff
debian/patches/series

diff --git a/debian/patches/experiments/factor-out-statusbar.diff b/debian/patches/experiments/factor-out-statusbar.diff
deleted file mode 100644 (file)
index c86df60..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-Description: Factor out Element::getFullAccessibleInfo() and barbeat()
-Author: mirabilos <m@mirbsd.org>
-Forwarded: no
-
---- a/libmscore/element.cpp
-+++ b/libmscore/element.cpp
-@@ -1998,4 +1998,79 @@ bool Element::isUserModified() const
-       return !visible() || !userOff().isNull() || (color() != MScore::defaultColor);
-       }
-+//---------------------------------------------------------
-+//   barbeat
-+//---------------------------------------------------------
-+
-+std::pair<int, float> Element::barbeat()
-+      {
-+      int bar = 0;
-+      int beat = 0;
-+      int ticks = 0;
-+      TimeSigMap* tsm = this->score()->sigmap();
-+      Element* p = this;
-+      while(p && p->type() != Element::Type::SEGMENT && p->type() != Element::Type::MEASURE)
-+            p = p->parent();
-+
-+      if (!p) {
-+            return std::pair<int, float>(0, 0);
-+            }
-+      else if (p->type() == Element::Type::SEGMENT) {
-+            Segment* seg = static_cast<Segment*>(p);
-+            tsm->tickValues(seg->tick(), &bar, &beat, &ticks);
-+            }
-+      else if (p->type() == Element::Type::MEASURE) {
-+            Measure* m = static_cast<Measure*>(p);
-+            bar = m->no();
-+            beat = -1;
-+            ticks = 0;
-+            }
-+      return std::pair<int,float>(bar + 1, beat + 1 + ticks / static_cast<float>(MScore::division));
-+      }
-+
-+//---------------------------------------------------------
-+//   getFullAccessibleInfo
-+//---------------------------------------------------------
-+
-+std::pair<QString, QString> Element::getFullAccessibleInfo(Score* score)
-+      {
-+      Element* el = this->isSpannerSegment() ? static_cast<SpannerSegment*>(this)->spanner() : this;
-+      QString barsAndBeats = "";
-+      std::pair<int, float> bar_beat;
-+      if (el->isSpanner()){
-+            Spanner* s = static_cast<Spanner*>(el);
-+            bar_beat = s->startSegment()->barbeat();
-+            barsAndBeats += tr("Start Measure: %1; Start Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
-+            Segment* seg = s->endSegment();
-+            if(!seg)
-+                  seg = score->lastSegment()->prev1MM(Segment::Type::ChordRest);
-+
-+            if (seg->tick() != score->lastSegment()->prev1MM(Segment::Type::ChordRest)->tick() &&
-+                s->type() != Element::Type::SLUR                                               &&
-+                s->type() != Element::Type::TIE                                                )
-+                  seg = seg->prev1MM(Segment::Type::ChordRest);
-+
-+            bar_beat = seg->barbeat();
-+            barsAndBeats += "; " + tr("End Measure: %1; End Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
-+            }
-+      else {
-+            std::pair<int, float>bar_beat = el->barbeat();
-+            if (bar_beat.first) {
-+                  barsAndBeats += " " + tr("Measure: %1").arg(QString::number(bar_beat.first));
-+                  if (bar_beat.second)
-+                        barsAndBeats += "; " + tr("Beat: %1").arg(QString::number(bar_beat.second));
-+                  }
-+            }
-+
-+      QString rez = this->accessibleInfo();
-+      if (!barsAndBeats.isEmpty())
-+            rez += "; " + barsAndBeats;
-+      QString staff = "";
-+      if (this->staffIdx() + 1) {
-+            rez += "; " + tr("Staff: %1").arg(QString::number(this->staffIdx() + 1));
-+            staff = tr("Staff %1").arg(QString::number(this->staffIdx() + 1));
-+            }
-+      QString screenReaderRez = QString("%1%2 %3 %4").arg(this->screenReaderInfo()).arg(barsAndBeats).arg(staff).arg(this->accessibleExtraInfo());
-+      return std::pair<QString, QString>(rez, screenReaderRez);
-+      }
- }
---- a/libmscore/element.h
-+++ b/libmscore/element.h
-@@ -327,6 +327,8 @@ class Element : public QObject, public S
-       Element* findMeasure();
-       qreal spatium() const;
-+      std::pair<int, float>barbeat();
-+      std::pair<QString, QString>getFullAccessibleInfo(Score* score);
-       bool selected() const                   { return _selected;   }
-       virtual void setSelected(bool f)        { _selected = f;      }
---- a/mscore/scoreaccessibility.cpp
-+++ b/mscore/scoreaccessibility.cpp
-@@ -105,53 +105,15 @@ void ScoreAccessibility::currentInfoChan
-             if (!e) {
-                   return;
-                   }
--            Element* el = e->isSpannerSegment() ? static_cast<SpannerSegment*>(e)->spanner() : e;
--            QString barsAndBeats = "";
--            std::pair<int, float> bar_beat;
--            if (el->isSpanner()){
--                  Spanner* s = static_cast<Spanner*>(el);
--                  bar_beat = barbeat(s->startSegment());
--                  barsAndBeats += tr("Start Measure: %1; Start Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
--                  Segment* seg = s->endSegment();
--                  if(!seg)
--                        seg = score->lastSegment()->prev1MM(Segment::Type::ChordRest);
--
--                  if (seg->tick() != score->lastSegment()->prev1MM(Segment::Type::ChordRest)->tick() &&
--                      s->type() != Element::Type::SLUR                                               &&
--                      s->type() != Element::Type::TIE                                                )
--                        seg = seg->prev1MM(Segment::Type::ChordRest);
--
--                  bar_beat = barbeat(seg);
--                  barsAndBeats += "; " + tr("End Measure: %1; End Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
--                  }
--            else {
--                  std::pair<int, float>bar_beat = barbeat(el);
--                  if (bar_beat.first) {
--                        barsAndBeats += " " + tr("Measure: %1").arg(QString::number(bar_beat.first));
--                        if (bar_beat.second)
--                              barsAndBeats += "; " + tr("Beat: %1").arg(QString::number(bar_beat.second));
--                        }
--                  }
--
--            QString rez = e->accessibleInfo();
--            if (!barsAndBeats.isEmpty())
--                  rez += "; " + barsAndBeats;
--
--            QString staff = "";
--            if (e->staffIdx() + 1) {
--                  staff = tr("Staff %1").arg(QString::number(e->staffIdx() + 1));
--                  rez = QString("%1; %2").arg(rez).arg(staff);
--                  }
--
--            statusBarLabel->setText(rez);
--            QString screenReaderRez = QString("%1%2 %3 %4").arg(e->screenReaderInfo()).arg(barsAndBeats).arg(staff).arg(e->accessibleExtraInfo());
--            score->setAccessibleInfo(screenReaderRez);
-+            std::pair<QString, QString> rez = e->getFullAccessibleInfo(score);
-+            statusBarLabel->setText(rez.first);
-+            score->setAccessibleInfo(rez.second);
-             }
-       else if (score->selection().isRange()) {
-             QString barsAndBeats = "";
-             std::pair<int, float> bar_beat;
--            bar_beat = barbeat(score->selection().startSegment());
-+            bar_beat = score->selection().startSegment()->barbeat();
-             barsAndBeats += " " + tr("Start Measure: %1; Start Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
-             Segment* endSegment = score->selection().endSegment();
-@@ -160,7 +122,7 @@ void ScoreAccessibility::currentInfoChan
-             else
-                   endSegment = endSegment->prev1MM();
--            bar_beat = barbeat(endSegment);
-+            bar_beat = endSegment->barbeat();
-             barsAndBeats += " " + tr("End Measure: %1; End Beat: %2").arg(QString::number(bar_beat.first)).arg(QString::number(bar_beat.second));
-             statusBarLabel->setText(tr("Range Selection") + barsAndBeats);
-             score->setAccessibleInfo(tr("Range Selection") + barsAndBeats);
-@@ -204,34 +166,4 @@ void ScoreAccessibility::updateAccessibi
-       QAccessibleValueChangeEvent ev(obj, w->score()->accessibleInfo());
-       QAccessible::updateAccessibility(&ev);
-       }
--
--std::pair<int, float> ScoreAccessibility::barbeat(Element *e)
--      {
--      if (!e) {
--            return std::pair<int, float>(0, 0);
--            }
--
--      int bar = 0;
--      int beat = 0;
--      int ticks = 0;
--      TimeSigMap* tsm = e->score()->sigmap();
--      Element* p = e;
--      while(p && p->type() != Element::Type::SEGMENT && p->type() != Element::Type::MEASURE)
--            p = p->parent();
--
--      if (!p) {
--            return std::pair<int, float>(0, 0);
--            }
--      else if (p->type() == Element::Type::SEGMENT) {
--            Segment* seg = static_cast<Segment*>(p);
--            tsm->tickValues(seg->tick(), &bar, &beat, &ticks);
--            }
--      else if (p->type() == Element::Type::MEASURE) {
--            Measure* m = static_cast<Measure*>(p);
--            bar = m->no();
--            beat = -1;
--            ticks = 0;
--            }
--      return pair<int,float>(bar + 1, beat + 1 + ticks / static_cast<float>(MScore::division));
--      }
- }
---- a/mscore/scoreaccessibility.h
-+++ b/mscore/scoreaccessibility.h
-@@ -30,7 +30,6 @@ private:
-       QMainWindow* mainWindow;
-       QLabel* statusBarLabel;
-       ScoreAccessibility(QMainWindow* statusBar);
--      std::pair<int, float>barbeat(Element* e);
- public:
-       ~ScoreAccessibility();
index 28cff1a..4334673 100644 (file)
@@ -8,7 +8,6 @@ Author: mirabilos <m@mirbsd.org>
 Bug: https://musescore.org/en/node/12971
 Forwarded: https://github.com/musescore/MuseScore/pull/3797
  except reversal of commit d5a81add16497f9b4b7fac5717ea005c31dcc1cf
- and except collision logging
 
 --- a/libmscore/rendermidi.cpp
 +++ b/libmscore/rendermidi.cpp
@@ -215,40 +214,7 @@ Forwarded: https://github.com/musescore/MuseScore/pull/3797
              out << qSetFieldWidth(5) << "   Type  = ";
 --- a/synthesizer/event.cpp
 +++ b/synthesizer/event.cpp
-@@ -14,6 +14,7 @@
- #include "libmscore/xml.h"
- #include "libmscore/note.h"
- #include "libmscore/sig.h"
-+#include "libmscore/tie.h"
- #include "event.h"
- namespace Ms {
-@@ -375,6 +376,24 @@ void EventList::insert(const Event& e)
- //   class EventMap::fixupMIDI
- //---------------------------------------------------------
-+static void logCollisionNote(const Note *note, unsigned int indent)
-+      {
-+      fprintf(stderr, "%*s%s\n", indent, "- ", qPrintable(note->getFullAccessibleInfo(note->score()).first));
-+      }
-+
-+static void logCollisionNotes(NPlayEvent *event)
-+      {
-+      for (auto it = event->notes.cbegin(); it != event->notes.cend(); ++it) {
-+            const Note* note1 = *it;
-+            unsigned int indent = /* initial */ 2;
-+            while (note1) {
-+                  logCollisionNote(note1, indent);
-+                  indent += /* next level */ 2;
-+                  note1 = note1->tieFor() ? note1->tieFor()->endNote() : 0;
-+                  }
-+            }
-+      }
-+
- void EventMap::fixupMIDI()
-       {
-       /* track info for each of the 128 possible MIDI notes */
-@@ -390,28 +409,43 @@ void EventMap::fixupMIDI()
+@@ -390,28 +390,37 @@ void EventMap::fixupMIDI()
  
        auto it = begin();
        while (it != end()) {
@@ -277,12 +243,6 @@ Forwarded: https://github.com/musescore/MuseScore/pull/3797
 +                  else if (++np > 1) {
 +                        /* already playing */
 +                        discard = true;
-+                        /* log the collision */
-+                        fprintf(stderr, "MIDI collision detected: newly played...\n");
-+                        logCollisionNotes(&(it->second));
-+                        fprintf(stderr, "... interfere with already playing...\n");
-+                        logCollisionNotes(info[it->second.channel()].event[it->second.pitch()]);
-+                        fprintf(stderr, "... which, as resolution, will continue to sound.\n");
 +                        /* carry over the corresponding score notes */
 +                        info[it->second.channel()].event[it->second.pitch()]->notes.insert(info[it->second.channel()].event[it->second.pitch()]->notes.end(), it->second.notes.begin(), it->second.notes.end());
                          }
index 5fce5a0..d61138f 100644 (file)
@@ -12,5 +12,4 @@ upstream/update-AppData.diff
 debian-specific/fixup-AppData.diff
 experiments/lyrics-hyphen-max-8sp.diff
 experiments/musescore-2.1.0-qt-5.12.patch
-experiments/factor-out-statusbar.diff
 experiments/revert-restriking-patch.diff