本文整理汇总了C++中Articulation::setArticulationType方法的典型用法代码示例。如果您正苦于以下问题:C++ Articulation::setArticulationType方法的具体用法?C++ Articulation::setArticulationType怎么用?C++ Articulation::setArticulationType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articulation
的用法示例。
在下文中一共展示了Articulation::setArticulationType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newArticulationsPalette
Palette* MuseScore::newArticulationsPalette()
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Articulations && Ornaments"));
sp->setGrid(42, 25);
sp->setDrawGrid(true);
for (int i = 0; i < int(ArticulationType::ARTICULATIONS); ++i) {
Articulation* s = new Articulation(gscore);
s->setArticulationType(ArticulationType(i));
sp->append(s, qApp->translate("articulation", qPrintable(s->subtypeUserName())));
}
Bend* bend = new Bend(gscore);
bend->points().append(PitchValue(0, 0, false));
bend->points().append(PitchValue(15, 100, false));
bend->points().append(PitchValue(60, 100, false));
sp->append(bend, qApp->translate("articulation", "Bend"));
TremoloBar* tb = new TremoloBar(gscore);
tb->points().append(PitchValue(0, 0, false)); // "Dip"
tb->points().append(PitchValue(30, -100, false));
tb->points().append(PitchValue(60, 0, false));
sp->append(tb, qApp->translate("articulation", "Tremolo Bar"));
return sp;
}
示例2: newArticulationsPalette
Palette* MuseScore::newArticulationsPalette(bool basic)
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Articulations && Ornaments"));
sp->setGrid(42, 25);
sp->setDrawGrid(true);
if (basic) {
static std::vector<ArticulationType> art {
ArticulationType::Fermata,
ArticulationType::Sforzatoaccent,
ArticulationType::Staccato,
ArticulationType::Tenuto,
ArticulationType::Portato,
ArticulationType::Marcato,
ArticulationType::Trill
};
for (auto i : art) {
Articulation* s = new Articulation(gscore);
s->setArticulationType(i);
sp->append(s, qApp->translate("articulation", s->subtypeUserName().toUtf8().constData()));
}
}
else {
for (int i = 0; i < int(ArticulationType::ARTICULATIONS); ++i) {
Articulation* s = new Articulation(gscore);
s->setArticulationType(ArticulationType(i));
sp->append(s, qApp->translate("articulation", s->subtypeUserName().toUtf8().constData()));
}
Bend* bend = new Bend(gscore);
bend->points().append(PitchValue(0, 0, false));
bend->points().append(PitchValue(15, 100, false));
bend->points().append(PitchValue(60, 100, false));
sp->append(bend, qApp->translate("articulation", "Bend"));
TremoloBar* tb = new TremoloBar(gscore);
tb->points().append(PitchValue(0, 0, false)); // "Dip"
tb->points().append(PitchValue(30, -100, false));
tb->points().append(PitchValue(60, 0, false));
sp->append(tb, qApp->translate("articulation", "Tremolo bar"));
}
return sp;
}
示例3: grace
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"));
}
示例4: readNote
//.........这里部分代码省略.........
}
if (voice == VOICES) {
qDebug("cannot allocate voice");
delete chord;
return;
}
Note* note = new Note(score);
note->setPitch(pitch);
note->setTpcFromPitch();
note->setTrack(gstaff * VOICES + voice);
chord->add(note);
QString dynamics;
QString an = s.mid(31, 11);
for (int i = 0; i < an.size(); ++i) {
if (an[i] == '(')
openSlur(0, tick, staff, voice);
else if (an[i] == ')')
closeSlur(0, tick, staff, voice);
else if (an[i] == '[')
openSlur(1, tick, staff, voice);
else if (an[i] == ']')
closeSlur(1, tick, staff, voice);
else if (an[i] == '{')
openSlur(2, tick, staff, voice);
else if (an[i] == '}')
closeSlur(2, tick, staff, voice);
else if (an[i] == 'z')
openSlur(3, tick, staff, voice);
else if (an[i] == 'x')
closeSlur(3, tick, staff, voice);
else if (an[i] == '.') {
Articulation* atr = new Articulation(score);
atr->setArticulationType(Articulation_Staccato);
chord->add(atr);
}
else if (an[i] == '_') {
Articulation* atr = new Articulation(score);
atr->setArticulationType(Articulation_Tenuto);
chord->add(atr);
}
else if (an[i] == 'v') {
Articulation* atr = new Articulation(score);
atr->setArticulationType(Articulation_Upbow);
chord->add(atr);
}
else if (an[i] == 'n') {
Articulation* atr = new Articulation(score);
atr->setArticulationType(Articulation_Downbow);
chord->add(atr);
}
else if (an[i] == 't') {
Articulation* atr = new Articulation(score);
atr->setArticulationType(Articulation_Trill);
chord->add(atr);
}
else if (an[i] == 'F') {
Articulation* atr = new Articulation(score);
atr->setUp(true);
atr->setArticulationType(Articulation_Fermata);
chord->add(atr);
}
else if (an[i] == 'E') {
Articulation* atr = new Articulation(score);
atr->setUp(false);
atr->setArticulationType(Articulation_Fermata);