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


C++ MarkerItem::IsRegion方法代码示例

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


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

示例1: CropToTimeSel

void MarkerList::CropToTimeSel(bool bOffset)
{
	double dStart, dEnd;
	GetSet_LoopTimeRange(false, false, &dStart, &dEnd, false);
	// If no time sel just return
	if (dStart == dEnd)
		return;

	// Don't crop the end of regions
	for (int i = 0; i < m_items.GetSize(); i++)
	{
		MarkerItem* item = m_items.Get(i);
		if (item->GetPos() > dEnd ||
			(!item->IsRegion() && item->GetPos() < dStart) ||
			(item->IsRegion()  && item->GetRegEnd() < dStart))
		{ // delete the item
			m_items.Delete(i, true);
			i--;
		}
		else
		{
			if (item->IsRegion() && item->GetPos() < dStart && item->GetRegEnd() >= dStart)
				item->SetPos(dStart);
			
			if (bOffset)
			{
				item->SetPos(item->GetPos() - dStart);
				if (item->IsRegion())
					item->SetRegEnd(item->GetRegEnd() - dStart);
			}
		}
	}
}
开发者ID:tweed,项目名称:sws,代码行数:33,代码来源:MarkerListClass.cpp

示例2: MarkersToRegions

void MarkersToRegions(COMMAND_T* ct)
{
	MarkerList ml(NULL, true);

	WDL_PtrList<MarkerItem> &markers = ml.m_items;

	if(markers.GetSize() == 0) return; // Bail if there are no markers/regions

	double projEnd = SNM_GetProjectLength();

	Undo_BeginBlock2(NULL);

	// Insert dummy marker at project start if necessary
	if(markers.Get(0)->GetPos() > 0)
	{
		markers.Insert(0, new MarkerItem(false, 0, 0, "", 0, 0));
	}

	// Convert markers to regions
	for(int i = 0, c = markers.GetSize(); i < c; i++)
	{
		MarkerItem *pm = markers.Get(i);
		if(!pm->IsRegion())
		{
			// Find next marker
			MarkerItem *pNext = NULL;
			int n = i + 1;
			do
			{
				pNext = markers.Get(n++);
			}
			while(pNext && pNext->IsRegion());

			double pos = pm->GetPos();
			double end = pNext ? pNext->GetPos() : projEnd;

			if(pos != end)
			{
				pm->SetReg(true);
				pm->SetRegEnd(end);
			}
		}
	}

	ml.UpdateReaper();

	Undo_EndBlock2(NULL, __LOCALIZE("Convert markers to regions","sws_undo"), UNDO_STATE_MISCCFG);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:48,代码来源:MarkerListActions.cpp

示例3: SelPrevMarkerOrRegion

void SelPrevMarkerOrRegion(COMMAND_T*)
{
	// Save the current marker list so we can traverse the list bacwards
	MarkerList ml(NULL, true);

	double dCurPos = GetCursorPosition();
	double dCurStart, dCurEnd;
	GetSet_LoopTimeRange(false, false, &dCurStart, &dCurEnd, false);
	bool bCurSel = dCurStart != dCurEnd;
	for (int i = ml.m_items.GetSize()-1; i >= 0; i--)
	{
		MarkerItem* mi = ml.m_items.Get(i);
		if (mi->GetPos() < dCurPos || (!mi->IsRegion() && mi->GetPos() <= dCurPos && bCurSel))
		{
			double dNewStart = mi->GetPos(), dNewEnd = mi->GetRegEnd();
			GetSet_LoopTimeRange(true, false, &dNewStart, mi->IsRegion() ? &dNewEnd : &dNewStart, false);
			SetEditCurPos(mi->GetPos(), true, true);
			return;
		}
	}
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:21,代码来源:MarkerListActions.cpp

示例4: RenumberRegions

void RenumberRegions(COMMAND_T* ct)
{
	MarkerList ml(NULL, true);
	DeleteAllRegions();
	int iID = 1;
	for (int i = 0; i < ml.m_items.GetSize(); i++)
	{
		MarkerItem* mi = ml.m_items.Get(i);
		if (mi->IsRegion())
		{
			mi->SetNum(iID++);
			mi->AddToProject();
		}
	}
	g_pMarkerList->Update();
	UpdateTimeline();
	Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(ct), UNDO_STATE_MISCCFG, -1);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:18,代码来源:MarkerListActions.cpp

示例5: RegionsToMarkers

void RegionsToMarkers(COMMAND_T*)
{
	MarkerList ml(NULL, true);

	WDL_PtrList<MarkerItem> &markers = ml.m_items;

	if(markers.GetSize() == 0) return; // Bail if there are no markers/regions

	Undo_BeginBlock2(NULL);

	for(int i = 0, c = markers.GetSize(); i < c; i++)
	{
		MarkerItem *pm = markers.Get(i);

		if(pm->IsRegion())
		{
			pm->SetReg(false);
		}
	}

	ml.UpdateReaper();

	Undo_EndBlock2(NULL, __LOCALIZE("Convert regions to markers","sws_undo"), UNDO_STATE_MISCCFG);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:24,代码来源:MarkerListActions.cpp


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