本文整理汇总了C++中Accidental类的典型用法代码示例。如果您正苦于以下问题:C++ Accidental类的具体用法?C++ Accidental怎么用?C++ Accidental使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Accidental类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Accidental
Palette* MuseScore::newAccidentalsPalette()
{
Palette* sp = new Palette;
sp->setName(qApp->translate("accidental", "Accidentals"));
sp->setGrid(33, 36);
sp->setDrawGrid(true);
for (int i = Accidental::ACC_SHARP; i < Accidental::ACC_END; ++i) {
Accidental* s = new Accidental(gscore);
s->setSubtype(Accidental::AccidentalType(i));
sp->append(s, qApp->translate("accidental", s->subtypeUserName()));
}
AccidentalBracket* ab = new AccidentalBracket(gscore);
sp->append(ab, qApp->translate("accidental", "round bracket"));
return sp;
}
示例2: Accidental
Palette* MuseScore::newAccidentalsPalette()
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Accidentals"));
sp->setGrid(33, 36);
sp->setDrawGrid(true);
for (int i = Accidental::ACC_SHARP; i < Accidental::ACC_END; ++i) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(Accidental::AccidentalType(i));
sp->append(s, s->subtypeUserName());
}
AccidentalBracket* ab = new AccidentalBracket(gscore);
sp->append(ab, QT_TRANSLATE_NOOP("Palette", "round bracket"));
return sp;
}
示例3: Accidental
Palette* MuseScore::newAccidentalsPalette(bool basic)
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Accidentals"));
sp->setGrid(33, 36);
sp->setDrawGrid(true);
if (basic) {
static Accidental::AccidentalType types[] = {
Accidental::ACC_NONE,
Accidental::ACC_SHARP,
Accidental::ACC_FLAT,
Accidental::ACC_SHARP2,
Accidental::ACC_FLAT2,
Accidental::ACC_NATURAL
};
for (auto i : types) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(Accidental::AccidentalType(i));
sp->append(s, s->subtypeUserName());
}
}
else {
for (int i = Accidental::ACC_SHARP; i < Accidental::ACC_END; ++i) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(Accidental::AccidentalType(i));
sp->append(s, s->subtypeUserName());
}
}
AccidentalBracket* ab = new AccidentalBracket(gscore);
sp->append(ab, QT_TRANSLATE_NOOP("Palette", "round bracket"));
return sp;
}
示例4: setMag
void TrillSegment::layout()
{
if (staff())
setMag(staff()->mag(tick()));
if (isSingleType() || isBeginType()) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium * 1.3, -2.2 * _spatium);
a->setParent(this);
}
switch (trill()->trillType()) {
case Trill::Type::TRILL_LINE:
symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);
break;
case Trill::Type::PRALLPRALL_LINE:
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
break;
case Trill::Type::UPPRALL_LINE:
symbolLine(SymId::ornamentBottomLeftConcaveStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
case Trill::Type::DOWNPRALL_LINE:
symbolLine(SymId::ornamentLeftVerticalStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
}
}
else
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
autoplaceSpannerSegment();
}
示例5: setUserOff
void TrillSegment::layout()
{
if (autoplace())
setUserOff(QPointF());
if (staff())
setMag(staff()->mag(tick()));
if (isSingleType() || isBeginType()) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium * 1.3, -2.2 * _spatium);
a->setParent(this);
}
switch (trill()->trillType()) {
case Trill::Type::TRILL_LINE:
symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);
break;
case Trill::Type::PRALLPRALL_LINE:
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
break;
case Trill::Type::UPPRALL_LINE:
symbolLine(SymId::ornamentBottomLeftConcaveStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
case Trill::Type::DOWNPRALL_LINE:
symbolLine(SymId::ornamentLeftVerticalStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
break;
}
}
else
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
if (parent()) {
qreal yo = score()->styleP(trill()->placeBelow() ? Sid::trillPosBelow : Sid::trillPosAbove);
rypos() = yo;
if (autoplace()) {
qreal minDistance = spatium();
Shape s1 = shape().translated(pos());
if (trill()->placeAbove()) {
qreal d = system()->topDistance(staffIdx(), s1);
if (d > -minDistance)
rUserYoffset() = -d - minDistance;
}
else {
qreal d = system()->bottomDistance(staffIdx(), s1);
if (d > -minDistance)
rUserYoffset() = d + minDistance;
}
}
}
}
示例6: Accidental
Palette* MuseScore::newAccidentalsPalette(bool basic)
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Accidentals"));
sp->setGrid(33, 36);
sp->setDrawGrid(true);
if (basic) {
static AccidentalType types[] = {
AccidentalType::NONE,
AccidentalType::SHARP,
AccidentalType::FLAT,
AccidentalType::SHARP2,
AccidentalType::FLAT2,
AccidentalType::NATURAL
};
for (auto i : types) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(AccidentalType(i));
sp->append(s, qApp->translate("accidental", s->subtypeUserName()));
}
}
else {
for (int i = int(AccidentalType::SHARP); i < int(AccidentalType::END); ++i) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(AccidentalType(i));
if (s->symbol() != SymId::noSym)
sp->append(s, qApp->translate("accidental", s->subtypeUserName()));
else
delete s;
}
}
Icon* ik = new Icon(gscore);
ik->setIconType(IconType::BRACKETS);
const Shortcut* s = Shortcut::getShortcut("add-brackets");
QAction* action = s->action();
QIcon icon(action->icon());
ik->setAction("add-brackets", icon);
sp->append(ik, s->help());
return sp;
}
示例7: rypos
void TrillSegment::layout()
{
if (parent())
rypos() += score()->styleS(StyleIdx::trillY).val() * spatium();
if (staff())
setMag(staff()->mag());
if (spannerSegmentType() == SpannerSegmentType::SINGLE || spannerSegmentType() == SpannerSegmentType::BEGIN) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium * 1.3, -2.2 * _spatium);
a->adjustReadPos();
}
switch (trill()->trillType()) {
case Trill::Type::TRILL_LINE:
symbolLine(SymId::ornamentTrill, SymId::wiggleTrill);
break;
case Trill::Type::PRALLPRALL_LINE:
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
break;
case Trill::Type::UPPRALL_LINE:
if (score()->scoreFont()->isValid(SymId::ornamentBottomLeftConcaveStroke))
symbolLine(SymId::ornamentBottomLeftConcaveStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
else
symbolLine(SymId::ornamentUpPrall,
// SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
SymId::ornamentZigZagLineNoRightEnd);
break;
case Trill::Type::DOWNPRALL_LINE:
if (score()->scoreFont()->isValid(SymId::ornamentLeftVerticalStroke))
symbolLine(SymId::ornamentLeftVerticalStroke,
SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
else
symbolLine(SymId::ornamentDownPrall,
// SymId::ornamentZigZagLineNoRightEnd, SymId::ornamentZigZagLineWithRightEnd);
SymId::ornamentZigZagLineNoRightEnd);
break;
}
}
else
symbolLine(SymId::wiggleTrill, SymId::wiggleTrill);
adjustReadPos();
}
示例8: b1
void TrillSegment::layout()
{
QRectF b1(symBbox(SymId::ornamentTrill));
QRectF rr(b1.translated(-b1.x(), 0.0));
rr |= QRectF(0.0, rr.y(), pos2().x(), rr.height());
setbbox(rr);
if (parent())
rypos() += score()->styleS(ST_trillY).val() * spatium();
if (spannerSegmentType() == SEGMENT_SINGLE || spannerSegmentType() == SEGMENT_BEGIN) {
Accidental* a = trill()->accidental();
if (a) {
a->layout();
a->setMag(a->mag() * .6);
qreal _spatium = spatium();
a->setPos(_spatium*1.3, -2.2*_spatium);
a->adjustReadPos();
}
}
adjustReadPos();
}
示例9: Accidental
Palette* MuseScore::newAccidentalsPalette(bool basic)
{
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Accidentals"));
sp->setGrid(33, 36);
sp->setDrawGrid(true);
if (basic) {
static Accidental::Type types[] = {
Accidental::Type::NONE,
Accidental::Type::SHARP,
Accidental::Type::FLAT,
Accidental::Type::SHARP2,
Accidental::Type::FLAT2,
Accidental::Type::NATURAL
};
for (auto i : types) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(Accidental::Type(i));
sp->append(s, s->subtypeUserName());
}
}
else {
for (int i = int(Accidental::Type::SHARP); i < int(Accidental::Type::END); ++i) {
Accidental* s = new Accidental(gscore);
s->setAccidentalType(Accidental::Type(i));
if (s->symbol() != SymId::noSym)
sp->append(s, s->subtypeUserName());
else
delete s;
}
}
AccidentalBracket* ab = new AccidentalBracket(gscore);
sp->append(ab, QT_TRANSLATE_NOOP("Palette", "round brackets"));
return sp;
}
示例10: genPropertyMenu1
void ScoreView::createElementPropertyMenu(Element* e, QMenu* popup)
{
if (e->type() == Element::BAR_LINE) {
genPropertyMenu1(e, popup);
}
else if (e->type() == Element::ARTICULATION) {
genPropertyMenu1(e, popup);
popup->addAction(tr("Articulation Properties..."))->setData("a-props");
}
else if (e->type() == Element::BEAM) {
popup->addAction(getAction("flip"));
}
else if (e->type() == Element::STEM) {
popup->addAction(getAction("flip"));
}
else if (e->type() == Element::HOOK) {
popup->addAction(getAction("flip"));
}
else if (e->type() == Element::BEND) {
genPropertyMenu1(e, popup);
popup->addAction(tr("Bend Properties..."))->setData("b-props");
}
else if (e->type() == Element::TREMOLOBAR) {
genPropertyMenu1(e, popup);
popup->addAction(tr("TremoloBar Properties..."))->setData("tr-props");
}
else if (e->type() == Element::HBOX) {
QMenu* textMenu = popup->addMenu(tr("Add"));
textMenu->addAction(getAction("frame-text"));
textMenu->addAction(getAction("picture"));
popup->addAction(tr("Frame Properties..."))->setData("f-props");
}
else if (e->type() == Element::VBOX) {
QMenu* textMenu = popup->addMenu(tr("Add"));
textMenu->addAction(getAction("frame-text"));
textMenu->addAction(getAction("title-text"));
textMenu->addAction(getAction("subtitle-text"));
textMenu->addAction(getAction("composer-text"));
textMenu->addAction(getAction("poet-text"));
textMenu->addAction(getAction("insert-hbox"));
textMenu->addAction(getAction("picture"));
popup->addAction(tr("Frame Properties..."))->setData("f-props");
}
else if (e->type() == Element::TBOX) {
popup->addAction(tr("Frame Properties..."))->setData("f-props");
}
else if (e->type() == Element::VOLTA_SEGMENT) {
genPropertyMenu1(e, popup);
popup->addAction(tr("Volta Properties..."))->setData("v-props");
}
else if (e->type() == Element::TIMESIG) {
genPropertyMenu1(e, popup);
TimeSig* ts = static_cast<TimeSig*>(e);
int _track = ts->track();
// if the time sig. is not generated (= not courtesy) and is in track 0
// add the specific menu item
QAction* a;
if (!ts->generated() && !_track) {
a = popup->addAction(ts->showCourtesySig()
? QT_TRANSLATE_NOOP("TimeSig", "Hide Courtesy Time Signature")
: QT_TRANSLATE_NOOP("TimeSig", "Show Courtesy Time Signature") );
a->setData("ts-courtesy");
}
popup->addSeparator();
popup->addAction(tr("Time Signature Properties..."))->setData("ts-props");
}
else if (e->type() == Element::ACCIDENTAL) {
Accidental* acc = static_cast<Accidental*>(e);
genPropertyMenu1(e, popup);
QAction* a = popup->addAction(QT_TRANSLATE_NOOP("Properties", "small"));
a->setCheckable(true);
a->setChecked(acc->small());
a->setData("smallAcc");
}
else if (e->type() == Element::CLEF) {
genPropertyMenu1(e, popup);
// if the clef is not generated (= not courtesy) add the specific menu item
if (!e->generated()) {
QAction* a = popup->addAction(static_cast<Clef*>(e)->showCourtesy()
? QT_TRANSLATE_NOOP("Clef", "Hide courtesy clef")
: QT_TRANSLATE_NOOP("Clef", "Show courtesy clef") );
a->setData("clef-courtesy");
}
}
else if (e->type() == Element::DYNAMIC) {
popup->addSeparator();
if (e->visible())
popup->addAction(tr("Set Invisible"))->setData("invisible");
else
popup->addAction(tr("Set Visible"))->setData("invisible");
popup->addAction(tr("MIDI Properties..."))->setData("d-dynamics");
popup->addAction(tr("Text Properties..."))->setData("d-props");
}
else if (e->type() == Element::TEXTLINE_SEGMENT
|| e->type() == Element::OTTAVA_SEGMENT
|| e->type() == Element::VOLTA_SEGMENT
|| e->type() == Element::PEDAL_SEGMENT) {
if (e->visible())
popup->addAction(tr("Set Invisible"))->setData("invisible");
else
//.........这里部分代码省略.........