本文整理汇总了C++中Part::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ Part::frame方法的具体用法?C++ Part::frame怎么用?C++ Part::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::frame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmdGluePart
void Song::cmdGluePart(Track* track, Part* oPart)
{
// p3.3.54
if (track->type() != Track::WAVE && !track->isMidiTrack())
return;
PartList* pl = track->parts();
Part* nextPart = 0;
for (iPart ip = pl->begin(); ip != pl->end(); ++ip)
{
if (ip->second == oPart)
{
++ip;
if (ip == pl->end())
return;
nextPart = ip->second;
break;
}
}
Part* nPart = track->newPart(oPart);
nPart->setLenTick(nextPart->tick() + nextPart->lenTick() - oPart->tick());
// populate nPart with Events from oPart and nextPart
EventList* sl1 = oPart->events();
EventList* dl = nPart->events();
for (iEvent ie = sl1->begin(); ie != sl1->end(); ++ie)
dl->add(ie->second);
EventList* sl2 = nextPart->events();
//int frameOffset = nextPart->frame() - oPart->frame();
//for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) {
// Event event = ie->second.clone();
// event.setFrame(event.frame() + frameOffset);
// dl->add(event);
// }
// p3.3.54 Changed.
if (track->type() == Track::WAVE)
{
int frameOffset = nextPart->frame() - oPart->frame();
for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie)
{
Event event = ie->second.clone();
event.setFrame(event.frame() + frameOffset);
dl->add(event);
}
}
else
if (track->isMidiTrack())
{
int tickOffset = nextPart->tick() - oPart->tick();
for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie)
{
Event event = ie->second.clone();
event.setTick(event.tick() + tickOffset);
dl->add(event);
}
}
startUndo();
audio->msgRemovePart(nextPart, false);
// Indicate no undo, and do port controller values but not clone parts.
//audio->msgChangePart(oPart, nPart, false);
audio->msgChangePart(oPart, nPart, false, true, false);
endUndo(SC_PART_MODIFIED | SC_PART_REMOVED);
}