当前位置: 首页>>代码示例>>C++>>正文


C++ WaveTrack::cparts方法代码示例

本文整理汇总了C++中WaveTrack::cparts方法的典型用法代码示例。如果您正苦于以下问题:C++ WaveTrack::cparts方法的具体用法?C++ WaveTrack::cparts怎么用?C++ WaveTrack::cparts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WaveTrack的用法示例。


在下文中一共展示了WaveTrack::cparts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: chainCloneInternal

void chainCloneInternal(Part* p)
{
	Track* t = p->track();
	Part* p1 = 0;

	// Look for a part with the same event list, that we can chain to.
	// It's faster if track type is known...

	if (!t || (t && t->isMidiTrack()))
	{
		MidiTrack* mt = 0;
		MidiTrackList* mtl = song->midis();
		for (ciMidiTrack imt = mtl->begin(); imt != mtl->end(); ++imt)
		{
			mt = *imt;
			const PartList* pl = mt->cparts();
			for (ciPart ip = pl->begin(); ip != pl->end(); ++ip)
			{
				// Added by Tim. p3.3.6
				//printf("chainCloneInternal track %p %s part %p %s evlist %p\n", (*imt), (*imt)->name().toLatin1().constData(), ip->second, ip->second->name().toLatin1().constData(), ip->second->cevents());

				if (ip->second != p && ip->second->cevents() == p->cevents())
				{
					p1 = ip->second;
					break;
				}
			}
			// If a suitable part was found on a different track, we're done. We will chain to it.
			// Otherwise keep looking for parts on another track. If no others found, then we
			//  chain to any suitable part which was found on the same given track t.
			if (p1 && mt != t)
				break;
		}
	}
	if ((!p1 && !t) || (t && t->type() == Track::WAVE))
	{
		WaveTrack* wt = 0;
		WaveTrackList* wtl = song->waves();
		for (ciWaveTrack iwt = wtl->begin(); iwt != wtl->end(); ++iwt)
		{
			wt = *iwt;
			const PartList* pl = wt->cparts();
			for (ciPart ip = pl->begin(); ip != pl->end(); ++ip)
			{
				if (ip->second != p && ip->second->cevents() == p->cevents())
				{
					p1 = ip->second;
					break;
				}
			}
			if (p1 && wt != t)
				break;
		}
	}

	// No part found with same event list? Done.
	if (!p1)
		return;

	// Make sure the part to be chained is unchained first.
	p->prevClone()->setNextClone(p->nextClone());
	p->nextClone()->setPrevClone(p->prevClone());

	// Link the part to be chained.
	p->setPrevClone(p1);
	p->setNextClone(p1->nextClone());

	// Re-link the existing part.
	p1->nextClone()->setPrevClone(p);
	p1->setNextClone(p);
}
开发者ID:faesong,项目名称:oom,代码行数:71,代码来源:part.cpp


注:本文中的WaveTrack::cparts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。