本文整理汇总了C++中FretDiagram::setMarker方法的典型用法代码示例。如果您正苦于以下问题:C++ FretDiagram::setMarker方法的具体用法?C++ FretDiagram::setMarker怎么用?C++ FretDiagram::setMarker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FretDiagram
的用法示例。
在下文中一共展示了FretDiagram::setMarker方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromString
FretDiagram* FretDiagram::fromString(Score* score, const QString &s)
{
FretDiagram* fd = new FretDiagram(score);
fd->setStrings(s.size());
fd->setFrets(4);
int offset = 0;
int barreString = -1;
for (int i = 0; i < s.size(); i++) {
QChar c = s.at(i);
if (c == 'X' or c == 'O')
fd->setMarker(i, c.unicode());
else if (c == '-' && barreString == -1) {
fd->setBarre(1);
barreString = i;
}
else {
int fret = c.digitValue();
if (fret != -1) {
fd->setDot(i, fret);
if (fret - 3 > 0 && offset < fret - 3)
offset = fret - 3;
}
}
}
if (offset > 0) {
fd->setOffset(offset);
for (int i = 0; i < fd->strings(); i++)
if (fd->dot(i))
fd->setDot(i, fd->dot(i) - offset);
}
if (barreString >= 0)
fd->setDot(barreString, 1);
return fd;
}
示例2: setBasicPalette
void MuseScore::setBasicPalette()
{
mscore->getPaletteBox();
paletteBox->clear();
paletteBox->addPalette(newGraceNotePalette());
paletteBox->addPalette(newClefsPalette());
paletteBox->addPalette(newKeySigPalette());
paletteBox->addPalette(newTimePalette());
paletteBox->addPalette(newBarLinePalette());
paletteBox->addPalette(newLinesPalette());
paletteBox->addPalette(newArpeggioPalette());
paletteBox->addPalette(newBreathPalette());
paletteBox->addPalette(newBracketsPalette());
paletteBox->addPalette(newArticulationsPalette());
paletteBox->addPalette(newAccidentalsPalette(true));
paletteBox->addPalette(newDynamicsPalette());
paletteBox->addPalette(newFingeringPalette());
paletteBox->addPalette(newNoteHeadsPalette());
paletteBox->addPalette(newTremoloPalette());
paletteBox->addPalette(newRepeatsPalette());
paletteBox->addPalette(newTempoPalette());
paletteBox->addPalette(newTextPalette());
paletteBox->addPalette(newBreaksPalette());
// paletteBox->addPalette(newBagpipeEmbellishmentPalette());
paletteBox->addPalette(newBeamPalette());
paletteBox->addPalette(newFramePalette());
//-----------------------------------
// Symbols
//-----------------------------------
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Symbols"));
sp->setGrid(42, 45);
sp->setDrawGrid(true);
FretDiagram* fret = new FretDiagram(gscore);
fret->setDot(5, 1);
fret->setDot(2, 2);
fret->setDot(1, 3);
fret->setMarker(0, 'X');
fret->setMarker(3, 'O');
fret->setMarker(4, 'O');
sp->append(fret, tr("Fretboard Diagram"));
paletteBox->addPalette(sp);
}
示例3: setAdvancedPalette
void MuseScore::setAdvancedPalette()
{
mscore->getPaletteBox();
paletteBox->clear();
paletteBox->addPalette(newGraceNotePalette());
paletteBox->addPalette(newClefsPalette());
paletteBox->addPalette(newKeySigPalette());
paletteBox->addPalette(newTimePalette());
paletteBox->addPalette(newBarLinePalette());
paletteBox->addPalette(newLinesPalette());
paletteBox->addPalette(newArpeggioPalette());
paletteBox->addPalette(newBreathPalette());
paletteBox->addPalette(newBracketsPalette());
paletteBox->addPalette(newArticulationsPalette());
paletteBox->addPalette(newAccidentalsPalette());
paletteBox->addPalette(newDynamicsPalette());
paletteBox->addPalette(newFingeringPalette());
paletteBox->addPalette(newNoteHeadsPalette());
paletteBox->addPalette(newTremoloPalette());
paletteBox->addPalette(newRepeatsPalette());
paletteBox->addPalette(newTempoPalette());
paletteBox->addPalette(newTextPalette());
paletteBox->addPalette(newBreaksPalette());
paletteBox->addPalette(newBagpipeEmbellishmentPalette());
//-----------------------------------
// staff state changes
//-----------------------------------
#if 0
sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Staff Changes"));
sp->setMag(.7);
sp->setGrid(42, 36);
sp->setDrawGrid(true);
StaffState* st = new StaffState(gscore);
st->setSubtype(StaffStateType::VISIBLE);
sp->append(st, tr("set visible"));
st = new StaffState(gscore);
st->setSubtype(StaffStateType::INVISIBLE);
sp->append(st, tr("set invisible"));
st = new StaffState(gscore);
st->setSubtype(StaffStateType::TYPE);
sp->append(st, tr("change staff type"));
st = new StaffState(gscore);
st->setSubtype(StaffStateType::INSTRUMENT);
sp->append(st, tr("change instrument"));
paletteBox->addPalette(sp);
#endif
paletteBox->addPalette(newBeamPalette());
paletteBox->addPalette(newFramePalette());
//-----------------------------------
// Symbols
//-----------------------------------
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Symbols"));
sp->setGrid(42, 45);
sp->setDrawGrid(true);
/* sp->append(SymId(accDiscantSym));
sp->append(SymId(accDotSym));
sp->append(SymId(accFreebaseSym));
sp->append(SymId(accStdbaseSym));
sp->append(SymId(accBayanbaseSym));
sp->append(SymId(accOldEESym));
sp->append(SymId(accpushSym));
sp->append(SymId(accpullSym));
*/
FretDiagram* fret = new FretDiagram(gscore);
fret->setDot(5, 1);
fret->setDot(2, 2);
fret->setDot(1, 3);
fret->setMarker(0, 'X');
fret->setMarker(3, 'O');
fret->setMarker(4, 'O');
sp->append(fret, tr("Fretboard Diagram"));
paletteBox->addPalette(sp);
}
示例4: populatePalette
void MuseScore::populatePalette()
{
paletteBox->addPalette(newGraceNotePalette());
paletteBox->addPalette(newClefsPalette());
paletteBox->addPalette(newKeySigPalette());
paletteBox->addPalette(newTimePalette());
paletteBox->addPalette(newBarLinePalette());
paletteBox->addPalette(newLinesPalette());
paletteBox->addPalette(newArpeggioPalette());
paletteBox->addPalette(newBreathPalette());
paletteBox->addPalette(newBracketsPalette());
paletteBox->addPalette(newArticulationsPalette());
paletteBox->addPalette(newAccidentalsPalette());
paletteBox->addPalette(newDynamicsPalette());
paletteBox->addPalette(newFingeringPalette());
paletteBox->addPalette(newNoteHeadsPalette());
paletteBox->addPalette(newTremoloPalette());
paletteBox->addPalette(newFallDoitPalette());
paletteBox->addPalette(newRepeatsPalette());
paletteBox->addPalette(newTextPalette());
paletteBox->addPalette(newBreaksPalette());
//-----------------------------------
// staff state changes
//-----------------------------------
#if 0
sp = new Palette;
sp->setName(tr("Staff Changes"));
sp->setMag(.7);
sp->setGrid(42, 36);
sp->setDrawGrid(true);
StaffState* st = new StaffState(gscore);
st->setSubtype(STAFF_STATE_VISIBLE);
sp->append(st, tr("set visible"));
st = new StaffState(gscore);
st->setSubtype(STAFF_STATE_INVISIBLE);
sp->append(st, tr("set invisible"));
st = new StaffState(gscore);
st->setSubtype(STAFF_STATE_TYPE);
sp->append(st, tr("change staff type"));
st = new StaffState(gscore);
st->setSubtype(STAFF_STATE_INSTRUMENT);
sp->append(st, tr("change instrument"));
paletteBox->addPalette(sp);
#endif
paletteBox->addPalette(newBeamPalette());
paletteBox->addPalette(newFramePalette());
//-----------------------------------
// Symbols
//-----------------------------------
Palette* sp = new Palette;
sp->setName(tr("Symbols"));
sp->setGrid(42, 45);
sp->setDrawGrid(true);
sp->append(accDiscantSym);
sp->append(accDotSym);
sp->append(accFreebaseSym);
sp->append(accStdbaseSym);
sp->append(accBayanbaseSym);
sp->append(accOldEESym);
sp->append(accpushSym);
sp->append(accpullSym);
FretDiagram* fret = new FretDiagram(gscore);
fret->setDot(5, 1);
fret->setDot(2, 2);
fret->setDot(1, 3);
fret->setMarker(0, 'X');
fret->setMarker(3, 'O');
fret->setMarker(4, 'O');
sp->append(fret, tr("Fret Diagram"));
paletteBox->addPalette(sp);
}
示例5: populatePalette
//.........这里部分代码省略.........
sp = new Palette;
sp->setName(tr("Fall/Doit"));
sp->setGrid(27, 40);
sp->setDrawGrid(true);
const char* scorelineNames[] = {
QT_TR_NOOP("fall"),
QT_TR_NOOP("doit"),
};
ChordLine* cl = new ChordLine(gscore);
cl->setSubtype(1);
sp->append(cl, tr(scorelineNames[0]));
cl = new ChordLine(gscore);
cl->setSubtype(2);
sp->append(cl, tr(scorelineNames[1]));
paletteBox->addPalette(sp);
//-----------------------------------
// Repeats
//-----------------------------------
sp = new Palette;
sp->setName(tr("Repeats"));
sp->setMag(0.65);
sp->setGrid(84, 28);
sp->setDrawGrid(true);
RepeatMeasure* rm = new RepeatMeasure(gscore);
sp->append(rm, tr("Repeat measure sign"));
Marker* mk = new Marker(gscore);
mk->setMarkerType(MARKER_SEGNO);
sp->append(mk, tr("Segno"));
mk = new Marker(gscore);
mk->setMarkerType(MARKER_VARSEGNO);
sp->append(mk, tr("Segno Variation"));
mk = new Marker(gscore);
mk->setMarkerType(MARKER_CODA);
sp->append(mk, tr("Coda"));
mk = new Marker(gscore);
mk->setMarkerType(MARKER_VARCODA);
sp->append(mk, tr("Varied coda"));
mk = new Marker(gscore);
mk->setMarkerType(MARKER_CODETTA);
sp->append(mk, tr("Codetta"));
mk = new Marker(gscore);
mk->setMarkerType(MARKER_FINE);
sp->append(mk, tr("Fine"));
Jump* jp = new Jump(gscore);
jp->setJumpType(JUMP_DC);
sp->append(jp, tr("Da Capo"));
jp = new Jump(gscore);
jp->setJumpType(JUMP_DC_AL_FINE);
sp->append(jp, tr("Da Capo al Fine"));
jp = new Jump(gscore);
jp->setJumpType(JUMP_DC_AL_CODA);