本文整理汇总了C++中System::GetChildCount方法的典型用法代码示例。如果您正苦于以下问题:C++ System::GetChildCount方法的具体用法?C++ System::GetChildCount怎么用?C++ System::GetChildCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::GetChildCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertToCastOffMensural
int Measure::ConvertToCastOffMensural(FunctorParams *functorParams)
{
ConvertToCastOffMensuralParams *params = dynamic_cast<ConvertToCastOffMensuralParams *>(functorParams);
assert(params);
// We are processing by staff/layer from the call below - we obviously do not want to loop...
if (params->m_targetMeasure) {
return FUNCTOR_CONTINUE;
}
bool convertToMeasured = params->m_doc->GetOptions()->m_mensuralToMeasure.GetValue();
assert(params->m_targetSystem);
assert(params->m_layerTree);
// Create a temporary subsystem for receiving the measure segments
System targetSubSystem;
params->m_targetSubSystem = &targetSubSystem;
// Create the first measure segment - problem: we are dropping the section element - we should create a score-based
// MEI file instead
Measure *measure = new Measure(convertToMeasured);
if (convertToMeasured) {
measure->SetN(StringFormat("%d", params->m_segmentTotal + 1));
}
params->m_targetSubSystem->AddChild(measure);
ArrayOfComparisons filters;
// Now we can process by layer and move their content to (measure) segments
for (auto const &staves : params->m_layerTree->child) {
for (auto const &layers : staves.second.child) {
// Create ad comparison object for each type / @n
AttNIntegerComparison matchStaff(STAFF, staves.first);
AttNIntegerComparison matchLayer(LAYER, layers.first);
filters = { &matchStaff, &matchLayer };
params->m_segmentIdx = 1;
params->m_targetMeasure = measure;
Functor convertToCastOffMensural(&Object::ConvertToCastOffMensural);
this->Process(&convertToCastOffMensural, params, NULL, &filters);
}
}
params->m_targetMeasure = NULL;
params->m_targetSubSystem = NULL;
params->m_segmentTotal = targetSubSystem.GetChildCount();
// Copy the measure segments to the final target segment
params->m_targetSystem->MoveChildrenFrom(&targetSubSystem);
return FUNCTOR_SIBLINGS;
}