本文整理汇总了C++中BarLine::setSubtype方法的典型用法代码示例。如果您正苦于以下问题:C++ BarLine::setSubtype方法的具体用法?C++ BarLine::setSubtype怎么用?C++ BarLine::setSubtype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BarLine
的用法示例。
在下文中一共展示了BarLine::setSubtype方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newBarLinePalette
Palette* MuseScore::newBarLinePalette()
{
Palette* sp = new Palette;
sp->setName(qApp->translate("barlines", "Barlines"));
sp->setMag(0.8);
sp->setGrid(42, 38);
struct {
BarLineType type;
const char* name;
} t[] = {
{ NORMAL_BAR, QT_TR_NOOP("Normal") },
{ BROKEN_BAR, QT_TR_NOOP("Dashed") },
{ END_BAR, QT_TR_NOOP("End Bar") },
{ DOUBLE_BAR, QT_TR_NOOP("Double Bar") },
{ START_REPEAT, QT_TR_NOOP("Start Repeat") },
{ END_REPEAT, QT_TR_NOOP("End Repeat") },
{ END_START_REPEAT, QT_TR_NOOP("End-Start Repeat") },
};
for (unsigned i = 0; i < sizeof(t)/sizeof(*t); ++i) {
BarLine* b = new BarLine(gscore);
b->setSubtype(t[i].type);
sp->append(b, qApp->translate("barlines", t[i].name));
}
return sp;
}
示例2: barMenu
void MuseScore::barMenu()
{
if (barPalette == 0) {
Palette* sp = new Palette();
sp->resize(300, 200);
barPalette = new PaletteScrollArea(sp, 0);
barPalette->setRestrictHeight(false);
barPalette->setWindowTitle(tr("MuseScore: Barlines"));
sp->setGrid(42, 38);
struct {
BarLineType type;
const char* name;
} t[] = {
{ NORMAL_BAR, QT_TR_NOOP("Normal") },
{ BROKEN_BAR, QT_TR_NOOP("Dashed") },
{ END_BAR, QT_TR_NOOP("End Bar") },
{ DOUBLE_BAR, QT_TR_NOOP("Double Bar") },
{ START_REPEAT, QT_TR_NOOP("Start Repeat") },
{ END_REPEAT, QT_TR_NOOP("End Repeat") },
{ END_START_REPEAT, QT_TR_NOOP("End-Start Repeat") },
};
for (unsigned i = 0; i < sizeof(t)/sizeof(*t); ++i) {
BarLine* b = new BarLine(gscore);
b->setHeight(4 * gscore->spatium());
b->setSubtype(t[i].type);
sp->append(b, tr(t[i].name));
}
}
barPalette->show();
barPalette->raise();
}
示例3: newBarLinePalette
Palette* MuseScore::newBarLinePalette()
{
Palette* sp = new Palette;
sp->setName(qApp->translate("barlines", "Barlines"));
sp->setMag(0.8);
sp->setGrid(42, 38);
// bar line styles
struct {
BarLineType type;
const char* name;
} t[] = {
{ NORMAL_BAR, QT_TR_NOOP("Normal") },
{ BROKEN_BAR, QT_TR_NOOP("Dashed") },
{ DOTTED_BAR, QT_TR_NOOP("Dotted") },
{ END_BAR, QT_TR_NOOP("End Bar") },
{ DOUBLE_BAR, QT_TR_NOOP("Double Bar") },
{ START_REPEAT, QT_TR_NOOP("Start Repeat") },
{ END_REPEAT, QT_TR_NOOP("End Repeat") },
{ END_START_REPEAT, QT_TR_NOOP("End-Start Repeat") },
};
for (unsigned i = 0; i < sizeof(t)/sizeof(*t); ++i) {
BarLine* b = new BarLine(gscore);
b->setSubtype(t[i].type);
sp->append(b, qApp->translate("barlines", t[i].name));
}
// bar line spans
struct {
int from, to;
const char* name;
} span[] = {
{ -1, 1, QT_TR_NOOP("Tick 1") },
{ -2, 2, QT_TR_NOOP("Tick 2") },
{ 2, 6, QT_TR_NOOP("Short 1") },
{ 1, 7, QT_TR_NOOP("Short 2") },
};
for (unsigned i = 0; i < sizeof(span)/sizeof(*span); ++i) {
BarLine* b = new BarLine(gscore);
b->setSubtype(NORMAL_BAR);
b->setSpanFrom(span[i].from);
b->setSpanTo(span[i].to);
sp->append(b, qApp->translate("barlines", span[i].name));
}
return sp;
}
示例4: populatePalette
//.........这里部分代码省略.........
sp->append(new TimeSig(gscore, 6, 4), "6/4");
sp->append(new TimeSig(gscore, 3, 8), "3/8");
sp->append(new TimeSig(gscore, 6, 8), "6/8");
sp->append(new TimeSig(gscore, 9, 8), "9/8");
sp->append(new TimeSig(gscore, 12, 8), "12/8");
sp->append(new TimeSig(gscore, TSIG_FOUR_FOUR), tr("4/4 common time"));
sp->append(new TimeSig(gscore, TSIG_ALLA_BREVE), tr("2/2 alla breve"));
paletteBox->addPalette(sp);
//-----------------------------------
// Bar Lines
//-----------------------------------
sp = new Palette;
sp->setName(tr("Barlines"));
sp->setMag(0.8);
sp->setGrid(42, 38);
struct {
BarLineType type;
const char* name;
} t[] = {
{ NORMAL_BAR, QT_TR_NOOP("Normal") },
{ BROKEN_BAR, QT_TR_NOOP("Dashed") },
{ END_BAR, QT_TR_NOOP("End Bar") },
{ DOUBLE_BAR, QT_TR_NOOP("Double Bar") },
{ START_REPEAT, QT_TR_NOOP("Start Repeat") },
{ END_REPEAT, QT_TR_NOOP("End Repeat") },
{ END_START_REPEAT, QT_TR_NOOP("End-Start Repeat") },
};
for (unsigned i = 0; i < sizeof(t)/sizeof(*t); ++i) {
BarLine* b = new BarLine(gscore);
b->setSubtype(t[i].type);
sp->append(b, tr(t[i].name));
}
paletteBox->addPalette(sp);
//-----------------------------------
// Lines
//-----------------------------------
sp = new Palette;
sp->setName(tr("Lines"));
sp->setMag(.8);
sp->setGrid(82, 23);
Slur* slur = new Slur(gscore);
slur->setId(0);
sp->append(slur, tr("Slur"));
Hairpin* gabel0 = new Hairpin(gscore);
gabel0->setSubtype(0);
sp->append(gabel0, tr("Crescendo"));
Hairpin* gabel1 = new Hairpin(gscore);
gabel1->setSubtype(1);
sp->append(gabel1, tr("Diminuendo"));
Volta* volta = new Volta(gscore);
volta->setSubtype(VOLTA_CLOSED);
volta->setText("1.");
QList<int> il;
il.append(1);
volta->setEndings(il);
sp->append(volta, tr("Prima volta"));