本文整理汇总了C++中Tuplet::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuplet::remove方法的具体用法?C++ Tuplet::remove怎么用?C++ Tuplet::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuplet
的用法示例。
在下文中一共展示了Tuplet::remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeElement
void Segment::removeElement(int track)
{
Element* el = element(track);
if (el->isChordRest()) {
ChordRest* cr = (ChordRest*)el;
Beam* beam = cr->beam();
if (beam)
beam->remove(cr);
Tuplet* tuplet = cr->tuplet();
if (tuplet)
tuplet->remove(cr);
}
}
示例2: applySwing
void SwingDetector::applySwing()
{
if (elements.size() != 2 && elements.size() != 3)
return;
Tuplet *tuplet = nullptr;
for (ChordRest *el: elements) {
el->setDurationType(TDuration::DurationType::V_EIGHTH);
el->setTicks(Fraction(1, 8));
el->setDots(0);
if (el->tuplet()) {
if (!tuplet)
tuplet = el->tuplet();
tuplet->remove(el);
el->setTuplet(nullptr);
}
}
const ChordRest *first = elements.front();
const int startTick = first->segment()->tick().ticks();
ChordRest *last = elements.back();
last->segment()->remove(last);
Segment *s = last->measure()->getSegment(SegmentType::ChordRest, Fraction::fromTicks(startTick + MScore::division / 2));
s->add(last);
if (elements.size() == 3) {
// remove central rest
ChordRest *cr = elements[1];
cr->score()->removeElement(cr);
delete cr;
}
if (tuplet) {
// delete tuplet
delete tuplet;
tuplet = nullptr;
}
if (!swingApplied)
swingApplied = true;
}