本文整理汇总了C++中NodeRef::configureConnections方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeRef::configureConnections方法的具体用法?C++ NodeRef::configureConnections怎么用?C++ NodeRef::configureConnections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeRef
的用法示例。
在下文中一共展示了NodeRef::configureConnections方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initRecursisve
void Context::initRecursisve( const NodeRef &node, set<NodeRef> &traversedNodes )
{
if( ! node || traversedNodes.count( node ) )
return;
traversedNodes.insert( node );
for( auto &input : node->getInputs() )
initRecursisve( input, traversedNodes );
node->configureConnections();
}
示例2: configureConnections
// TODO: Checking for DelayNode below is a kludge and will not work for other types that want to support feedback.
// With more investigation it might be possible to avoid this, or at least define some interface that
// specifies whether this input needs to be summed.
void Node::configureConnections()
{
CI_ASSERT( getContext() );
mProcessInPlace = supportsProcessInPlace();
if( getNumConnectedInputs() > 1 || getNumConnectedOutputs() > 1 )
mProcessInPlace = false;
bool isDelay = ( dynamic_cast<DelayNode *>( this ) != nullptr ); // see note above
bool inputChannelsUnequal = inputChannelsAreUnequal();
for( auto &input : mInputs ) {
bool inputProcessInPlace = true;
size_t inputNumChannels = input->getNumChannels();
if( ! supportsInputNumChannels( inputNumChannels ) ) {
if( mChannelMode == ChannelMode::MATCHES_INPUT )
setNumChannels( getMaxNumInputChannels() );
else if( input->getChannelMode() == ChannelMode::MATCHES_OUTPUT ) {
input->setNumChannels( mNumChannels );
input->configureConnections();
}
else {
mProcessInPlace = false;
inputProcessInPlace = false;
}
}
// inputs with more than one output cannot process in-place, so make them sum
if( input->getProcessesInPlace() && input->getNumConnectedOutputs() > 1 )
inputProcessInPlace = false;
// when there are multiple inputs and their channel counts don't match, they must be summed
if( inputChannelsUnequal )
inputProcessInPlace = false;
// if we're unable to process in-place and we're a DelayNode, its possible that the input may be part of a feedback loop, in which case input must sum.
if( ! mProcessInPlace && isDelay )
inputProcessInPlace = false;
if( ! inputProcessInPlace )
input->setupProcessWithSumming();
input->initializeImpl();
}
for( auto &out : mOutputs ) {
NodeRef output = out.lock();
if( ! output )
continue;
if( ! output->supportsInputNumChannels( mNumChannels ) ) {
if( output->getChannelMode() == ChannelMode::MATCHES_INPUT ) {
output->setNumChannels( mNumChannels );
output->configureConnections();
}
else
mProcessInPlace = false;
}
}
if( ! mProcessInPlace )
setupProcessWithSumming();
initializeImpl();
}