本文整理汇总了C++中MarkerItem::SetReg方法的典型用法代码示例。如果您正苦于以下问题:C++ MarkerItem::SetReg方法的具体用法?C++ MarkerItem::SetReg怎么用?C++ MarkerItem::SetReg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarkerItem
的用法示例。
在下文中一共展示了MarkerItem::SetReg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}