本文整理汇总了C++中Staff::SetN方法的典型用法代码示例。如果您正苦于以下问题:C++ Staff::SetN方法的具体用法?C++ Staff::SetN怎么用?C++ Staff::SetN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::SetN方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddChild
void Measure::AddChild(Object *child)
{
if (child->IsControlElement()) {
assert(dynamic_cast<ControlElement *>(child));
}
else if (child->IsEditorialElement()) {
assert(dynamic_cast<EditorialElement *>(child));
}
else if (child->Is(STAFF)) {
Staff *staff = dynamic_cast<Staff *>(child);
assert(staff);
if (staff && (staff->GetN() < 1)) {
// This is not 100% safe if we have a <app> and <rdg> with more than
// one staff as a previous child.
staff->SetN(this->GetChildCount());
}
}
else {
LogError("Adding '%s' to a '%s'", child->GetClassName().c_str(), this->GetClassName().c_str());
assert(false);
}
child->SetParent(this);
m_children.push_back(child);
Modify();
}
示例2: AddFloatingElement
void Measure::AddFloatingElement( FloatingElement *element )
{
element->SetParent( this );
m_children.push_back( element );
if (element->Is() == STAFF) {
Staff *staff = dynamic_cast<Staff*>(element);
assert( staff );
if ( staff->GetN() < 1) {
// This is not 100% safe if we have a <app> and <rdg> with more than
// one staff as a previous child.
staff->SetN( this->GetChildCount() );
}
}
}