void KnobGuiFile::createWidget(QHBoxLayout* layout) { KnobGuiPtr knobUI = getKnobGui(); if (!knobUI) { return; } Gui* gui = knobUI->getGui(); if (!gui) { return; } GuiAppInstancePtr app = gui->getApp(); if (!app) { return; } KnobFilePtr knob = _knob.lock(); if (!knob) { return; } EffectInstancePtr holderIsEffect = toEffectInstance( knob->getHolder() ); if ( holderIsEffect && holderIsEffect->isReader() && (knob->getName() == kOfxImageEffectFileParamName) ) { TimeLinePtr timeline = app->getTimeLine(); QObject::connect( timeline.get(), SIGNAL(frameChanged(SequenceTime,int)), this, SLOT(onTimelineFrameChanged(SequenceTime,int)) ); }
void AnimationModule::addNode(const NodeGuiPtr& nodeGui) { // Check if it already exists for (std::list<NodeAnimPtr>::const_iterator it = _imp->nodes.begin(); it != _imp->nodes.end(); ++it) { if ((*it)->getNodeGui() == nodeGui) { (*it)->refreshVisibility(); return; } } // Determinate the node type // It will be useful to identify and sort tree items AnimatedItemTypeEnum nodeType = eAnimatedItemTypeCommon; NodePtr node = nodeGui->getNode(); assert(node && node->getGroup()); if ( !node || !node->getGroup() ) { return; } EffectInstancePtr effectInstance = node->getEffectInstance(); // Don't add an item for this node if it doesn't have any knob that may animate //if ( !getNodeCanAnimate(node) ) { // return; //} std::string pluginID = node->getPluginID(); NodeGroupPtr isGroup = toNodeGroup(effectInstance); if (effectInstance->isReader()) { nodeType = eAnimatedItemTypeReader; } else if (isGroup) { nodeType = eAnimatedItemTypeGroup; } else if (pluginID == PLUGINID_OFX_RETIME) { nodeType = eAnimatedItemTypeRetime; } else if (pluginID == PLUGINID_OFX_TIMEOFFSET) { nodeType = eAnimatedItemTypeTimeOffset; } else if (pluginID == PLUGINID_OFX_FRAMERANGE) { nodeType = eAnimatedItemTypeFrameRange; } // The NodeAnim should not be created if there's no settings panel. assert(nodeGui->getSettingPanel()); NodeAnimPtr anim(NodeAnim::create(toAnimationModule(shared_from_this()), nodeType, nodeGui) ); _imp->nodes.push_back(anim); Q_EMIT nodeAdded(anim); } // AnimationModule::addNode