本文整理汇总了C++中LayoutBreak::setSubtype方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBreak::setSubtype方法的具体用法?C++ LayoutBreak::setSubtype怎么用?C++ LayoutBreak::setSubtype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBreak
的用法示例。
在下文中一共展示了LayoutBreak::setSubtype方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newBreaksPalette
Palette* MuseScore::newBreaksPalette()
{
qreal _spatium = gscore->spatium();
Palette* sp = new Palette;
sp->setName(tr("Breaks && Spacer"));
sp->setMag(.7);
sp->setGrid(42, 36);
sp->setDrawGrid(true);
LayoutBreak* lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_LINE);
sp->append(lb, tr("Line break"));
lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_PAGE);
sp->append(lb, tr("Page break"));
lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_SECTION);
sp->append(lb, tr("Section break"));
Spacer* spacer = new Spacer(gscore);
spacer->setGap(3 * _spatium);
spacer->setSubtype(SPACER_DOWN);
sp->append(spacer, tr("Staff spacer down"));
spacer = new Spacer(gscore);
spacer->setGap(3 * _spatium);
spacer->setSubtype(SPACER_UP);
sp->append(spacer, tr("Staff spacer up"));
return sp;
}
示例2: showLayoutBreakPalette
void MuseScore::showLayoutBreakPalette()
{
if (layoutBreakPalette == 0) {
qreal _spatium = gscore->spatium();
Palette* sp = new Palette;
layoutBreakPalette = new PaletteScrollArea(sp);
layoutBreakPalette->setRestrictHeight(false);
layoutBreakPalette->setWindowTitle(tr("MuseScore: Breaks & Spacer"));
sp->setGrid(80, 80);
sp->resize(240,80);
LayoutBreak* lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_LINE);
sp->append(lb, tr("Line break"));
lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_PAGE);
sp->append(lb, tr("Page break"));
lb = new LayoutBreak(gscore);
lb->setSubtype(LAYOUT_BREAK_SECTION);
sp->append(lb, tr("Section break"));
Spacer* spacer = new Spacer(gscore);
spacer->setGap(_spatium * 3);
sp->append(spacer, tr("Staff spacer"));
}
layoutBreakPalette->show();
layoutBreakPalette->raise();
}
示例3: endMeasure
void MsScWriter::endMeasure(const Bww::MeasureEndFlags mef)
{
qDebug() << "MsScWriter::endMeasure()";
if (mef.repeatEnd)
currentMeasure->setRepeatFlags(RepeatEnd);
if (mef.endingEnd) {
if (lastVolta) {
qDebug("adding volta\n");
if (ending == 1)
lastVolta->setSubtype(VOLTA_CLOSED);
else
lastVolta->setSubtype(VOLTA_OPEN);
lastVolta->setEndElement(currentMeasure);
currentMeasure->addSpannerBack(lastVolta);
lastVolta = 0;
}
else {
qDebug("lastVolta == 0 on stop\n");
}
}
if (mef.lastOfSystem) {
LayoutBreak* lb = new LayoutBreak(score);
lb->setTrack(0);
lb->setSubtype(LAYOUT_BREAK_LINE);
currentMeasure->add(lb);
}
if (mef.lastOfPart && !mef.repeatEnd) {
currentMeasure->setEndBarLineType(END_BAR, false, true);
}
else if (mef.doubleBarLine) {
currentMeasure->setEndBarLineType(DOUBLE_BAR, false, true);
}
// BarLine* barLine = new BarLine(score);
// bool visible = true;
// barLine->setSubtype(NORMAL_BAR);
// barLine->setTrack(0);
// currentMeasure->setEndBarLineType(barLine->subtype(), false, visible);
}
示例4: importPdf
bool MuseScore::importPdf(Score* score, const QString& path)
{
Omr* omr = new Omr(path, score);
if (!omr->readPdf()) {
delete omr;
return false;
}
score->setOmr(omr);
qreal sp = omr->spatiumMM();
if (sp == 0.0)
sp = 1.5;
score->setSpatium(sp * DPMM);
score->style()->set(StyleVal(ST_pageFillLimit, 1.0));
score->style()->set(StyleVal(ST_lastSystemFillLimit, 0.0));
score->style()->set(StyleVal(ST_staffLowerBorder, 0.0));
score->style()->set(StyleVal(ST_measureSpacing, 1.0));
PageFormat pF(*score->pageFormat());
pF.setEvenLeftMargin(5.0 * DPMM / DPI);
pF.setEvenTopMargin(0);
pF.setEvenBottomMargin(0);
pF.setOddLeftMargin(5.0 * DPMM / DPI);
pF.setOddTopMargin(0);
pF.setOddBottomMargin(0);
score->setPageFormat(pF);
score->style()->set(StyleVal(ST_systemDistance, Spatium(omr->systemDistance())));
score->style()->set(StyleVal(ST_akkoladeDistance, Spatium(omr->staffDistance())));
Part* part = new Part(score);
Staff* staff = new Staff(score, part, 0);
part->staves()->push_back(staff);
score->staves().insert(0, staff);
staff = new Staff(score, part, 1);
part->staves()->push_back(staff);
score->staves().insert(1, staff);
part->staves()->front()->setBarLineSpan(part->nstaves());
score->insertPart(part, 0);
TDuration d(TDuration::V_MEASURE);
Measure* measure = 0;
int tick = 0;
foreach(const OmrPage* omrPage, omr->pages()) {
int nsystems = omrPage->systems().size();
int n = nsystems == 0 ? 1 : nsystems;
for (int k = 0; k < n; ++k) {
int numMeasures = 1;
if (k < nsystems) {
const OmrSystem& omrSystem = omrPage->systems().at(k);
numMeasures = omrSystem.barLines.size() - 1;
if (numMeasures < 1)
numMeasures = 1;
else if (numMeasures > 50) // sanity check
numMeasures = 50;
}
for (int i = 0; i < numMeasures; ++i) {
measure = new Measure(score);
measure->setTick(tick);
Rest* rest = new Rest(score, d);
rest->setDuration(Fraction(4,4));
rest->setTrack(0);
Segment* s = measure->getSegment(SegChordRest, tick);
s->add(rest);
rest = new Rest(score, d);
rest->setDuration(Fraction(4,4));
rest->setTrack(4);
s->add(rest);
score->measures()->add(measure);
tick += MScore::division * 4;
}
if (k < (nsystems-1)) {
LayoutBreak* b = new LayoutBreak(score);
b->setSubtype(LAYOUT_BREAK_LINE);
measure->add(b);
}
}
if (measure) {
LayoutBreak* b = new LayoutBreak(score);
b->setSubtype(LAYOUT_BREAK_PAGE);
measure->add(b);
}
}
//---create bracket
score->staff(0)->setBracket(0, BRACKET_AKKOLADE);
score->staff(0)->setBracketSpan(0, 2);
//---create clefs
measure = score->firstMeasure();
if (measure) {
Clef* clef = new Clef(score);
clef->setClefType(CLEF_G);
clef->setTrack(0);
Segment* segment = measure->getSegment(SegClef, 0);
segment->add(clef);
//.........这里部分代码省略.........
示例5: 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"));