| 340 | } |
| 341 | |
| 342 | void |
| 343 | ReadNodePrivate::placeReadNodeKnobsInPage() |
| 344 | { |
| 345 | KnobIPtr pageKnob = _publicInterface->getKnobByName("Controls"); |
| 346 | KnobPage* isPage = dynamic_cast<KnobPage*>( pageKnob.get() ); |
| 347 | |
| 348 | if (!isPage) { |
| 349 | return; |
| 350 | } |
| 351 | for (std::list<KnobIWPtr>::iterator it = readNodeKnobs.begin(); it != readNodeKnobs.end(); ++it) { |
| 352 | KnobIPtr knob = it->lock(); |
| 353 | knob->setParentKnob( KnobIPtr() ); |
| 354 | isPage->removeKnob( knob.get() ); |
| 355 | } |
| 356 | |
| 357 | KnobsVec children = isPage->getChildren(); |
| 358 | int index = -1; |
| 359 | for (std::size_t i = 0; i < children.size(); ++i) { |
| 360 | if (children[i]->getName() == kParamCustomFps) { |
| 361 | index = i; |
| 362 | break; |
| 363 | } |
| 364 | } |
| 365 | if (index != -1) { |
| 366 | ++index; |
| 367 | for (std::list<KnobIWPtr>::iterator it = readNodeKnobs.begin(); it != readNodeKnobs.end(); ++it) { |
| 368 | KnobIPtr knob = it->lock(); |
| 369 | isPage->insertKnob(index, knob); |
| 370 | ++index; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | children = isPage->getChildren(); |
| 375 | // Find the separatorKnob in the page and if the next parameter is also a separator, hide it |
| 376 | int foundSep = -1; |
| 377 | for (std::size_t i = 0; i < children.size(); ++i) { |
| 378 | if (children[i]== separatorKnob.lock()) { |
| 379 | foundSep = i; |
| 380 | break; |
| 381 | } |
| 382 | } |
| 383 | if (foundSep != -1) { |
| 384 | ++foundSep; |
| 385 | if (foundSep < (int)children.size()) { |
| 386 | bool isSecret = children[foundSep]->getIsSecret(); |
| 387 | while (isSecret && foundSep < (int)children.size()) { |
| 388 | ++foundSep; |
| 389 | isSecret = children[foundSep]->getIsSecret(); |
| 390 | } |
| 391 | if (foundSep < (int)children.size()) { |
| 392 | separatorKnob.lock()->setSecret(dynamic_cast<KnobSeparator*>(children[foundSep].get())); |
| 393 | } else { |
| 394 | separatorKnob.lock()->setSecret(true); |
| 395 | } |
| 396 | |
| 397 | } else { |
| 398 | separatorKnob.lock()->setSecret(true); |
| 399 | } |
nothing calls this directly
no test coverage detected