| 676 | } |
| 677 | |
| 678 | Node::CanConnectInputReturnValue |
| 679 | Node::canConnectInput(const NodePtr& input, |
| 680 | int inputNumber) const |
| 681 | { |
| 682 | ///No-one is allowed to connect to the other node |
| 683 | if ( !input || !input->canOthersConnectToThisNode() ) { |
| 684 | return eCanConnectInput_givenNodeNotConnectable; |
| 685 | } |
| 686 | |
| 687 | ///Check for invalid index |
| 688 | { |
| 689 | QMutexLocker l(&_imp->inputsMutex); |
| 690 | if ( (inputNumber < 0) || ( inputNumber >= (int)_imp->guiInputs.size() ) ) { |
| 691 | return eCanConnectInput_indexOutOfRange; |
| 692 | } |
| 693 | if ( _imp->guiInputs[inputNumber].lock() ) { |
| 694 | return eCanConnectInput_inputAlreadyConnected; |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | NodeGroup* isGrp = input->isEffectGroup(); |
| 699 | if ( isGrp && !isGrp->getOutputNode(true) ) { |
| 700 | return eCanConnectInput_groupHasNoOutput; |
| 701 | } |
| 702 | |
| 703 | if ( getParentMultiInstance() || input->getParentMultiInstance() ) { |
| 704 | return eCanConnectInput_inputAlreadyConnected; |
| 705 | } |
| 706 | |
| 707 | ///Applying this connection would create cycles in the graph |
| 708 | if ( !checkIfConnectingInputIsOk( input.get() ) ) { |
| 709 | return eCanConnectInput_graphCycles; |
| 710 | } |
| 711 | |
| 712 | if ( _imp->effect->isInputRotoBrush(inputNumber) ) { |
| 713 | qDebug() << "Debug: Attempt to connect " << input->getScriptName_mt_safe().c_str() << " to Roto brush"; |
| 714 | |
| 715 | return eCanConnectInput_indexOutOfRange; |
| 716 | } |
| 717 | |
| 718 | if ( !_imp->effect->supportsMultiResolution() ) { |
| 719 | CanConnectInputReturnValue ret = checkCanConnectNoMultiRes(this, input); |
| 720 | if (ret != eCanConnectInput_ok) { |
| 721 | return ret; |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | { |
| 726 | ///Check for invalid pixel aspect ratio if the node doesn't support multiple clip PARs |
| 727 | |
| 728 | double inputPAR = input->getEffectInstance()->getAspectRatio(-1); |
| 729 | double inputFPS = input->getEffectInstance()->getFrameRate(); |
| 730 | QMutexLocker l(&_imp->inputsMutex); |
| 731 | |
| 732 | for (InputsV::const_iterator it = _imp->guiInputs.begin(); it != _imp->guiInputs.end(); ++it) { |
| 733 | NodePtr node = it->lock(); |
| 734 | if (node) { |
| 735 | if ( !_imp->effect->supportsMultipleClipPARs() ) { |
nothing calls this directly
no test coverage detected