| 2522 | } |
| 2523 | |
| 2524 | bool |
| 2525 | Node::handleFormatKnob(KnobI* knob) |
| 2526 | { |
| 2527 | KnobChoicePtr choice = _imp->pluginFormatKnobs.formatChoice.lock(); |
| 2528 | |
| 2529 | if (!choice) { |
| 2530 | return false; |
| 2531 | } |
| 2532 | |
| 2533 | if ( knob != choice.get() ) { |
| 2534 | return false; |
| 2535 | } |
| 2536 | if (choice->getIsSecret()) { |
| 2537 | return true; |
| 2538 | } |
| 2539 | int curIndex = choice->getValue(); |
| 2540 | Format f; |
| 2541 | if ( !getApp()->getProject()->getProjectFormatAtIndex(curIndex, &f) ) { |
| 2542 | assert(false); |
| 2543 | |
| 2544 | return true; |
| 2545 | } |
| 2546 | |
| 2547 | KnobIntPtr size = _imp->pluginFormatKnobs.size.lock(); |
| 2548 | KnobDoublePtr par = _imp->pluginFormatKnobs.par.lock(); |
| 2549 | assert(size && par); |
| 2550 | |
| 2551 | _imp->effect->beginChanges(); |
| 2552 | size->blockValueChanges(); |
| 2553 | size->setValues(f.width(), f.height(), ViewSpec::all(), eValueChangedReasonNatronInternalEdited); |
| 2554 | size->unblockValueChanges(); |
| 2555 | par->blockValueChanges(); |
| 2556 | par->setValue( f.getPixelAspectRatio() ); |
| 2557 | par->unblockValueChanges(); |
| 2558 | |
| 2559 | _imp->effect->endChanges(); |
| 2560 | |
| 2561 | return true; |
| 2562 | } |
| 2563 | |
| 2564 | void |
| 2565 | Node::refreshFormatParamChoice(const std::vector<ChoiceOption>& entries, |
no test coverage detected