本文整理汇总了C++中setSubtype函数的典型用法代码示例。如果您正苦于以下问题:C++ setSubtype函数的具体用法?C++ setSubtype怎么用?C++ setSubtype使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setSubtype函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSubtype
void Articulation::read(const QDomElement& de)
{
setSubtype(Articulation_Staccato); // default
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype")
setSubtype(val);
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
Direction dir = AUTO;
if (val == "up")
dir = UP;
else if (val == "down")
dir = DOWN;
else if (val == "auto")
dir = AUTO;
else
domError(e);
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
}
示例2: setSubtype
void Articulation::read(const QDomElement& de)
{
setSubtype(Articulation_Fermata); // default // backward compatibility (no type = ufermata in 1.2)
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype")
setSubtype(val);
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
MScore::Direction dir = MScore::AUTO;
if (val == "up")
dir = MScore::UP;
else if (val == "down")
dir = MScore::DOWN;
else if (val == "auto")
dir = MScore::AUTO;
else
domError(e);
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
}
示例3: setSubtype
void Articulation::read(QDomElement e)
{
setSubtype(0); // default
for (e = e.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
QString val(e.text());
if (tag == "idx") // obsolete
setSubtype(val.toInt());
else if (tag == "channel")
_channelName = e.attribute("name");
else if (tag == "anchor")
_anchor = ArticulationAnchor(val.toInt());
else if (tag == "direction") {
Direction dir = AUTO;
if (val == "up")
dir = UP;
else if (val == "down")
dir = DOWN;
else if (val == "auto")
dir = AUTO;
else
domError(e);
// printf("setDirection %s %d\n", qPrintable(val), int(dir));
setDirection(dir);
}
else if (!Element::readProperties(e))
domError(e);
}
/* if (subtype() == Articulation_Schleifer) {
printf("Schleifer %f %f\n", readPos().x(), readPos().y());
setReadPos(QPointF());
}
*/
}
示例4: staff
void BarLine::read(const QDomElement& de)
{
// if bar line belongs to a staff, span values default to staff values
if(staff()) {
_span = staff()->barLineSpan();
_spanFrom = staff()->barLineFrom();
_spanTo = staff()->barLineTo();
}
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
const QString& tag(e.tagName());
const QString& val(e.text());
if (tag == "subtype") {
bool ok;
int i = val.toInt(&ok);
if (!ok)
setSubtype(val);
else {
BarLineType ct = NORMAL_BAR;
switch (i) {
default:
case 0: ct = NORMAL_BAR; break;
case 1: ct = DOUBLE_BAR; break;
case 2: ct = START_REPEAT; break;
case 3: ct = END_REPEAT; break;
case 4: ct = BROKEN_BAR; break;
case 5: ct = END_BAR; break;
case 6: ct = END_START_REPEAT; break;
case 7: ct = DOTTED_BAR; break;
}
setSubtype(ct);
}
if(parent() && parent()->type() == SEGMENT) {
Measure* m = static_cast<Segment*>(parent())->measure();
if(subtype() != m->endBarLineType())
setCustomSubtype(true);
}
}
else if (tag == "customSubtype")
setCustomSubtype(val.toInt() != 0);
else if (tag == "span") {
_span = val.toInt();
_spanFrom = e.attribute("from", QString::number(_spanFrom)).toInt();
_spanTo = e.attribute("to", QString::number(_spanTo)).toInt();
// WARNING: following statements assume staff and staff bar line spans are correctly set
if(staff() && (_span != staff()->barLineSpan()
|| _spanFrom != staff()->barLineFrom() || _spanTo != staff()->barLineTo()))
_customSpan = true;
}
else if (tag == "Articulation") {
Articulation* a = new Articulation(score());
a->read(e);
add(a);
}
else if (!Element::readProperties(e))
domError(e);
}
}
示例5: sizeof
void Accidental::setSubtype(const QString& tag)
{
int n = sizeof(accList)/sizeof(*accList);
for (int i = 0; i < n; ++i) {
if (accList[i].tag == tag) {
setSubtype(AccidentalType(i));
return;
}
}
setSubtype(ACC_NONE);
}
示例6: setSubtype
void StaffState::setSubtype(const QString& s)
{
if (s == "instrument")
setSubtype(STAFF_STATE_INSTRUMENT);
else if (s == "type")
setSubtype(STAFF_STATE_TYPE);
else if (s == "visible")
setSubtype(STAFF_STATE_VISIBLE);
else if (s == "invisible")
setSubtype(STAFF_STATE_INVISIBLE);
}
示例7: QPainterPath
void ChordLine::read(const QDomElement& de)
{
path = QPainterPath();
for (QDomElement e = de.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
QString tag(e.tagName());
if (tag == "Path") {
path = QPainterPath();
QPointF curveTo;
QPointF p1;
int state = 0;
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
QString tag(ee.tagName());
if (tag == "Element") {
int type = ee.attribute("type").toInt();
qreal x = ee.attribute("x").toDouble();
qreal y = ee.attribute("y").toDouble();
switch(QPainterPath::ElementType(type)) {
case QPainterPath::MoveToElement:
path.moveTo(x, y);
break;
case QPainterPath::LineToElement:
path.lineTo(x, y);
break;
case QPainterPath::CurveToElement:
curveTo.rx() = x;
curveTo.ry() = y;
state = 1;
break;
case QPainterPath::CurveToDataElement:
if (state == 1) {
p1.rx() = x;
p1.ry() = y;
state = 2;
}
else if (state == 2) {
path.cubicTo(curveTo, p1, QPointF(x, y));
state = 0;
}
break;
}
}
else
domError(ee);
}
modified = true;
setSubtype(ChordLineType(0));
}
else if (tag == "subtype")
setSubtype(ChordLineType(e.text().toInt()));
else if (!Element::readProperties(e))
domError(e);
}
}
示例8: sizeof
void Dynamic::setSubtype(const QString& tag)
{
int n = sizeof(dynList)/sizeof(*dynList);
for (int i = 0; i < n; ++i) {
if (dynList[i].tag == tag) {
setSubtype(DynamicType(i));
setText(QString::fromUtf8(dynList[i].text));
return;
}
}
setSubtype(DYNAMIC_OTHER);
setText(tag);
}
示例9: Text
Marker::Marker(Score* s)
: Text(s)
{
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
setSubtype(TEXT_REPEAT);
setTextStyle(TEXT_STYLE_REPEAT);
}
示例10: setArticulationType
void Articulation::read(XmlReader& e)
{
setArticulationType(ArticulationType::Fermata); // default // backward compatibility (no type = ufermata in 1.2)
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "subtype")
setSubtype(e.readElementText());
else if (tag == "channel") {
_channelName = e.attribute("name");
e.readNext();
}
else if (tag == "anchor") {
_anchor = ArticulationAnchor(e.readInt());
anchorStyle = PropertyStyle::UNSTYLED;
}
else if (tag == "direction")
setProperty(P_ID::DIRECTION, Ms::getProperty(P_ID::DIRECTION, e));
else if ( tag == "ornamentStyle")
setProperty(P_ID::ORNAMENT_STYLE, Ms::getProperty(P_ID::ORNAMENT_STYLE, e));
else if ( tag == "play")
setPlayArticulation(e.readBool());
else if (tag == "timeStretch")
_timeStretch = e.readDouble();
else if (tag == "offset") {
if (score()->mscVersion() > 114)
Element::readProperties(e);
else
e.skipCurrentElement(); // ignore manual layout in older scores
}
else if (!Element::readProperties(e))
e.unknown();
}
}
示例11: VirtualCluster
CRMAcctCluster::CRMAcctCluster(QWidget* pParent, const char* pName) :
VirtualCluster(pParent, pName)
{
addNumberWidget(new CRMAcctLineEdit(this, pName));
setNameVisible(true);
setSubtype(CRMAcctLineEdit::Crmacct);
}
示例12: tag
bool LineSegment::readProperties(XmlReader& e)
{
const QStringRef& tag(e.name());
if (tag == "subtype")
setSubtype(SpannerSegmentType(e.readInt()));
else if (tag == "off1") // obsolete
setUserOff(e.readPoint() * spatium());
else if (tag == "off2")
setUserOff2(e.readPoint() * spatium());
else if (tag == "pos") {
if (score()->mscVersion() > 114) {
qreal _spatium = spatium();
setUserOff(QPointF());
setReadPos(e.readPoint() * _spatium);
}
else
e.readNext();
}
#if 0
else if (tag == "pos") {
QPointF rp = e.readPoint() * spatium();
if ((score()->mscVersion() <= 114) && (type() == VOLTA_SEGMENT)) {
rp.ry() -= spatium();
}
setReadPos(rp);
}
#endif
else if (!Element::readProperties(e)) {
e.unknown();
return false;
}
return true;
}
示例13: Being
NPC::NPC(int id, int subtype, Map *map):
Being(id, subtype, map)
{
setSubtype(subtype);
setShowName(true);
}
示例14: Text
Dynamic::Dynamic(const Dynamic& d)
: Text(d)
{
setSubtype(subtype());
_velocity = d._velocity;
_dynType = d._dynType;
}
示例15: mCurrentFrame
BackgroundSuppressionShell::BackgroundSuppressionShell() :
mCurrentFrame(0), mCurrentProgress(0.0), mProgressStep(1.0), mpRaster(NULL), mSingleForegroundMask(false), mpTemporaryBuffer(NULL)
{
setSubtype("Background Estimation");
setAbortSupported(true);
setWizardSupported(true);
mpAnimation.addSignal(SIGNAL_NAME(Animation, FrameChanged), Slot(this, &BackgroundSuppressionShell::processNextStreamingFrame));
}