Exemple #1
0
void TestNote::grace()
      {
      Score* score = readScore(DIR + "grace.mscx");
      score->doLayout();
      Chord* chord = score->firstMeasure()->findChord(0, 0);
      Note* note = chord->upNote();

      // create
      score->setGraceNote(chord, note->pitch(), NoteType::APPOGGIATURA, MScore::division/2);
      Chord* gc = chord->graceNotes().first();
      Note* gn = gc->notes().first();
//      Note* n = static_cast<Note*>(writeReadElement(gn));
//      QCOMPARE(n->noteType(), NoteType::APPOGGIATURA);
//      delete n;

      // tie
      score->startCmd();
      score->select(gn);
      score->cmdAddTie();
      score->endCmd();
//      n = static_cast<Note*>(writeReadElement(gn));
//      QVERIFY(n->tieFor() != 0);
//      delete n;

      // tremolo
      score->startCmd();
      Tremolo* tr = new Tremolo(score);
      tr->setTremoloType(TremoloType::R16);
      tr->setParent(gc);
      tr->setTrack(gc->track());
      score->undoAddElement(tr);
      score->endCmd();
//      Chord* c = static_cast<Chord*>(writeReadElement(gc));
//      QVERIFY(c->tremolo() != 0);
//      delete c;

      // articulation
      score->startCmd();
      Articulation* ar = new Articulation(score);
      ar->setArticulationType(ArticulationType::Sforzatoaccent);
      ar->setParent(gc);
      ar->setTrack(gc->track());
      score->undoAddElement(ar);
      score->endCmd();
//      c = static_cast<Chord*>(writeReadElement(gc));
//      QVERIFY(c->articulations().size() == 1);
//      delete c;

      QVERIFY(saveCompareScore(score, "grace-test.mscx", DIR + "grace-ref.mscx"));

      }
Exemple #2
0
Palette* MuseScore::newTremoloPalette()
      {
      Palette* sp = new Palette;
      sp->setName(QT_TRANSLATE_NOOP("Palette", "Tremolo"));
      sp->setGrid(27, 40);
      sp->setDrawGrid(true);

      for (int i = int(TremoloType::R8); i <= int(TremoloType::C64); ++i) {
            Tremolo* tremolo = new Tremolo(gscore);
            tremolo->setTremoloType(TremoloType(i));
            sp->append(tremolo, qApp->translate("Tremolo", tremolo->subtypeName().toUtf8().constData()));
            }
      return sp;
      }
Exemple #3
0
Palette* MuseScore::newTremoloPalette()
      {
      Palette* sp = new Palette;
      sp->setName(QT_TRANSLATE_NOOP("Palette", "Tremolo"));
      sp->setGrid(27, 40);
      sp->setDrawGrid(true);
      const char* tremoloName[] = {
            QT_TR_NOOP("Eighth through stem"),
            QT_TR_NOOP("16th through stem"),
            QT_TR_NOOP("32nd through stem"),
            QT_TR_NOOP("64th through stem"),
            QT_TR_NOOP("Eighth between notes"),
            QT_TR_NOOP("16th between notes"),
            QT_TR_NOOP("32nd between notes"),
            QT_TR_NOOP("64th between notes")
            };

      for (int i = int(TremoloType::R8); i <= int(TremoloType::C64); ++i) {
            Tremolo* tremolo = new Tremolo(gscore);
            tremolo->setTremoloType(TremoloType(i));
            sp->append(tremolo, tr(tremoloName[i - int(TremoloType::R8)]));
            }
      return sp;
      }
Exemple #4
0
Palette* MuseScore::newTremoloPalette()
{
    Palette* sp = new Palette;
    sp->setName(QT_TRANSLATE_NOOP("Palette", "Tremolo"));
    sp->setGrid(27, 40);
    sp->setDrawGrid(true);
    const char* tremoloName[] = {
        QT_TR_NOOP("1/8 through stem"),
        QT_TR_NOOP("1/16 through stem"),
        QT_TR_NOOP("1/32 through stem"),
        QT_TR_NOOP("1/64 through stem"),
        QT_TR_NOOP("1/8 between notes"),
        QT_TR_NOOP("1/16 between notes"),
        QT_TR_NOOP("1/32 between notes"),
        QT_TR_NOOP("1/64 between notes")
    };

    for (int i = TREMOLO_R8; i <= TREMOLO_C64; ++i) {
        Tremolo* tremolo = new Tremolo(gscore);
        tremolo->setTremoloType(TremoloType(i));
        sp->append(tremolo, tr(tremoloName[i - TREMOLO_R8]));
    }
    return sp;
}