本文整理汇总了C++中NodeRef::setNumChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeRef::setNumChannels方法的具体用法?C++ NodeRef::setNumChannels怎么用?C++ NodeRef::setNumChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeRef
的用法示例。
在下文中一共展示了NodeRef::setNumChannels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setProcessor
void Param::setProcessor( const NodeRef &node )
{
if( ! node )
return;
initInternalBuffer();
lock_guard<mutex> lock( getContext()->getMutex() );
resetImpl();
// force node to be mono and initialize it
node->setNumChannels( 1 );
node->initializeImpl();
mProcessor = node;
}
示例2: setProcessor
void Param::setProcessor( const NodeRef &node )
{
if( ! node )
return;
initInternalBuffer();
lock_guard<mutex> lock( getContext()->getMutex() );
resetImpl();
// force node to be mono and initialize it
node->setNumChannels( 1 );
node->initializeImpl();
mProcessor = node;
mIsVaryingThisBlock = true; // stays true until there is no more processor and eval() sets this to false.
}
示例3: 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();
}