| 1317 | } |
| 1318 | |
| 1319 | void |
| 1320 | NodeGroup::notifyNodeDeactivated(const NodePtr& node) |
| 1321 | { |
| 1322 | if ( getIsDeactivatingGroup() ) { |
| 1323 | return; |
| 1324 | } |
| 1325 | NodePtr thisNode = getNode(); |
| 1326 | |
| 1327 | { |
| 1328 | QMutexLocker k(&_imp->nodesLock); |
| 1329 | GroupInput* isInput = dynamic_cast<GroupInput*>( node->getEffectInstance().get() ); |
| 1330 | if (isInput) { |
| 1331 | for (U32 i = 0; i < _imp->inputs.size(); ++i) { |
| 1332 | NodePtr input = _imp->inputs[i].lock(); |
| 1333 | if (node == input) { |
| 1334 | ///Also disconnect the real input |
| 1335 | |
| 1336 | thisNode->disconnectInput(i); |
| 1337 | |
| 1338 | |
| 1339 | _imp->inputs.erase(_imp->inputs.begin() + i); |
| 1340 | thisNode->initializeInputs(); |
| 1341 | |
| 1342 | return; |
| 1343 | } |
| 1344 | } |
| 1345 | ///The input must have been tracked before |
| 1346 | assert(false); |
| 1347 | } |
| 1348 | GroupOutput* isOutput = dynamic_cast<GroupOutput*>( node->getEffectInstance().get() ); |
| 1349 | if (isOutput) { |
| 1350 | for (NodesWList::iterator it = _imp->outputs.begin(); it != _imp->outputs.end(); ++it) { |
| 1351 | if (it->lock()->getEffectInstance().get() == isOutput) { |
| 1352 | _imp->outputs.erase(it); |
| 1353 | break; |
| 1354 | } |
| 1355 | } |
| 1356 | } |
| 1357 | |
| 1358 | ///Sync gui inputs/outputs |
| 1359 | _imp->guiInputs = _imp->inputs; |
| 1360 | _imp->guiOutputs = _imp->outputs; |
| 1361 | } |
| 1362 | |
| 1363 | ///Notify outputs of the group nodes that their inputs may have changed |
| 1364 | const NodesWList& outputs = thisNode->getOutputs(); |
| 1365 | for (NodesWList::const_iterator it = outputs.begin(); it != outputs.end(); ++it) { |
| 1366 | NodePtr output = it->lock(); |
| 1367 | if (!output) { |
| 1368 | continue; |
| 1369 | } |
| 1370 | int idx = output->getInputIndex( thisNode.get() ); |
| 1371 | assert(idx != -1); |
| 1372 | output->onInputChanged(idx); |
| 1373 | } |
| 1374 | } // NodeGroup::notifyNodeDeactivated |
| 1375 | |
| 1376 | void |
no test coverage detected