Beispiel #1
0
void PianoView::updateNotes()
      {
      scene()->blockSignals(true);  // block changeSelection()
      scene()->clearFocus();
      scene()->clear();
      createLocators();

      int staffIdx   = staff->idx();
      int startTrack = staffIdx * VOICES;
      int endTrack   = startTrack + VOICES;

      Segment::Type st = Segment::Type::ChordRest;
      for (Segment* s = staff->score()->firstSegment(st); s; s = s->next1(st)) {
            for (int track = startTrack; track < endTrack; ++track) {
                  Chord* chord = static_cast<Chord*>(s->element(track));
                  if (chord == 0 || chord->type() != ElementType::CHORD)
                        continue;
                  addChord(chord);
                  }
            }
      for (int i = 0; i < 3; ++i)
            moveLocator(i);
      scene()->blockSignals(false);
      }
Beispiel #2
0
void Ruler::mouseMoveEvent(QMouseEvent* e)
      {
      moveLocator(e);
      }